Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#65853 closed defect (fixed)

qt5-qtbase fails to configure

Reported by: AgilentGCMS Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), chrstphrchvz (Christopher Chavez), jhoyt4, wrohv, MaddTheSane (C.W. Betts), catap (Kirill A. Korinsky)
Port: qt5-qtbase

Description

I am rebuilding my ports after an update from macOS Big Sur to Monterey. The port qt5-qtbase (and several other qt5 components) fails to configure and build. I'm attaching main.log.

Attachments (2)

main.log (358.1 KB) - added by AgilentGCMS 2 years ago.
main.2.log (247.3 KB) - added by AgilentGCMS 2 years ago.

Download all attachments as: .zip

Change History (25)

comment:1 Changed 2 years ago by AgilentGCMS

main.log is 20M, too large to attach here. You can find it here.

comment:2 Changed 2 years ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:3 in reply to:  1 ; Changed 2 years ago by chrstphrchvz (Christopher Chavez)

Replying to AgilentGCMS:

main.log is 20M, too large to attach here. You can find it here.

As stated in the MacPorts guide, you should provide main.log for a clean build, which would have been a far smaller file.

However, from the final attempt in what you provided, the issue appears to be some variant of the previously-reported Failed to resolve SDK path for 'macosx12' issue. You have Xcode 14, so I wonder if it is related to this issue observed with Xcode 14 beta: https://github.com/macports/macports-ports/pull/15136. I am not aware how soon any issues involving Xcode 14 will be addressed, so if you do not specifically need Xcode 14, consider reinstalling an earlier Xcode version and trying the build again.

You will also want to update your ports tree first as this port and its dependencies were recently updated.

comment:4 Changed 2 years ago by MStraeten (Martin Straeten)

temporary workaround: use a user specific Portfile

after sudo port selfupdate:

mkdir ~/ports/aqua
cp -R "$(port dir qt5)" ~/ports/aqua

then edit Portfile and add line 1368:

configure.sdk_version 12.3

then add "file:///Users/<username>/ports" (change <username> to your actual login) to /opt/local/etc/macports/sources.conf before [default] line and run

portindex ~/ports

once thats done the update should work - at least id did that successfully yesterday on my machine with XCode14 ;)

when the issue is fixed you can delete that temporary solution (delete the ~/ports/aqua/qt5 directory, run portindex ~/ports) and the the usual port selfupdate will receive the official fix.

Last edited 2 years ago by MStraeten (Martin Straeten) (previous) (diff)

comment:5 in reply to:  3 Changed 2 years ago by AgilentGCMS

Replying to chrstphrchvz:

As stated in the MacPorts guide, you should provide main.log for a clean build, which would have been a far smaller file.

Ah OK, I've done a clean build now, and am attaching the (much smaller) main.log.

However, from the final attempt in what you provided, the issue appears to be some variant of the previously-reported Failed to resolve SDK path for 'macosx12' issue. You have Xcode 14, so I wonder if it is related to this issue observed with Xcode 14 beta: https://github.com/macports/macports-ports/pull/15136. I am not aware how soon any issues involving Xcode 14 will be addressed, so if you do not specifically need Xcode 14, consider reinstalling an earlier Xcode version and trying the build again.

As far as I know, I have Xcode 13.4

$ pkgutil --pkg-info=com.apple.pkg.{CLTools_Executables,CLTools_Base,DeveloperToolsCLI,DeveloperToolsCLILeo} 2>/dev/null | sed -n 's/^version: //p'
13.4.0.0.1.1651278267

I explicitly installed 13.4 because I had heard of problems with 14.0. I should say that whenever I try to build a port I get the warning Warning: The macOS 12 SDK does not appear to be installed. Ports may not build correctly. but then the port builds fine (until this one, that is).

You will also want to update your ports tree first as this port and its dependencies were recently updated.

OK, I will update my port tree and try again. Thanks for the help so far!

Changed 2 years ago by AgilentGCMS

Attachment: main.log added

comment:6 in reply to:  3 Changed 2 years ago by AgilentGCMS

However, from the final attempt in what you provided, the issue appears to be some variant of the previously-reported Failed to resolve SDK path for 'macosx12' issue. You have Xcode 14, so I wonder if it is related to this issue observed with Xcode 14 beta: https://github.com/macports/macports-ports/pull/15136. I am not aware how soon any issues involving Xcode 14 will be addressed, so if you do not specifically need Xcode 14, consider reinstalling an earlier Xcode version and trying the build again.

It seems that I do have Xcode 14, despite trying to stick to 13.4. It's possible this got updated in the background. I will see if I can roll back and stick to 13.4.

comment:7 in reply to:  4 ; Changed 2 years ago by AgilentGCMS

Replying to MStraeten:

temporary workaround: use a user specific Portfile

I tried this workaround, but qt5 still doesn't build. This is what my (modified) port file looks like around line 1386:

            # 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 \
            # configure options that don't show up in configure --help
            configure.args-append \
                -no-libudev       \
                -no-egl

All I did was add that line configure.sdk_version 12.3 \ there. Apologies if I'm making an obvious mistake; I use ports to make my macOS more linux-like, but I have no idea how the innards work.

The error message I got was

--->  Configuring qt5-qtbase
Error: Failed to configure qt5-qtbase: configure failure: command execution failed
Error: See /Users/sbasu1/packages/macports/var/macports/logs/_Users_sbasu1_ports_aqua_qt5/qt5-qtbase/main.log for details.

Attaching main.log here.

Changed 2 years ago by AgilentGCMS

Attachment: main.2.log added

comment:8 Changed 2 years ago by AgilentGCMS

Also, it seems like I'm stuck with using Xcode 14 for now, so a workaround would be really helpful!

