diff options
author | Greg Estren <gregce@google.com> | 2016-07-27 14:22:41 +0000 |
---|---|---|
committer | Adam Michael <ajmichael@google.com> | 2016-07-28 18:36:28 -0400 |
commit | 974bbd92080ec47ebeef8fb99c6178cbf3fe7e1e (patch) | |
tree | b81f4ed060dc932f1a88c7081fc29c3f8af66465 /src/main/java/com/google/devtools/build/lib/analysis/AnalysisEnvironment.java | |
parent | 040391a600603c4d4430603e89cd0ff8920228af (diff) |
Clean up DependencyResolver's interface for the dynamic config migration and for general readability.
Major changes:
- Remove the intermediate Attribute -> LabelAndConfiguration multimap (computed in resolveAttributes). Instead, feed discovered values directly into the final Attribute -> Dependency map via a new RuleResolver interface.
- Remove all references to LabelAndConfiguration. The configuration is always the owning rule's configuration except for two special cases: late-bound attributes with splits and late-bound attributes with LateBoundDefault.useHostConfiguration. The original interface made this very unclear and required a lot of awkward and sometimes incorrect logic. The new interface only involves configurations for the cases that actually need them.
- Remove an ugly hack caused by BuildConfiguration.evaluateTransition mixing poorly with LateBoundDefault.useHostConfiguration (https://github.com/bazelbuild/bazel/blo[]e172693c27f3efc95ed163e43a9f0a7a6fb4017/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java#L488).
- Remove a hack that applies split transitions twice because of BuildConfiguration.evaluateTransition mixing poorly with late-bound split attributes (https://github.com/bazelbuild/bazel/blo[]e172693c27f3efc95ed163e43a9f0a7a6fb4017/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java#L319). This happens to be innocent now but won't be when nested splits are possible.
- Solidifies the API contract for Attribute.LateBoundDefault.useHostConfiguration.
- Applies clearer naming and more consistent ordering to method parameters.
- Better documentation.
This is all also prep work for dynamic split transitions.
tl;dr: late-bound attributes are legitimately special. Treat them that way to make the rest of DependencyResolver cleaner and hack-free.
--
MOS_MIGRATED_REVID=128582618
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/AnalysisEnvironment.java')
0 files changed, 0 insertions, 0 deletions