Opened 2 years ago

Last modified 3 months ago

#61736 assigned defect

qt5 clears configure.sdkroot which causes erroneous "SDK does not appear to be installed" warning

Reported by: cbitterfield (Colin Bitterfield) Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: Cc: mascguy (Christopher Nielsen), joostdekeijzer (joost de keijzer), nospam2000 (Michael Dreher), chrstphrchvz (Christopher Chavez)
Port: qt5

Description

Package: MacPorts-2.6.4_1-11-BigSur.pkg

No matter what I do, I can't install any port with a GUI using QT. The error shows that the SDK is installed.

Problem: BigSur

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'.

Things done:

1. Removal and Reinstall of MacPorts No Change:

2. Removal and reinstall of Xcode 12.2 and CommandLine tools from Package installation. SDK Installed

Razzamataz:SDKs colin$ 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

Xcode Installed:

xcodebuild -version
Xcode 12.2
Build version 12B45b

MacPorts:
MacPorts 2.6.4
Entering shell mode... ("help" for help, "quit" to quit)

OSX:
$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: macOS 11.0.1 (20B50)
      Kernel Version: Darwin 20.1.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: Razzamataz
      User Name: Colin Bitterfield (colin)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 7 days 14:09
      
Commands run to verify:
xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Razzamataz:bin colin$ 

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -license

  1. Software Update (of CommandLine tools) and sudo port selfupdate
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


Razzamataz:bin colin$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: macOS 11.0.1 (20B50)
      Kernel Version: Darwin 20.1.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: Razzamataz
      User Name: Colin Bitterfield (colin)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 7 days 14:23


**SDK Is installed:**
Razzamataz:bin colin$ cd /Library/Developer/CommandLineTools/SDKs/
Razzamataz:SDKs colin$ ls
MacOSX.sdk	MacOSX10.15.sdk	MacOSX11.0.sdk
Razzamataz:SDKs colin$ pwd
/Library/Developer/CommandLineTools/SDKs
Razzamataz:SDKs colin$ 

Razzamataz:SDKs colin$ pwd
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
Razzamataz:SDKs colin$ ls -la
total 0
drwxr-xr-x  5 colin  staff  160 Dec  2 22:28 .
drwxr-xr-x  6 colin  staff  192 Oct 23 19:20 ..
drwxr-xr-x  5 colin  staff  160 Oct 19 13:33 DriverKit20.0.sdk
drwxr-xr-x  7 colin  staff  224 Oct 19 13:33 MacOSX.sdk
lrwxr-xr-x  1 colin  staff   10 Dec  2 22:19 MacOSX11.0.sdk -> MacOSX.sdk


Attachments (2)

main.log (880.7 KB) - added by cbitterfield (Colin Bitterfield) 2 years ago.
Log of Mac Ports
Screen Shot 2020-12-03 at 11.42.27 AM.png (181.8 KB) - added by cbitterfield (Colin Bitterfield) 2 years ago.
Xcode Command LIne Update of files.

Download all attachments as: .zip

Change History (15)

Changed 2 years ago by cbitterfield (Colin Bitterfield)

Attachment: main.log added

Log of Mac Ports

Changed 2 years ago by cbitterfield (Colin Bitterfield)

Xcode Command LIne Update of files.

comment:1 in reply to:  description Changed 2 years ago by ryandesign (Ryan Schmidt)

Component: baseports
Owner: set to MarcusCalhoun-Lopez
Port: qt5 added
Status: newassigned
Summary: Base BigSur 2.6.4 : Warning: The macOS 11.0 SDK does not appear to be installed. Ports may not build correctly.qt5 clears configure.sdkroot which causes erroneous "SDK does not appear to be installed" warning

Replying to cbitterfield:

Warning: The macOS 11.0 SDK does not appear to be installed. Ports may not build correctly.

The qt5 port causes this message to be displayed erroneously, by clearing the variable configure.sdkroot. MacPorts base did not expect any ports to do that, and the port probably should not do that. You can ignore that message for now when it comes from the qt5 port.

The actual build failure in your log is:

:info:build Sorry, "moc" cannot be run on this version of macOS. Qt requires macOS 11.0.0 or later, you have macOS 10.16.0.

That's covered by #61103.