comment:9 in reply to:  7 ; Changed 2 years ago by MStraeten (Martin Straeten)

Replying to AgilentGCMS:

Replying to MStraeten: All I did was add that line configure.sdk_version 12.3 \ there.

you don't need the backslash

comment:10 in reply to:  9 Changed 2 years ago by AgilentGCMS

Replying to MStraeten:

Replying to AgilentGCMS:

Replying to MStraeten: All I did was add that line configure.sdk_version 12.3 \ there.

you don't need the backslash

Ah indeed, now my qt5 ports build successfully. Thanks :-)

comment:11 Changed 2 years ago by MaintenanceCosts

Had the same issue with the same port, trying to migrate my ports from Monterey to Ventura. Martin's workaround (appropriately modified for macOS 13) solved the issue for me.

comment:12 Changed 2 years ago by jhoyt4

To be precise, Ventura users will need to enter the following to get this working

configure.sdk_version 13.0

I also needed to install the Xcode 14.2 and command line utilities release candidates to get fully up and running.

Last edited 2 years ago by jhoyt4 (previous) (diff)

comment:13 Changed 2 years ago by kencu (Ken)

it is frustrating this workaround is needed.

there is an SDK in the folder named MacOSX13.sdk, but it won't work with xcrun to call it.

% ls -la /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
total 0
drwxr-xr-x  5 user  staff  160 26 Oct 14:03 .
drwxr-xr-x  6 user  staff  192 22 Oct 06:41 ..
drwxr-xr-x  7 user  staff  224 26 Oct 13:58 MacOSX.sdk
lrwxr-xr-x  1 user  staff   10 26 Oct 13:56 MacOSX13.0.sdk -> MacOSX.sdk
lrwxr-xr-x  1 user  staff   10 26 Oct 13:56 MacOSX13.sdk -> MacOSX.sdk
% xcrun -sdk macosx13 --show-sdk-path                                                     
2022-10-28 06:56:31.576 xcodebuild[92396:6959077] Writing error result bundle to /var/folders/b4/rjyd2skj48b3hc6t2xmpdyfh0000gn/T/ResultBundle_2022-28-10_06-56-0031.xcresult
xcodebuild: error: SDK "macosx13" cannot be located.
2022-10-28 06:56:33.680 xcodebuild[92399:6959129] Writing error result bundle to /var/folders/b4/rjyd2skj48b3hc6t2xmpdyfh0000gn/T/ResultBundle_2022-28-10_06-56-0033.xcresult
xcodebuild: error: SDK "macosx13" cannot be located.
xcrun: error: unable to lookup item 'Path' in SDK 'macosx13'

% xcrun -sdk macosx13.0 --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk
Version 1, edited 2 years ago by kencu (Ken) (previous) (next) (diff)

comment:14 in reply to:  13 Changed 2 years ago by jhoyt4

Replying to kencu:

I am not clear why macosx13.0 works but macosx13 does not...

Me either, took me a minute to try it, hence the post in case it could help

BTW - I can confirm it works on both ARM and Intel.

Last edited 2 years ago by jhoyt4 (previous) (diff)

comment:15 Changed 2 years ago by jhoyt4

Cc: jhoyt4 added

comment:16 Changed 2 years ago by wrohv

Cc: wrohv added

comment:17 Changed 2 years ago by MaddTheSane (C.W. Betts)

Cc: MaddTheSane added

comment:18 in reply to:  13 Changed 2 years ago by kencu (Ken)

I think this PR is needed to fix this:

https://github.com/macports/macports-ports/pull/15136

Mark took code that was working in the qmake5 PG and added it to the qt5-qtbase ports.

That's probably what we need to test next here.

comment:19 Changed 2 years ago by kencu (Ken)

this should fix it. Has been working in the qmake5 PortGroup for months, and works for me to build qt5-qtbase on Ventura.

[08a83769c3a8e99015816661f5a475cbd84a7837/macports-ports]

comment:20 Changed 2 years ago by catap (Kirill A. Korinsky)

Cc: catap added

comment:21 Changed 2 years ago by jhoyt4

thanks @kencu - I can confirm that qt5-qtbase now builds correctly on intel and arm both running Ventura

comment:22 Changed 2 years ago by kencu (Ken)

Resolution: fixed
Status: newclosed

OK.

Something else may crop up, always does, but fixed for now.

I suspect we can start stripping out all those

use_xcode yes

lines we’ve added too.

comment:23 Changed 2 years ago by zeldin (Marcus Comstedt)

Sorry, but it's not fixed yet. The test using "--find ld" does not work, because even if the sdk name is not recognized, you still get a path to ld and a zero exit code:

mikan:~% /usr/bin/xcrun --sdk macosx13 --find ld    
xcrun: error: SDK "macosx13" cannot be located
/Library/Developer/CommandLineTools/usr/bin/ld
mikan:~% echo $?
0
mikan:~% /usr/bin/xcrun --sdk macosx --find ld   
/Library/Developer/CommandLineTools/usr/bin/ld
mikan:~% echo $?
0
mikan:~% 

Contrast this with using "--show-sdk-path" for the test:

mikan:~% /usr/bin/xcrun --sdk macosx13 --show-sdk-path
xcrun: error: SDK "macosx13" cannot be located
xcrun: error: SDK "macosx13" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'macosx13'
mikan:~% echo $?
1
mikan:~% /usr/bin/xcrun --sdk macosx --show-sdk-path 
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
mikan:~% echo $?
0
mikan:~% 

This is on macOS Ventura 13.0 (arm64) with XCode command line tools 14.1.0.0.1.1666437224.

Note: See TracTickets for help on using tickets.