Opened 6 months ago

Closed 5 months ago

Last modified 5 months ago

#70048 closed defect (fixed)

nghttp2 now requires C++20 which introduces a dependency cycle with clang compilers

Reported by: conradkun (Conrad Cardona) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: High Milestone:
Component: ports Version: 2.9.3
Keywords: haspatch Cc: Schamschula (Marius Schamschula), ryandesign (Ryan Carsten Schmidt)
Port: nghttp2 curl clang-5.0 clang-6.0 clang-7.0 clang-8.0 clang-9.0 clang-10 clang-11 clang-12 clang-13 clang-14 clang-15 clang-16 clang-17 clang-18

Description

I am unable to build openslide on my macOS Monterrey (12.0.1). I am using MacPorts 2.9.3 and attaching the log, just in case.

Attachments (3)

openslide_log.txt (97.0 KB) - added by conradkun (Conrad Cardona) 6 months ago.
Log of port install openslide +universal
main.log (396.3 KB) - added by conradkun (Conrad Cardona) 6 months ago.
/opt/local/var/macports/logs/_opt_local_var_macports_sources_github.com_macports_macports-ports_devel_cmake/cmake/main.log
cmake_bootstrap.log (112.2 KB) - added by conradkun (Conrad Cardona) 6 months ago.
/opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_macports_macports-ports_devel_cmake/cmake/work/cmake-3.29.3-x86_64/Bootstrap.cmk/cmake_bootstrap.log

Download all attachments as: .zip

Change History (14)

Changed 6 months ago by conradkun (Conrad Cardona)

Attachment: openslide_log.txt added

Log of port install openslide +universal

comment:1 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: Schamschula ryandesign added
Port: nghttp2 curl clang-5.0 clang-6.0 clang-7.0 clang-8.0 clang-9.0 clang-10 clang-11 clang-12 clang-13 clang-14 clang-15 clang-16 clang-17 clang-18 added; openslide removed
Priority: NormalHigh
Summary: openslide@4.0.0+universal: error: The following dependencies were not installed because all of them have unmet dependencies (likely due to a dependency cycle)nghttp2 now requires C++20 which introduces a dependency cycle with clang compilers

Ok…

Error: The following dependencies were not installed because all of them have unmet dependencies (likely due to a dependency cycle): libjpeg-turbo tiff openjpeg gdk-pixbuf2 cmake curl nghttp2 clang-16 libomp llvm-16 libdeflate lcms2

clang-16 depends on cmake which depends on curl which depends on nghttp2 which depends on clang-16.

This was caused by the recent update of nghttp2 to a version that requires C++20.

I want to enable the +http2 variant in the curl port by default wherever possible because people want HTTP/2 support but it requires nghttp2. The curl port therefore only enables the +http2 variant by default on systems that have a C++14 compiler. Now that nghttp2 requires C++20, we will have to remove +http2 support from most macOS versions since their Xcode versions don't have C++20 compilers.

Or maybe we should switch the compilers to use cmake-bootstrap instead of cmake to resolve the dependency cycle.

comment:2 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

In b2f8c96f9ce0a9ead308bf2f93bd36b58c72ba46/macports-ports (master):

curl: Enable +http2 by default only on macOS 14+

See: #70048

comment:3 Changed 6 months ago by conradkun (Conrad Cardona)

Thank you for your quick fix. Unfortunately, the bootstrapping of cmake does not seem to work on my system. The last lines after trying to install openslide read:

--->  Fetching archive for cmake
--->  Attempting to fetch cmake-3.29.3_0+universal.darwin_21.arm64-x86_64.tbz2 from https://packages.macports.org/cmake
--->  Attempting to fetch cmake-3.29.3_0+universal.darwin_21.arm64-x86_64.tbz2 from https://nue.de.packages.macports.org/cmake
--->  Attempting to fetch cmake-3.29.3_0+universal.darwin_21.arm64-x86_64.tbz2 from http://mirror.fcix.net/macports/packages/cmake
--->  Fetching distfiles for cmake
--->  Attempting to fetch cmake-3.29.3.tar.bz2 from https://gitlab.kitware.com/cmake/cmake/-/archive/v3.29.3
--->  Verifying checksums for cmake                                                          
--->  Extracting cmake
--->  Applying patches to cmake
--->  Configuring cmake
Error: Failed to configure cmake: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_github.com_macports_macports-ports_devel_cmake/cmake/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port openslide failed

I am attaching /opt/local/var/macports/logs/_opt_local_var_macports_sources_github.com_macports_macports-ports_devel_cmake/cmake/main.log as well as /opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_macports_macports-ports_devel_cmake/cmake/work/cmake-3.29.3-x86_64/Bootstrap.cmk/cmake_bootstrap.log.

Note that, as you can probably already see, I am using a local git repo to call port sync. I made sure to pull any changes and sync again before trying to install openslide again.

