Opened 19 months ago

Closed 4 weeks ago

#62934 closed defect (duplicate)

Failed to configure qt5-qtbase

Reported by: pcmock Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version: 2.7.0
Keywords: Cc: mascguy (Christopher Nielsen), cjones051073 (Chris Jones), cooljeanius (Eric Gallager), chrstphrchvz (Christopher Chavez)
Port: qt5-qtbase

Description

OS 11.3.1 xcode 12.5 The qt5-qtbase install complains about the macOS 11 SDK is not installed even thought it is installed.

port install qt5-qtbase                                                                                                                                                                  
Warning: The macOS 11 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 qt5-qtbase
--->  Fetching distfiles for qt5-qtbase
--->  Attempting to fetch qtbase-everywhere-src-5.15.2.tar.xz from https://ywg.ca.distfiles.macports.org/mirror/macports/distfiles/qt5
--->  Verifying checksums for qt5-qtbase                                             
--->  Extracting qt5-qtbase
--->  Applying patches to qt5-qtbase
--->  Configuring qt5-qtbase
Error: Failed to configure qt5-qtbase: configure failure: command execution failed
Error: See /Volumes/ZivaDrive/MacPorts/var/macports/logs/_Volumes_ZivaDrive_MacPorts_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_aqua_qt5/qt5-qtbase/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port qt5-qtbase failed

Attachments (2)

qtb.log (415.4 KB) - added by pcmock 19 months ago.
main log file from qt5-qtbase install
qtb2.log (827.2 KB) - added by pcmock 19 months ago.

Download all attachments as: .zip

Change History (25)

Changed 19 months ago by pcmock

Attachment: qtb.log added

main log file from qt5-qtbase install

comment:1 Changed 19 months ago by pcmock

The problem seems to be that my OS is 11.3.1, and the SDK is macosx11.3 instead of macosx11.3.1. Is there a workaround?

xcrun --sdk macosx11.3 --show-sdk-path      
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk

xcrun --sdk macosx11.3.1 --show-sdk-path
xcodebuild: error: SDK "macosx11.3.1" cannot be located.
xcodebuild: error: SDK "macosx11.3.1" cannot be located.
xcrun: error: unable to lookup item 'Path' in SDK 'macosx11.3.1'

comment:2 Changed 19 months ago by pcmock

The initial SDK warning originates from line 3402 in:

libexec/macports/lib/port1.0/portutil.tcl

The SDK error originates from line 233 in:

var/macports/build/_Volumes_ZivaDrive_MacPorts_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_aqua_qt5/qt5-qtbase/work/qtbase-everywhere-src-5.15.2/configure

I tried replacing line 233 with:

sdk="macox11.3"

that seemed to help, but it was not sufficient.

comment:3 Changed 19 months ago by ryandesign (Ryan Schmidt)

MacPorts has never attempted to use any x.y.z version for an SDK; no such SDK has ever existed. It's always been only an x.y version.

If you have not done so, install the command line tools using xcode-select --install as the message suggested.

comment:4 in reply to:  3 Changed 19 months ago by jmroot (Joshua Root)

Replying to ryandesign:

If you have not done so, install the command line tools using xcode-select --install as the message suggested.

If this is happening with other ports and not just qt5, that may be it. But qt5 does change the SDK options in unusual ways.

comment:5 Changed 19 months ago by pcmock

I had already tried this.

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

Also xcrun finds the SDK as shown above, but it fails at line 233 in:

var/macports/build/_Volumes_ZivaDrive_MacPorts_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_aqua_qt5/qt5-qtbase/work/qtbase-everywhere-src-5.15.2/configure

I have 26379 ports installed successfully. Please note that the qt5_qtbase installer cannot find the SDK in line 3402 of:

libexec/macports/lib/port1.0/portutil.tcl

comment:6 in reply to:  5 Changed 19 months ago by kencu (Ken)

Replying to pcmock:

I have 26379 ports installed successfully.

I just have to stop for a moment here and say Holey Canoley.

That must be some kind of record.

Last edited 19 months ago by kencu (Ken) (previous) (diff)

comment:7 Changed 19 months ago by pcmock

No. I'm sorry about my ignorance. I have 470 installed ports.

