Force Xcode SDK instead of CLI SDK?

Clemens Lang cal at macports.org
Fri Nov 20 13:30:33 UTC 2020


Hi Aaron,

On Fri, Nov 20, 2020 at 04:05:47PM +0900, Aaron Madlon-Kay wrote:
> Sorry, I should have mentioned that I tried that, but the result was
> that it still used the CLI SDK:
> 
> SDKROOT='/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk'

That's weird. Can you provide the following please:

1. Your configuration value for developer_dir in macports.conf (I'm
   assuming it's the default).

2. Whether
   ${developer_dir}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk
   exists on your system.

I'm guessing your Xcode is new enough to only ship the MacOSX11.0.sdk in
Xcode's developer dir? That would then run through the check at [1] and
continue below, which would run

  xcrun --sdk macosx10.15 --show-sdk-path

which would fail when you only have the 11.0 one in Xcode.

That would then bring you to [2] which as a last resort tries to find
the matching MacOSX10.15.sdk in the command line tools path before
checking for the unversioned one (which would be a symlink to 11.0) in
Xcode.

Maybe we shouldn't run [2] when `use_xcode yes` is set, and rather
prefer the unversioned SDK from Xcode than the matching SDK from the
command line tools.


[1]: https://github.com/macports/macports-base/blob/master/src/port1.0/portconfigure.tcl#L579-L581
[2]: https://github.com/macports/macports-base/blob/master/src/port1.0/portconfigure.tcl#L595-L598

-- 
Clemens


More information about the macports-dev mailing list