Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#61458 closed defect (invalid)

fresh install on Big Sur emits warning about SDK not installed

Reported by: wlipa (Bill Lipa) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: Cc:
Port:

Description

I updated Xcode to 12.2 and installed a fresh version of MacPorts for Big Sur. Xcode-select reports that the command line tools are installed:

$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

However the port command is giving a warning that the 11.0 SDK is not found. I have accepted the Xcode license on the command line and verified that Xcode itself launches without installing components.

$ sudo port install xz  
Warning: The macOS 11.0 SDK does not appear to be installed. Ports may not build correctly.
Warning: You can install it as part of the Xcode Command Line Tools package by running `xcode-select --install'.
--->  Computing dependencies for xz
...

Change History (8)

comment:1 Changed 4 years ago by wlipa (Bill Lipa)

Xcode seems to think it's there:

$ xcodebuild -showsdks
iOS SDKs:
	iOS 14.2                      	-sdk iphoneos14.2

iOS Simulator SDKs:
	Simulator - iOS 14.2          	-sdk iphonesimulator14.2

macOS SDKs:
	DriverKit 20.0                	-sdk driverkit.macosx20.0
	macOS 11.0                    	-sdk macosx11.0

tvOS SDKs:
	tvOS 14.2                     	-sdk appletvos14.2

tvOS Simulator SDKs:
	Simulator - tvOS 14.2         	-sdk appletvsimulator14.2

watchOS SDKs:
	watchOS 7.1                   	-sdk watchos7.1

watchOS Simulator SDKs:
	Simulator - watchOS 7.1       	-sdk watchsimulator7.1


comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

It works fine for us.

Please verify that the path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk exists. If it does not, reinstall Xcode 12.2.

Please verify that the path /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk exists. If it does not, reinstall the Xcode 12.2 version of the command line tools.

comment:3 Changed 4 years ago by wlipa (Bill Lipa)

Thanks, looks like those don't agree. Is there a recommended way to reinstall the command line tools?

$ ls -l /Library/Developer/CommandLineTools/SDKs
total 0
lrwxr-xr-x  1 root  wheel   15 Jan 14  2020 MacOSX.sdk -> MacOSX10.15.sdk
drwxr-xr-x  7 root  wheel  224 Jan 14  2020 MacOSX10.14.sdk
drwxr-xr-x  8 root  wheel  256 Jan 14  2020 MacOSX10.15.sdk

$ ls -l /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
total 0
drwxr-xr-x  5 root  wheel  160 Oct 19 13:33 DriverKit20.0.sdk
drwxr-xr-x  7 root  wheel  224 Nov 13 08:32 MacOSX.sdk
lrwxr-xr-x  1 root  wheel   10 Nov 13 08:28 MacOSX11.0.sdk -> MacOSX.sdk

comment:4 Changed 4 years ago by mseri (Marcello Seri)

Also in my case the versions were not matching. The following fixed it (for me):

$ sudo rm -rf /Library/Developer/CommandLineTools
$ xcode-select --install

It installed the new Command Line Tools and everything started working fine.

comment:5 Changed 4 years ago by wlipa (Bill Lipa)

Thanks. I wound up downloading the Xcode 12.2 command line tools from Apple's developer site. Running that installer solved the problem.

comment:6 Changed 4 years ago by jmroot (Joshua Root)

Yes, installing the pkg will do it. Unfortunately there is a bug where the receipt for the Command Line Tools is deleted on every Xcode (and possibly OS) update. Without the receipt, Software Update will never offer to update the CLTs. I don't know if it's still present on Big Sur but it happened on Catalina when updating to Xcode 12.2. We have a problem hotlist entry about this: ProblemHotlist#reinstall-clt

Last edited 4 years ago by jmroot (Joshua Root) (previous) (diff)

comment:7 Changed 4 years ago by jmroot (Joshua Root)

Resolution: invalid
Status: newclosed

Closing since the warning is correctly pointing out outdated CLTs.

comment:8 Changed 4 years ago by wlipa (Bill Lipa)

The warning was correct, but the advice it gave wasn't (it did nothing for my case), which causes confusion. How about changing it to:

Warning: You can install it as part of the Xcode Command Line Tools package by running `xcode-select --install'.  In some cases, you may need to remove /Library/Developer/CommandLineTools before doing so.
Note: See TracTickets for help on using tickets.