port list | wc -l

counts all available ports.

comment:8 Changed 19 months ago by pcmock

Is there an environment variable that would help the qt5-qtbase installer find the SDK?

comment:9 Changed 19 months ago by pcmock

I uninstalled and reinstalled Xcode, MacPorts and all ports, and qt5-qtbase still will not install. The symptoms are the same, and it fails in configure. If I modify line 233 in configure as describe earlier, configure runs a lot longer, but it still fails in configure. I'm attaching that main.log file as qtb2.log.

Changed 19 months ago by pcmock

Attachment: qtb2.log added

comment:10 Changed 19 months ago by kencu (Ken)

configure wants an sdk that matches macosx11, but it doesn't exist.

what does exist, on your system now, is macosx and macosx11.3.

This appears to be internal to qt5, unless some PG or Portfile command is messing with it.

Not sure yet -- I don't think many people have built qt5 since the Xcode upgrade, as everyone else installs into /opt/local and so picks up the prebuilt binaries from the buildbot.

Proper fix is to first scour the Portfiles and PortGroups and patchfiles and see if we're doing anything to this, and then if not, patch configure to look for something that actually exists (it's a moving target as Apple changes things).

For you, right now -- I would make a symlink myself so that macosx11 is found, built qt5, and destroy the symlink when it's built. But no MacPorts committer and/or admin should make such a heathen recommendation, so you're stuck until Marcus or somebody like Marcus (me, etc) get around to trying to rebuild qt5-base again against the newest Xcode on BigSur, and fix the build, hopefully without breaking all the previous systems in the process.

qt5 is a bit of a beast, and challenges all build systems, and patience, to the limit.

comment:11 Changed 19 months ago by pcmock

Thank you, but I'm doing something wrong. Is this what you meant?:

sh-3.2# pwd
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
sh-3.2# ls -l
total 0
drwxr-xr-x  5 root  wheel  160 Mar 16 07:03 DriverKit20.4.sdk
drwxr-xr-x  7 root  wheel  224 Mar 16 07:03 MacOSX.sdk
lrwxr-xr-x  1 root  wheel   10 May 21 09:28 MacOSX11.sdk -> MacOSX.sdk

I think this is problem:

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

but I don't know how to fix it.

comment:12 Changed 19 months ago by pcmock

xcrun works with:

% xcrun --sdk macosx11.3 --show-sdk-path 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.sdk

What else needs to be changed?

comment:13 Changed 18 months ago by gcs-github (Guillaume Ceccarelli)

I ran into the same problem, and ended up working around it by changing qt's mkspec file @ qtbase-everywhere-src-5.15.2/mkspecs/common/macx.conf so that QMAKE_MAC_SDK = macosx11.3 (I also set QT_MAC_SDK_VERSION_MAX to 11.3 for good measure, but I don't think that had much of an impact).

Could a suggestion for a fix be to dynamically patch the mkspecs file or otherwise override it so that QMAKE_MAC_SDK is set to macosx{{major}}.{{minor}} when building?

Last edited 18 months ago by gcs-github (Guillaume Ceccarelli) (previous) (diff)

comment:14 Changed 18 months ago by pcmock

That worked! I had to run it twice. I don't know why it failed the first time. I also changed both macx.conf files:

qtbase-everywhere-src-5.15.2/mkspecs/common/macx.conf
qtbase-everywhere-src-5.15.2/mkspecs-save/common/macx.conf

Thank you!

comment:15 Changed 18 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:16 Changed 14 months ago by mascguy (Christopher Nielsen)

Cc: mascguy removed

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

Cc: mascguy added

comment:19 Changed 13 months ago by mascguy (Christopher Nielsen)

Cc: cjones051073 added

comment:20 Changed 13 months ago by cjones051073 (Chris Jones)

I believe so yes. qt5-qtbase (and other qt ports) have built fine for me with this on macOS12 (intel).

comment:21 Changed 13 months ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:22 Changed 12 months ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:23 Changed 4 weeks ago by kencu (Ken)

Resolution: duplicate
Status: assignedclosed

let's keep these all in one ticket, as they all seem to be the same problem with xcrun.

65853

Note: See TracTickets for help on using tickets.