Opened 5 years ago

Last modified 5 months ago

#58659 assigned defect

nghttp2: fails to build with non-standard xcode path

Reported by: lkraider (Paul Eipper) Owned by: Schamschula (Marius Schamschula)
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc:
Port: nghttp2

Description

The build works up to a point, then fails trying to locate Xcode in another (hardcoded?) path:

:info:build libtool: link: /usr/bin/clang -pipe -Os -isysroot/Users/paul/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -arch x86_64 -Wl,-headerpad_max_install_names -Wl,-syslibroot -Wl,/Users/paul/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -arch x86_64 -o .libs/libevent-server libevent-server.o -pthread  -L/opt/local/lib ../lib/.libs/libnghttp2.dylib ../third-party/.libs/liburl-parser.a -levent -levent_openssl -lcrypto -lssl -ldl -pthread
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_www_nghttp2/nghttp2/work/nghttp2-1.39.1/examples'
:info:build Making all in python
:info:build make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_www_nghttp2/nghttp2/work/nghttp2-1.39.1/python'
:info:build /opt/local/bin/python2.7 setup.py build
:info:build running build
:info:build running build_ext
:info:build building 'nghttp2' extension
:info:build /usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -pipe -Os -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I../lib -I../lib/includes -I../lib/includes -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c nghttp2.c -o build/temp.macosx-10.14-x86_64-2.7/nghttp2.o
:info:build clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk' [-Wmissing-sysroot]
:info:build In file included from nghttp2.c:4:
:info:build /opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:33:10: fatal error: 'stdio.h' file not found
:info:build #include <stdio.h>
:info:build          ^~~~~~~~~
:info:build 1 error generated.
:info:build error: command '/usr/bin/clang' failed with exit status 1

Correct Xcode path is: $ xcode-select -p /Users/paul/Applications/Xcode.app/Contents/Developer

Build fails trying to access: /Applications/Xcode.app/Contents/Developer

Attachments (1)

main.log (216.5 KB) - added by lkraider (Paul Eipper) 5 years ago.
build log

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by lkraider (Paul Eipper)

Attachment: main.log added

build log

comment:1 Changed 5 years ago by Schamschula (Marius Schamschula)

I wonder how many users install Xcode in /Users/*/Applications.

There is nothing in the nghttp2 Portfile that provides a path to Xcode. That said, it seems that in this case MacPorts python somehow sets sysroot to "". I think CMAKE_SYSROOT needs to be set.

However, there is no standard way to determine the path to Xcode.

comment:2 Changed 5 years ago by lkraider (Paul Eipper)

Shouldn't xcode-select be used for that? It seems to be required to be set when running xcode tools in the terminal.

comment:3 Changed 5 years ago by ronan-gloo (Ronan)

Using version 10.14.6 here with standard installation path, i symlinked the sdk to its expected versioned name by nghttp2 to get it built:

sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk

Guess the port is not expecting the SDK to the right place maybe.

comment:4 in reply to:  3 Changed 5 years ago by Schamschula (Marius Schamschula)

Replying to ronan-gloo:

Using version 10.14.6 here with standard installation path, i symlinked the sdk to its expected versioned name by nghttp2 to get it built:

sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk

Guess the port is not expecting the SDK to the right place maybe.

See comment:1.

I'm assuming you are using Xcode 11.x. Therefore, you are likely going to run into this problem in other ports until MacPorts has a general solution. I'm still using Xcode 10.3 under Mojave, and see no such issue.

Last edited 5 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)
Note: See TracTickets for help on using tickets.