-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix for .when(traits:) condition not working for multiple traits #9015
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
Fix for .when(traits:) condition not working for multiple traits #9015
Conversation
The culprit here is the fact that we were essentially doing an AND boolean check across all the traits in the target dependency condition, when we should be doing an OR boolean check. If at least one trait is enabled in the list of traits in the target dependency condition, then the target dependecy should be considered enabled as well.
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch! Can we add to our trait fixtures this setup as well where a single dependency is guarded by two traits?
@swift-ci please test |
@swift-ci please test windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments for your consideration.
* Added a wrapper struct that contains a list of traits that could be passed as an argument + the expected output for said combination for TraitTests * Added extra test cases to traits-related Manifest tests, accounting for target dependencies that are enabled by many traits
@swift-ci please test |
@swift-ci please test |
@swift-ci please test windows |
@swift-ci please test self hosted windows |
The culprit here is the fact that we were essentially doing an AND boolean check across all the traits in the target dependency condition, when we should be doing an OR boolean check.
If at least one trait is enabled in the list of traits in the target dependency condition, then the target dependecy should be considered enabled as well.