Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qmake5 PG: allow xcrun test to work on older system #10778

Merged
merged 1 commit into from Apr 24, 2021

Conversation

MarcusCalhoun-Lopez
Copy link
Contributor

See
9887e90#commitcomment-49824261

Description

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 11.2.3 20D91 x86_64
Xcode 12.4 12D4e

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL?
  • checked your Portfile with port lint?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?

@macportsbot macportsbot added by: member Created by a member with commit rights type: bugfix labels Apr 23, 2021
MarcusCalhoun-Lopez referenced this pull request Apr 23, 2021
Instead of testing for the path, just use `xcrun` to verify the
availability of the desired SDK version.

The existence of an appropriately named SDK directory (e.g.
`MacOSX${configure.sdk_version}.sdk`) is not sufficient to determine
whether the desired SDK actually exists; e.g., a compatibility symlink
might exist, but actually point to a later SDK version.

Without this change, qmake builds will fail when the toolchain actually
attempts to resolve such an SDK version.
@kencu
Copy link
Contributor

kencu commented Apr 24, 2021

well, that's very interesting... on 10.7, seems to be able to identify if the given sdk exists, indeed. I haven't tried 10.6 yet, but this one works.

$ /usr/bin/xcrun --sdk macosx10.6 --find ld
xcodebuild: error: SDK "macosx10.6" cannot be located.
xcrun: error: unable to find utility "ld", not a developer tool or in PATH
$ /usr/bin/xcrun --sdk macosx10.7 --find ld
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
$ /usr/bin/xcrun --find ld
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
$ /usr/bin/xcrun --sdk macosx10.8 --find ld
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
$ /usr/bin/xcrun --sdk macosx10.9 --find ld
xcodebuild: error: SDK "macosx10.9" cannot be located.
xcrun: error: unable to find utility "ld", not a developer tool or in PATH

@kencu
Copy link
Contributor

kencu commented Apr 24, 2021

And 10.6 seems happy enough as well, FYI:

SnowLeopardServerVM:~$ xcrun -sdk macosx10.6 -find ld
/Developer/usr/bin/ld
SnowLeopardServerVM:~$ xcrun -sdk macosx10.7 -find ld
xcodebuild: error: SDK "macosx10.7" cannot be located.

/Developer/usr/bin/xcodebuild fails with 256 - Unknown error: 256
SnowLeopardServerVM:~ cunningh$ xcrun -sdk macosx10.5 -find ld
/Developer/usr/bin/ld
SnowLeopardServerVM:~$ xcrun -sdk macosx10.4 -find ld
/Developer/usr/bin/ld
SnowLeopardServerVM:~$ xcrun -sdk macosx10.9 -find ld
xcodebuild: error: SDK "macosx10.9" cannot be located.

/Developer/usr/bin/xcodebuild fails with 256 - Unknown error: 256

@MarcusCalhoun-Lopez
Copy link
Contributor Author

Thanks to all for the reviews.

@MarcusCalhoun-Lopez MarcusCalhoun-Lopez merged commit be588d4 into macports:master Apr 24, 2021
@MarcusCalhoun-Lopez MarcusCalhoun-Lopez deleted the qmake_fix branch April 24, 2021 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
by: member Created by a member with commit rights type: bugfix
4 participants