Changed 6 months ago by conradkun (Conrad Cardona)

Attachment: main.log added

/opt/local/var/macports/logs/_opt_local_var_macports_sources_github.com_macports_macports-ports_devel_cmake/cmake/main.log

Changed 6 months ago by conradkun (Conrad Cardona)

Attachment: cmake_bootstrap.log added

/opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_macports_macports-ports_devel_cmake/cmake/work/cmake-3.29.3-x86_64/Bootstrap.cmk/cmake_bootstrap.log

comment:4 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

Let's keep this ticket to deal only with the dependency cycle introduced by updating nghttp2 to a C++20-requiring version. Other issues should go in other tickets.

The cmake bootstrap failure you mentioned is an unrelated issue seen when trying to build the cmake port universal on some architecture combinations. It was filed as #66213 and #67072 against the cmake-bootstrap port and fixed there by disabling the universal variant. But it also affects the cmake port and the universal variant was not disabled there. You should be able to solve the problem by sudo port clean cmake followed by sudo port install cmake (i.e. installing cmake without the universal variant).

comment:5 Changed 6 months ago by conradkun (Conrad Cardona)

Thank you for your suggestion, it worked :)

comment:6 Changed 6 months ago by jmroot (Joshua Root)

BTW, this also means that nghttp2 can't be built on 10.6 at all, because the current compiler selection logic won't choose anything newer than clang-11 there.

comment:7 Changed 6 months ago by jmroot (Joshua Root)

In 68aad5d94ee59bc5240c47380bd914ea5785ed7f/macports-ports (master):

clang_compilers.tcl: try allowing C++20 on 10.6

See: #70048

comment:8 Changed 5 months ago by jmroot (Joshua Root)

In 8f118cb25575e545ca42033c539653e833a65c76/macports-ports (master):

bind9: remove nghttp2 dep on 10.6

See: #70048

comment:9 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)

Keywords: haspatch added

The only Mach-O file installed by the nghttp2 port is libnghttp2.14.dylib:

% port contents nghttp2
Port nghttp2 @1.62.1_0 contains:
  /opt/local/include/nghttp2/nghttp2.h
  /opt/local/include/nghttp2/nghttp2ver.h
  /opt/local/lib/libnghttp2.14.dylib
  /opt/local/lib/libnghttp2.a
  /opt/local/lib/libnghttp2.dylib
  /opt/local/lib/pkgconfig/libnghttp2.pc

and it does not link with libc++.dylib:

% otool -L /opt/local/lib/libnghttp2.14.dylib
/opt/local/lib/libnghttp2.14.dylib:
	/opt/local/lib/libnghttp2.14.dylib (compatibility version 43.0.0, current version 43.1.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)

The nghttp2 readme says:

Compiling libnghttp2 C source code requires a C99 compiler. gcc 4.8 is known to be adequate. In order to compile the C++ source code, C++20 compliant compiler is required. At least g++ >= 1.12 and clang++ >= 1.15 are known to work.

I tried compiling nghttp2 with configure.compiler=macports-clang-9.0 on macOS 12 the configure script correctly detected a lack of C++20 support:

checking whether ccache /opt/local/bin/clang++-mp-9.0 supports C++20 features by default... no
checking whether ccache /opt/local/bin/clang++-mp-9.0 supports C++20 features with -std=gnu++20... no
checking whether ccache /opt/local/bin/clang++-mp-9.0 supports C++20 features with -std=c++20... no
checking whether ccache /opt/local/bin/clang++-mp-9.0 supports C++20 features with +std=c++20... no
checking whether ccache /opt/local/bin/clang++-mp-9.0 supports C++20 features with -h std=c++20... no
checking whether ccache /opt/local/bin/clang++-mp-9.0 supports C++20 features with -std:c++20... no
configure: No compiler with C++20 support was found

and the port built fine. The port does not enable the test phase so I did not try running the test suite.

The nghttp2-tools subport does fail to build with macports-clang-9.0, and when using a newer clang compiler, the executables it installs do link with libc++ so I would move the C++20 requirement to the nghttp2-tools subport. I submitted a PR for this:

https://github.com/macports/macports-ports/pull/24273

comment:10 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to ryandesign
Resolution: fixed
Status: newclosed

In 3b3f9b3912f47e8b74a7ca7c6f47032a6f044e6c/macports-ports (master):

nghttp2: Require C++20 only for nghttp2-tools subport

Closes: #65066
Closes: #70027
Closes: #70048

comment:11 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)

In 65784cb779b059baae47a00f107e012be432a632/macports-ports (master):

Revert "curl: Move HTTP/2 support back to +http2 variant"

This reverts commit b944040204a0f97164809ada1205c1071e7d8436.

Now that the nghttp2 port no longer imposes a C++ version requirement,
http2 support can be enabled unconditionally.

See: #65056
See: #65063
See: #70048

Note: See TracTickets for help on using tickets.