forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
TransitiveTargetsRequest
as input for resolving `TransitiveTarg…
…ets` (pantsbuild#10915) ### Problem As explained in pantsbuild#10888, we are not properly handling "special-cased" dependencies-like fields, such as `python_tests`'s `runtime_package_dependencies` field. We need those fields' dependencies to show up in project introspection, such as `./pants dependencies`, but _not_ in other contexts like when resolving the transitive targets to determine what source files are used by Pytest. That is, we need to be able to parametrize `await Get(TransitiveTargets)` so call sites can determine the behavior they want. ### Solution Add `TransitiveTargetsRequest`, which will allow us to add new fields to it to change its behavior. This mirrors how we have `DependenciesRequest` for direct deps. Note that this means you can no longer request `TransitiveTargets` as a parameter to your rule and have it be evaluated automatically by looking at the `Specs`. You must now request `Addresses`, and then use `await Get`. There's an argument for this being a good thing. It's a bit confusing (imo) how some types like `Addresses` can be in a rule signature and will be evaluated by using the Specs. This means that you can now only do that with `Addresses` and `Targets`, but not `TransitiveTargets`. To work around pantsbuild#10917, we add a `DependenciesRequestLite` and `TransitiveTargetsLite` for use with codegen. These behave almost the same, but don't work with dep inference. [ci skip-rust] [ci skip-build-wheels]
- Loading branch information
1 parent
ee50791
commit ff02ef0
Showing
16 changed files
with
325 additions
and
54 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 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 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.