-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[build-script] Disable pkg-config for Darwin hosts (NFC) #33939
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
[build-script] Disable pkg-config for Darwin hosts (NFC) #33939
Conversation
| # For additional isolation, disable pkg-config. Homebrew's pkg-config | ||
| # prioritizes CommandLineTools paths, resulting in compile errors. | ||
| args.extra_cmake_options += [ | ||
| '-DCMAKE_IGNORE_PATH=/usr/lib;/usr/local/lib;/lib', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a cmake option we can use that just does this without us needing to hack around it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spoke with @gottesmm, he's referring to the line below:
-DPKG_CONFIG_EXECUTABLE=/usr/bin/true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was discussed out of band, and the conclusion was that disabling pkg-config via PKG_CONFIG_EXECUTABLE=/usr/bin/false is the most direct & concise way to do this. A larger scoped solution is to use checked-in CMake cache files to explicitly declare SDK dependencies. This could approach could happen in the future.
gottesmm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@swift-ci please smoke test and merge |
Disable
pkg-configon Darwin to prevent compilation issues.This is an NFC follow up to #32436 and #32437.
The benefits are:
pkg-configissues directly, instead of a roundabout wayFor 1, the original issue was that CMake
find_functions would searchpkg-configbefore the SDK. Homebrewpkg-confighardcodes CommandLineTools, even when Xcode is installed, and this caused problems. See SR-12726.Disabling
pkg-configgives better isolation, and it removes the use ofCMAKE_PREFIX_PATHwhich I see as a bigger hammer than disablingpkg-config.Before any of these changes, if
pkg-configis installed, the effective search order was:CMAKE_PREFIX_PATH(empty)HINTSpaths (CommandLineTools viapkg-config)After #32436, the relevant search order became:
CMAKE_PREFIX_PATH(SDK)HINTSpaths (CommandLineTools viapkg-config)Now with this change, the relevant search order is:
CMAKE_PREFIX_PATH(empty)HINTSpaths (empty)