Skip to content

[5.9] PackageModel: honour .librarian for toolsets #6770

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

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

MaxDesiatov
Copy link
Contributor

@MaxDesiatov MaxDesiatov commented Aug 1, 2023

Cherry-pick of #6688.

When defining a custom toolset, a specified librarian shall be given precedence over the platform's librarian. Use this to repair the toolset test on Windows where ar is unavailable. This test used to succeed due to the leaking of the host tools.

This fixes a bug reproducible when cross-compiling projects with dependencies to any platform, including Linux.

Risk: low, only affects cross-compilation with SwiftPM, which is not widely used yet.

(cherry picked from commit 4d63d66)

When defining a custom toolset, a specified librarian shall be given
precedence over the platform's librarian.  Use this to repair the
toolset test on Windows where `ar` is unavailable.  This test used to
succeed due to the leaking of the host tools.

(cherry picked from commit 4d63d66)
@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

@MaxDesiatov
Copy link
Contributor Author

MaxDesiatov commented Aug 1, 2023

TBD whether this is critical for 5.9 at this late stage. I'll keep the PR open, but it's only reproducible when you cross-compile libraries that are explicitly marked as .static in package manifests, like SwiftSyntax 5.8. In the meantime a possible workaround is to upgrade to SwiftSyntax 5.9.

@MaxDesiatov
Copy link
Contributor Author

Since release/5.9.0 was branched off, this should be ready for review.

@MaxDesiatov MaxDesiatov merged commit 57f737d into release/5.9 Aug 14, 2023
@MaxDesiatov MaxDesiatov deleted the maxd/5.9-fix-toolset-librarian branch August 14, 2023 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cross-compilation swift 5.9 This PR targets the 5.9 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants