Opened 5 years ago
Closed 5 years ago
#58998 closed defect (fixed)
port @2.5.99 fails to build a port - in this case ldns.
Reported by: | snowflake (Dave Evans) | Owned by: | jmroot (Joshua Root) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.5.99 |
Keywords: | Cc: | satraul (Satryaji Aulia) | |
Port: | ldns |
Description
port @2.5.99 does not build some ports, while port @2.5.4 does build them.
Environment: macOS 10.11.6, Xcode 8.2.1
Related tickets #58909 for clang-8.0 and #58907 for clang-3.9.
I have bisected the port command and the failing commit in macports-base is:
commit 057ce2b2bfe8d08cafe3f98296546f6a060790ab (refs/bisect/bad) Author: Satryaji Aulia <satraul@macports.org> Date: 2019-06-13 16:24:38 +0100 port1.0: Implement use_xcode option * implement new option use_xcode to indicate Xcode dependency * default DEVELOPER_DIR to Command Line Tools unless port needs Xcode * hide Xcode files on trace mode unless port needs Xcode * fail fetch phase of Xcode-dependent port if Xcode is not installed References https://trac.macports.org/ticket/35045 References https://trac.macports.org/ticket/58016
In all 3 cases of build failure -isysroot for clang does not receive an argument.
It seems to be caused by port using commands in /Library/Developer instead of Applications/Xcode.app. Diff'ing the good and bad logs for the ldns build shows this (logs are attached).
It is entirely possible that my command line tools are out of date or something else equally silly. I have built many ports in the last two weeks and only three of them have failed in this manner.
Attachments (2)
Change History (9)
Changed 5 years ago by snowflake (Dave Evans)
Attachment: | ldns-bad.log added |
---|
Changed 5 years ago by snowflake (Dave Evans)
Attachment: | ldns-good.log added |
---|
ldns successful build
comment:1 Changed 5 years ago by snowflake (Dave Evans)
The macports-ports commit I used to build ldns was 140f92e4a22a563dd73da296413ea741aab52967
comment:2 Changed 5 years ago by jmroot (Joshua Root)
Cc: | satraul added |
---|
comment:3 follow-up: 4 Changed 5 years ago by satraul (Satryaji Aulia)
After investigating, I think the problem is that:
- in the configure phase, macports is decides to use the 'Xcode Clang' compiler (/usr/bin/clang) which we resolve to CommandLineTools
- in the build phase, libtool is called which should be called with the CommandLineTools SDK path in
-isysroot
but isn't. it's empty. should be something like-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.11.sdk
. which is why this warning pops up:clang: warning: no such sysroot directory: '-I/opt/local/include'
- build fails because it couldn't find SDK headers (stdio.h)
I've no idea why 2 happens, my guess that it's related to problems with libtool as discussed here: https://trac.macports.org/ticket/57612
Your guess of that the CLT is out of date is plausible to why -isysroot
is empty. It might be that libtool finds the SDK path using xcrun
which is known to output an empty string on old versions (though it should be a non-zero ouput)
comment:4 Changed 5 years ago by snowflake (Dave Evans)
Replying to satraul:
Your guess of that the CLT is out of date is plausible to why
-isysroot
is empty. It might be that libtool finds the SDK path usingxcrun
which is known to output an empty string on old versions (though it should be a non-zero ouput)
My command line tools according to mpstats is "clt_version": "8.2.0.0.1.1480973914"
comment:5 Changed 5 years ago by jmroot (Joshua Root)
Component: | base → ports |
---|
comment:6 Changed 5 years ago by jmroot (Joshua Root)
Port: | ldns added |
---|
comment:7 Changed 5 years ago by jmroot (Joshua Root)
Owner: | set to jmroot |
---|---|
Resolution: | → fixed |
Status: | new → closed |
ldns failing to build with the bad port command