comment:2 Changed 2 years ago by cbitterfield (Colin Bitterfield)

My read on that ticket is adding: macosx_deployment_target 10.16 to macports.conf (which did not work).

Sorry, "moc" cannot be run on this version of macOS. Qt requires macOS 11.0.0 or later, you have macOS 10.16.0.

DEBUG: Starting logging for sqlitebrowser
DEBUG: macOS 11.0 (darwin/20.1.0) arch i386
DEBUG: MacPorts 2.6.4
DEBUG: Xcode 12.2
DEBUG: SDK 11.0
DEBUG: MACOSX_DEPLOYMENT_TARGET: 10.16

comment:3 Changed 2 years ago by cbitterfield (Colin Bitterfield)

Solution:

Edit /etc/sudoers file on line 24 (add this line)

Defaults        env_keep += "SYSTEM_VERSION_COMPAT"

Edit /opt/local/etc/macports/macports.conf Line 168 (add this line)

extra_env       SYSTEM_VERSION_COMPAT

Edit your local profile (.profile, .bashrc, etc)

and the following environment variable setting (export as proper for your shell)

SYSTEM_VERSION_COMPAT=0
export SYSTEM_VERSION_COMPAT

This sets the whole system to respond as OSX 11.0, setting SYSTEM_VERSION_COMPAT=1 will change it to OSX 10.16

comment:4 Changed 17 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:5 Changed 10 months ago by joostdekeijzer (joost de keijzer)

Hi,

On macOS Big Sur, I upgraded my Xcode to v13. Now eg. sqlitebrowser or GPXSee don't build any more with the error: xcrun: error: SDK "macosx11" cannot be located

[my-mac (joostdekeijzer):~]% xcodebuild -version
Xcode 13.2.1
Build version 13C100
[my-mac (joostdekeijzer):~]% 
[my-mac (joostdekeijzer):~]% xcodebuild -showsdks
DriverKit SDKs:
	DriverKit 21.2                	-sdk driverkit21.2

iOS SDKs:
	iOS 15.2                      	-sdk iphoneos15.2

iOS Simulator SDKs:
	Simulator - iOS 15.2          	-sdk iphonesimulator15.2

macOS SDKs:
	macOS 12.1                    	-sdk macosx12.1

tvOS SDKs:
	tvOS 15.2                     	-sdk appletvos15.2

tvOS Simulator SDKs:
	Simulator - tvOS 15.2         	-sdk appletvsimulator15.2

watchOS SDKs:
	watchOS 8.3                   	-sdk watchos8.3

watchOS Simulator SDKs:
	Simulator - watchOS 8.3       	-sdk watchsimulator8.3

[my-mac (joostdekeijzer):~]% 
[my-mac (joostdekeijzer):~]% ls -la /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
total 0
drwxr-xr-x  4 root  wheel  128 Dec 20 13:33 .
drwxr-xr-x  6 root  wheel  192 Dec 20 13:33 ..
drwxr-xr-x  7 root  wheel  224 Dec 20 13:32 MacOSX.sdk
lrwxr-xr-x  1 root  wheel   10 Dec 17 12:32 MacOSX12.1.sdk -> MacOSX.sdk
[my-mac (joostdekeijzer):~]% 
[my-mac (joostdekeijzer):~]% ls -la /Library/Developer/CommandLineTools/SDKs    
total 0
drwxr-xr-x  8 root  wheel  256 Feb 21 13:44 .
drwxr-xr-x  5 root  wheel  160 Feb 16 15:19 ..
lrwxr-xr-x  1 root  wheel   14 Feb 18 12:13 MacOSX.sdk -> MacOSX12.1.sdk
drwxr-xr-x  8 root  wheel  256 Feb 16 15:25 MacOSX10.15.sdk
drwxr-xr-x  7 root  wheel  224 Feb 18 12:14 MacOSX11.3.sdk
lrwxr-xr-x  1 root  wheel   14 Feb 18 12:12 MacOSX11.sdk -> MacOSX11.3.sdk
drwxr-xr-x  7 root  wheel  224 Feb 18 12:14 MacOSX12.1.sdk
lrwxr-xr-x  1 root  wheel   14 Feb 18 12:11 MacOSX12.sdk -> MacOSX12.1.sdk
[my-mac (joostdekeijzer):~]% 

