[MacPorts] #70048: nghttp2 now requires C++20 which introduces a dependency cycle with clang compilers

MacPorts noreply at macports.org
Mon Jun 3 06:24:48 UTC 2024


#70048: nghttp2 now requires C++20 which introduces a dependency cycle with clang
compilers
-------------------------------------------------+-------------------------
  Reporter:  conradkun                           |      Owner:  (none)
      Type:  defect                              |     Status:  new
  Priority:  High                                |  Milestone:
 Component:  ports                               |    Version:  2.9.3
Resolution:                                      |   Keywords:  haspatch
      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                     |
-------------------------------------------------+-------------------------
Changes (by ryandesign):

 * keywords:   => haspatch


Comment:

 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

-- 
Ticket URL: <https://trac.macports.org/ticket/70048#comment:9>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list