macOS 11.1 SDK does not appear to be installed
Ryan Schmidt
ryandesign at macports.org
Thu Feb 11 23:20:57 UTC 2021
On Feb 11, 2021, at 14:50, Todd Doucet wrote:
> I have read everything I can about this warning, but none of it corresponds to exactly my situation, hence this report.
>
> I have a brand new Mac Mini M1, and a fresh MacPorts installation. This is not an upgrade--I have never had MacPorts on this machine, ever.
>
> I definitely have both Xcode 12.4 and the Command Line Tools that Xcode wanted to install. I do not know the version number of those tools because I don't know how to find that out. But it is whatever Apple provided by install a few days ago. I have provided all the incantations that I have seen on your web pages to install, verify install, accept licenses, etc. And this is Big Sur 11.1.
>
> Yet I see the following message when building various ports from source:
>
> Warning: The macOS 11.1 SDK does not appear to be installed. Ports may not build correctly.
>
> Reading other threads and guessing a little, maybe I am supposed to ignore the warning. If that is not the case, I sure do not know what I am supposed to do instead.
>
> I discovered this when I started to work on figuring out why the MacPorts py39.scipy port does not actually work, and maybe helping to fix it. (It fails scipy.test(), for example, or even segfaults if you "import scipy.signal" among other things.)
>
> I actually have a handle on the problem and would like to contribute a solution, but really first I would like there to be no uncertainty about whether I have a working MacPorts system itself.
>
> I am reporting this because I imagine that the developers would want to know if a brand-new installation on a brand-new computer does not actually work, or at the very least generates specious warnings. I know I would want to know that.
>
> I know that this is early days and ports themselves are expected to be broken for a while. But really I think MacPorts itself is supposed to install and work correctly on a fresh install on a new machine.
MacPorts 2.6.4 was released before Apple released macOS 11.1. We did not yet know how the version numbers of macOS and the macOS SDK would progress under macOS 11. We made a guess based on what had happened in macOS 10.15 and earlier, and we guessed wrong. We have corrected the code already and it will be included in a future version of MacPorts.
macOS 11 users can ignore this warning until that future version of MacPorts is released, with the caveat that it is still important to have both Xcode and the command line tools installed, so users should manually verify that this is the case, not just once but periodically, especially after an OS update, since macOS has had a bug which deletes the CLT receipt, thus preventing the CLT from showing up in software update. Also do make sure that you have a matched set of Xcode and the command line tools -- and I think that perhaps you do not, possibly due to the aforementioned macOS bug. See https://trac.macports.org/wiki/ProblemHotlist#reinstall-clt
The warning is occurring because you are using a version of macOS (11.1) with a version of Xcode and/or the command line tools that does not contain an SDK of that version. You say you are using Xcode 12.4 but Xcode 12.4 does contain the 11.1 SDK so if the port you are seeing the message with is using Xcode, then you should not see this warning.
Most ports do not use Xcode; they use the command line tools. So it is possible that you are using a version of the command line tools that does not contain the 11.1 SDK. You can check what SDK it contains by listing the contents of the directory /Library/Developer/CommandLineTools/SDKs. Assuming that MacOSX11.1.sdk is not in that directory, you should probably reinstall the Xcode 12.4 version of the command line tools per the link above (or by downloading from the Apple developer web site) so that you have a matched set, which will probably eliminate the warning.
If you update to macOS 11.2, the warning will come back, since there is no version of Xcode or the command line tools that contains the 11.2 SDK.
If you wish, you could build MacPorts base from our git repository to receive the fix early.
More information about the macports-users
mailing list