Skip to content

[Traits] Add experimental flags to enable specific or all traits, disable default traits #7694

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 2 commits into from
Jun 21, 2024

Conversation

FranzBusch
Copy link
Member

Motivation

When building, testing or running a root package we want users to be able to change the traits enabled in the packages. This allows them to build binaries with different traits enabled or run tests with different traits.

Modification

This PR adds trait options to a few commands and wires them through to the ModuleGraph loading and the build description caching. The latter is important to trigger rebuilds when the trait configuration has changed. Along the way I refactored the GraphLoadingNode and externalised the logic to calculate traits since I need slightly different logic for the root nodes and for the dependency nodes.

Result

swift build/run now support passing trait configuration.

…ult traits

# Motivation
When building, testing or running a root package we want users to be able to change the traits enabled in the packages. This allows them to build binaries with different traits enabled or run tests with different traits.

# Modification
This PR adds trait options to a few commands and wires them through to the ModuleGraph loading and the build description caching. The latter is important to trigger rebuilds when the trait configuration has changed. Along the way I refactored the `GraphLoadingNode` and externalised the logic to calculate traits since I need slightly different logic for the root nodes and for the dependency nodes.

# Result
`swift build/run` now support passing trait configuration.
@FranzBusch
Copy link
Member Author

@swift-ci please test

@FranzBusch FranzBusch changed the title Add experimental flags to enable specific or all traits, disable default traits [Traits] Add experimental flags to enable specific or all traits, disable default traits Jun 21, 2024
Copy link
Contributor

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM, thank you! I have only a single nit for something that seemed like a typo in a comment.

@FranzBusch
Copy link
Member Author

@swift-ci please test

@FranzBusch
Copy link
Member Author

@swift-ci test windows

@FranzBusch FranzBusch enabled auto-merge (squash) June 21, 2024 16:04
@MaxDesiatov
Copy link
Contributor

@swift-ci test windows

@FranzBusch FranzBusch merged commit dbeda87 into swiftlang:main Jun 21, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants