Add FoundationURL trait#118
Open
guoye-zhang wants to merge 4 commits into
Open
Conversation
FranzBusch
reviewed
May 12, 2026
| .library(name: "HTTPTypesFoundation", targets: ["HTTPTypesFoundation"]), | ||
| ], | ||
| traits: [ | ||
| "FoundationURL", |
Member
There was a problem hiding this comment.
Can we add a description to this trait please
Contributor
Author
|
I'm wondering if there is way to disable a target (HTTPTypesFoundation) when the trait is off |
Member
There is not right now. The way to do this is just |
FranzBusch
reviewed
May 13, 2026
Member
FranzBusch
left a comment
There was a problem hiding this comment.
One more thing. Can we add a test that ensures that a resulting binary that builds without the trait will not link any of the Foundation modules. Similar to this https://github.com/apple/swift-openapi-runtime/blob/865bce04b31f9041ab56a3d565fb2f445198f0b5/.github/workflows/pull_request.yml#L90
This file contains hidden or 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
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.
Add a default enabled trait "FoundationURL" that can be disabled for users who don't want Foundation dependencies. Also enable
InternalImportsByDefault.