-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[SE-0226]: Remove test target dependencies from dependency resolution #2424
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
Conversation
Question: Should we treat The reason I ask that is that this PR makes the |
49ccb32
to
61c9db6
Compare
61c9db6
to
8f1f330
Compare
Looks great in general but I'll do a deeper review later. |
9c1bc87
to
43bcf96
Compare
cc01a15
to
818cb73
Compare
@aciidb0mb3r I applied review comments, the largest of them being to move to a enum on |
I made improvements to this PR by using the fact that we now always have a package name (defaulting to a non-lowercased identity) to use that instead of identity in all user-facing messages. |
37da39e
to
ec75953
Compare
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.
LGTM! Thanks!!
5be8b5e
to
8e8f285
Compare
@swift-ci please smoke test |
8e8f285
to
9b58830
Compare
@swift-ci please smoke test |
This brings back the 5.3 implementation of `dependenciesRequired(for:)` (slightly modified) and also makes it so that `targetsRequired(for:)` for non-root packages only includes targets required by any products. Together this brings the behaviour of dependency resolution to the state of swiftlang#2424.
This brings back the 5.3 implementation of `dependenciesRequired(for:)` (slightly modified) and also makes it so that `targetsRequired(for:)` for non-root packages only includes targets required by any products. Together this brings the behaviour of dependency resolution to the state of swiftlang#2424.
This brings back the 5.3 implementation of `dependenciesRequired(for:)` (slightly modified) and also makes it so that `targetsRequired(for:)` for non-root packages only includes targets required by any products. Together this brings the behaviour of dependency resolution to the state of #2424.
This is a fairly large Pull Request so here's a recap of the changes:
allRequiredTargets
cached property onManifest
that calculates which targets are required to build the manifest's products. All other targets (automatically including test targets) are only used for that package's development, will never be importable from other packages and therefore don't participate in dependency resolution and are not required to build the package graph.allRequiredDependencies
cached property which returns the package dependencies required to build all manifest's products. All other dependencies are only necessary for development, will never be importable from other packages and therefore don't participate in dependency resolution and are not required to build the package graph.isRoot
property onPackageReference
andManifest
to keep track of which packages/manifests are root, as this is necessary to calculate the previous two properties: indeed, all targets and all dependencies are visible from root packages.allRequiredDependencies
during dependency resolution to avoid cloning dependencies which are not needed.allRequiredTargets
andallRequiredDependencies
during package graph building to omit non-required targets and dependencies from the graph. If not, the graph will fail for dependencies which were not cloned during dependency resolution.ManifestTests
to verify thatallRequiredTargets
andallRequiredDependencies
return the expected targets and dependencies.WorkspaceTests
with a complex graph to make sure that dependency resolution and graph building works around different complicated cases.This PR depends on #2423 being merged first.