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
Patch *.sdk
paths from pkgConfig files to the current SDK
#6772
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fwcd
requested review from
abertelrud,
neonichu,
tomerd and
MaxDesiatov
as code owners
August 2, 2023 17:23
MaxDesiatov
approved these changes
Oct 4, 2023
@fwcd sorry about the delay with the review, would you mind resolving the conflicts? |
fwcd
force-pushed
the
patch-pkgconfig-sdk-path
branch
from
October 4, 2023 18:47
f1ef1af
to
880ef23
Compare
Sure, I've rebased it onto main! |
@swift-ci test |
@swift-ci test windows |
@swift-ci test windows |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes #6439 by replacing all
*.sdk
paths obtained from pkgConfigs with the current SDK.Motivation:
Using Homebrew-packaged libraries such as Cairo in a system library target on macOS currently causes build failures if the user compiles the Swift package with an Xcode toolchain (see
swift-systemlib-demo
and its CI builds for a minimal example), the build output often looks similar to this:The problem is that Homebrew's pre-compiled libraries sometimes bake the Command Line Tools-paths (
/Library/Developer/CommandLineTools/SDKs/...
) into theirpkgConfig
files, which can clash with the current SDK's headers.See #6439 for details.
Modifications:
As per @neonichu's suggestion in #6439 (comment), this patches the include (
-I
) and library (-L
) paths parsed from pkgConfig files by replacing any*.sdk
path with the current SDK.Thus a flag such as
would be mapped to
when compiling with the macOS 13.3 SDK.
Result:
The
swift-systemlib-demo
package now compiles on macOS.