Skip to content

Conversation

bripeticca
Copy link
Contributor

@bripeticca bripeticca commented Aug 27, 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:
    @dschaefer2 @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

@bripeticca
Copy link
Contributor Author

@swift-ci please test windows

1 similar comment
@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
Copy link
Contributor Author

@swift-ci please test windows

@bripeticca bripeticca enabled auto-merge (squash) September 2, 2025 18:53
@dschaefer2
Copy link
Member

Ah, it needs a branch owner to approve.

@bripeticca
Copy link
Contributor Author

Closing since this will now be a part of a separate patch release.

@bripeticca bripeticca closed this Sep 8, 2025
auto-merge was automatically disabled September 8, 2025 17:07

Pull request was closed

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