To try to fix, I've uninstalled all ports, re-installed the commandline tools, macports etc. But the error persists.

Below the output of xcrun

[my-mac (joostdekeijzer):~]% xcrun --show-sdk-path             
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
[my-mac (joostdekeijzer):~]% 
[my-mac (joostdekeijzer):~]% xcrun --sdk macosx --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk
[my-mac (joostdekeijzer):~]% 
[my-mac (joostdekeijzer):~]% xcrun --sdk macosx11 --show-sdk-path
xcodebuild: error: SDK "macosx11" cannot be located.
xcodebuild: error: SDK "macosx11" cannot be located.
xcrun: error: unable to lookup item 'Path' in SDK 'macosx11'
[my-mac (joostdekeijzer):~]% 
[my-mac (joostdekeijzer):~]% xcrun --sdk macosx12 --show-sdk-path
xcodebuild: error: SDK "macosx12" cannot be located.
xcodebuild: error: SDK "macosx12" cannot be located.
xcrun: error: unable to lookup item 'Path' in SDK 'macosx12'
[my-mac (joostdekeijzer):~]% 
[my-mac (joostdekeijzer):~]% xcrun --sdk macosx12.1 --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk
[my-mac (joostdekeijzer):~]% 

comment:6 Changed 10 months ago by joostdekeijzer (joost de keijzer)

Cc: joostdekeijzer added

comment:7 Changed 9 months ago by nospam2000 (Michael Dreher)

Cc: nospam2000 added

comment:8 Changed 8 months ago by anonguest00 (mowing-gneiss)

It works !

Full qt5 install @ macOS Monterrey:SDK 12.3 installed / Intel

  • First, you need Visual Studio Code to edit a .plist file in human-readable and autosave as binary (Xcode doesn't allow to edit this file)
  • Don't try to use SDK from Xcode.app
# sudo xcode-select -s /Library/Developer/CommandLineTools
# sudo xcodebuild -l 
# sudo vscode /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/SDKSettings.plist 

In VS-CODE:

  1. Find <key>CanonicalName</key>,
  2. Change value to <string>macosx12</string> (or target you need)
  3. Save

Testing:

# xcrun -k -n --sdk macosx12 --show-sdk-path 
Result:

 IF (WORKS)
   /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
 ELSE
   Warning: The macOS xx.x 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'

Important notes (I spent 6 hours to make it work):

  1. By doing xcode-select you need to edit again /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/SDKSettings.plist
  2. Accept License BEFORE change the plist file
  3. Don't try to use SDK from Xcode.app

Enjoy porting qt5 full

# mac port install qt5

Enjoy!

comment:9 in reply to:  8 Changed 8 months ago by nospam2000 (Michael Dreher)

Replying to anonguest00:

It works !

Nice to hear there is a workaround and it hopefully helps to get a real solution.

Even if your workaround works I would expect side effects to other applications, e.g. Xcode. For me it is too risky to destroy my system and I would not do that.

The right solution would be to change the Qt build process, not the macOS/XCode installation.

Michael

comment:10 Changed 8 months ago by chrstphrchvz (Christopher Chavez)

I don’t have a more constructive suggestion, but modifying SDKSettings.plist or other SDK contents seems highly inadvisable, and not a solution MacPorts would accept. I would not be surprised if this kind of modification breaks system build tools or other ports.

comment:11 Changed 8 months ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:12 Changed 3 months ago by breiter (Brian Reiter)

Despite the warnings in the Portfile, I found a simple solution was to set configure.sdk_version 12.3. I'm sure this isn't the correct solution but it doesn't require hacking Xcode.

            # do not use ${configure.sdk_version}
            # SDK is recorded in ${qt_mkspecs_dir}/qdevice.pri
            # SDK may then be removed if Xcode is updated
            # see https://trac.macports.org/ticket/54044
            # see https://trac.macports.org/ticket/55195
            configure.args-append \
                -sdk macosx

            configure.sdk_version 12.3

comment:13 Changed 3 months ago by breiter (Brian Reiter)

Spoke too soon. The qt5-qtsvg port is not so amenable to the configure.sdk_version patch.

Note: See TracTickets for help on using tickets.