Skip to content

Conversation

bripeticca
Copy link
Contributor

@bripeticca bripeticca commented Aug 28, 2025

  • Explanation:
    Changes the check for trait-guarded target dependencies to determine whether the package dependency from which it derives is used in the parent package; prior to this change, the check was asserting that all traits in the when condition of a target dependency were enabled for the dependency to be considered unguarded, but now the check confirms that at least one trait in the condition is enabled.
  • Scope:
    Package resolution stage; particularly affects pre-computation of transitively enabled traits when determining which target dependencies are/aren't guarded by traits.
  • Issues:
  • Original PRs:
    Fix for .when(traits:) condition not working for multiple traits #9015
  • Risk:
    Low risk; fixes trait-related issues.
  • Testing:
    Regression tests added to multiple suites; tests expectation of included dependencies + guarding traits at various stages of SwiftPM.
  • Reviewers:
    @jakepetroules

…ftlang#9015)

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.
@bripeticca
Copy link
Contributor Author

@swift-ci please test

@bripeticca
Copy link
Contributor Author

@swift-ci please test windows

@bripeticca bripeticca marked this pull request as ready for review September 2, 2025 14:10
@bripeticca bripeticca requested a review from a team as a code owner September 2, 2025 14:10
@bripeticca bripeticca enabled auto-merge (squash) September 2, 2025 18:53
@bripeticca bripeticca merged commit b8f6162 into swiftlang:release/6.2 Sep 5, 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.

3 participants