-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Assure trait-guarded dependencies are not included in resolution; precompute enabled traits before resolution #8852
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
Open
bripeticca
wants to merge
25
commits into
swiftlang:main
Choose a base branch
from
bripeticca:traits/guardedbug
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+752
−564
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
5469b84
Fix for trait-guarded deps being included in resolution
bripeticca f67f3df
Comment cleanup
bripeticca 0d46a4c
De-duplicate calculation of transitively enabled traits
bripeticca e6bc7e6
Precompute traits and persist to module graph load
bripeticca 6a3d2bb
Fix trait tests to account for removal of guarded deps
bripeticca e5c9eb8
Precompute traits + modify tests
bripeticca 3b28262
Remove instances of optional set of enabled traits
bripeticca c134113
Introduce new EnabledTraitsMap struct
bripeticca 2398e7d
Move enabled traits map into Workspace
bripeticca 1b1ba10
Merge branch 'main' into traitresolutionbug
bripeticca adf28f7
Cleanup; logging messages to help debug failing traits tests
bripeticca 6c2ce58
Add trait configuration to calls on getActiveWorkspace
bripeticca cb6723e
Amend plugin command configuration of package graph
bripeticca 307867f
Allow workspace to update its trait configuration
bripeticca eb36991
Add trait configuration to SwiftCommandState
bripeticca c0ecd4e
Ensure PackageGraphRoot.init has latest enabledTraitsMap
bripeticca e989978
Cleanup
bripeticca ad0b958
Move EnabledTraitsMap to its own file in PackageModel
bripeticca 7e71383
Cleanup remaining comments/whitespace
bripeticca da91ac0
Add EnabledTraitsMap.swift to CMakeList
bripeticca 886d272
Remnant cleanup
bripeticca 9113b3e
Fix ModulesGraph load method
bripeticca 0b63db4
Merge branch 'main' into traitresolutionbug
bripeticca fcc904e
Fix remaining logs left in for debugging
bripeticca 7fad68a
Address PR comments
bripeticca File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
question: what benefit does passing this argument have on the creation of a build system? Should the
enableAllTraits
option be provided when building instead?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.
This will affect how the
SwiftCommandState
fetches and stores the currently active workspace, which is determined by its methodSwiftCommandState.getActiveWorkspace
. When creating a build system, there are many calls to variousSwiftCommandState
methods that callgetActiveWorkspace
, and the workspace that is created in this method is stored in its_workspace
property.The workspace is only ever created once in this method, and every subsequent call to this method checks whether the
_workspace
property has a value. If so, it will return the workspace stored there.The reason why we have
enableAllTraits
propagated to this call is because we have special edge case scenarios where we would initially create aSwiftCommandState
with some trait configuration, but if we then make a call that wishes to dump the symbol graph (seePluginDelegate.createSymbolGraphForPlugin
), it will return a workspace that has whichever trait configuration we've initialized with theSwiftCommandState
, which isn't always what we'd want when requesting a dump of the symbol graph.