Skip to content

Use only enabled traits when loading package #8970

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

Conversation

plemarquand
Copy link
Contributor

Both loadPackage and loadRootPackage specified all traits as enabled when loading a package. Narrow this to only the enabled traits so that the returned Package accurately reflects the enabled traits.

Both `loadPackage` and `loadRootPackage` specified all traits as enabled
when loading a package. Narrow this to only the enabled traits so that
the returned `Package` accurately reflects the enabled traits.
@plemarquand
Copy link
Contributor Author

@swift-ci test

@@ -1262,8 +1262,7 @@ extension Workspace {
prebuilts: [:],
fileSystem: self.fileSystem,
observabilityScope: observabilityScope,
// For now we enable all traits
enabledTraits: Set(manifest.traits.map(\.name))
enabledTraits: try manifest.enabledTraits(using: .default)
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: can we add one or more automated tests to ensure we don't regress the behaviour?

@bripeticca
Copy link
Contributor

@swift-ci please test windows

1 similar comment
@plemarquand
Copy link
Contributor Author

@swift-ci please test windows

@bripeticca bripeticca merged commit 6d0dd36 into swiftlang:main Jul 31, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants