pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: MacOS workaround: No suitable Xcode SDK or Command Line Tools installed.



Chris Hanson <cmhanson%eschatologist.net@localhost> writes:

> On May 2, 2019, at 3:03 PM, Hubert Feyrer <hubert%feyrer.de@localhost> wrote:
>> 
>> 
>> FWIW, I've ended up with an environment[1] where pkgsrc doesn't work out of the box, giving me "No suitable Xcode SDK or Command Line Tools installed."
>> 
>> Apparently this is because OSX_VERSION (derived from "/usr/bin/xcrun --show-sdk-version") is not what is expected in "sw_vers -productVersion":
>> 
>> 	promise% /usr/bin/xcrun --show-sdk-version
>> 	10.14
>> 	promise% sw_vers -productVersion
>> 	10.13.6

It's a little more complicated than them not matching.  See
mk/platform/Darwin.mk.  Basically, pkgsrc queries the system version and
then tries to see if the SDK will build for that version.  If that
fails, then there is a switch to proceed anyway.

In your case, I wonder if the logic to use 10.13 from 10.13.6 is off, or
something else.

The basic issue is that on a 10.13 system with the
xcode/command-line-tools you have, by default you will build binaries
that are intended to run on 10.14.  Probably they will mostly work but
some will use a system call or library that isn't there (extrapolating
from what happened to me N versions ago).

> Why does pkgsrc care about this? It should really be passing what it
> gets from "sw_vers -productVersion” as the value for
> -mmacosx-version-min=… (unless something in pkgsrc lets you override
> that to something even lower) and not care about the SDK version.

You seem to understand this much better than many people :)  I am curious
what you think after reading mk/platform/Darwin.mk, which I think is
trying to do what you suggest.

> Background: On Darwin-based platforms, the SDK version represents the
> highest version of an API that can be used (and becomes, e.g.,
> MACOSX_VERSION_MAX_ALLOWED when building), while “deployment target”
> represents the earliest version of an OS that can be run on (and
> becomes, e.g. MACOSX_VERSION_MIN_REQUIRED when building). APIs that
> are newer than the deployment target get weak-linked so they’re NULL
> at runtime on the older OS, but can be called (after a runtime version
> check) at runtime on the newer OS.

I wonder if we should be setting variables like this, and where.
Comments welcome.


Home | Main Index | Thread Index | Old Index