diff options
author | 2015-11-13 02:19:52 +0000 | |
---|---|---|
committer | 2015-11-13 10:24:13 +0000 | |
commit | a97e17f4a5b6662b96ab4e14b804ac75d6f76ad4 (patch) | |
tree | d92acd480c6f02fc2b708a4672f2b59a6ff8d364 /src/main/java/com/google/devtools/build/lib/skyframe/AspectValue.java | |
parent | 1e66ccd2f18b03733f22b93ad8051ff2cf37d3dd (diff) |
Use Labels, rather than PathFragments, to represent Skylark loads internally. The load location for a Skylark Aspect is specified via a PathFragment, for consistency with current non-Aspect Skylark loads.
This should be a semantics-preserving change for users. In a subsequent CL, I'll change the Skylark syntax to allow load statements to use labels as well as paths, with the goal of eventually deprecating the latter.
Also:
- Removed the hack for handling relative loads in the prelude file.
- Refactored some redundant functionality in PackageFunction and SkylarkImportLookupFunction for handling loads.
- Removed the ability to put the BUILD file for the package containing a Skylark file under a different package root than the Skylark file itself. This functionality isn't currently used and is inconsistent with Blaze's handling of the package path elsewhere.
- Added BUILD files to a number of tests that load Skylark files; this is consistent with the requirement that all Skylark files need to be part of some package.
- Changed the constants used to set the location of the prelude file from paths to labels.
--
MOS_MIGRATED_REVID=107741568
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/AspectValue.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/AspectValue.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/AspectValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/AspectValue.java index 4d5e6c2c2b..c2d6f2d996 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/AspectValue.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/AspectValue.java @@ -19,13 +19,13 @@ import com.google.devtools.build.lib.actions.Action; import com.google.devtools.build.lib.analysis.ConfiguredAspect; import com.google.devtools.build.lib.analysis.config.BuildConfiguration; import com.google.devtools.build.lib.cmdline.Label; -import com.google.devtools.build.lib.cmdline.PackageIdentifier; import com.google.devtools.build.lib.collect.nestedset.NestedSet; import com.google.devtools.build.lib.events.Location; import com.google.devtools.build.lib.packages.Aspect; import com.google.devtools.build.lib.packages.AspectClass; import com.google.devtools.build.lib.packages.AspectParameters; import com.google.devtools.build.lib.packages.Package; +import com.google.devtools.build.lib.vfs.PathFragment; import com.google.devtools.build.skyframe.SkyFunctionName; import com.google.devtools.build.skyframe.SkyKey; @@ -86,6 +86,7 @@ public final class AspectValue extends ActionLookupValue { return aspect; } + @Override public String getDescription() { return String.format("%s of %s", aspect.getAspectClass().getName(), getLabel()); } @@ -134,13 +135,13 @@ public final class AspectValue extends ActionLookupValue { private final Label targetLabel; private final BuildConfiguration targetConfiguration; - private final PackageIdentifier extensionFile; + private final PathFragment extensionFile; private final String skylarkValueName; private SkylarkAspectLoadingKey( Label targetLabel, BuildConfiguration targetConfiguration, - PackageIdentifier extensionFile, + PathFragment extensionFile, String skylarkFunctionName) { this.targetLabel = targetLabel; this.targetConfiguration = targetConfiguration; @@ -154,7 +155,7 @@ public final class AspectValue extends ActionLookupValue { return SkyFunctions.LOAD_SKYLARK_ASPECT; } - public PackageIdentifier getExtensionFile() { + public PathFragment getExtensionFile() { return extensionFile; } @@ -170,6 +171,7 @@ public final class AspectValue extends ActionLookupValue { return targetConfiguration; } + @Override public String getDescription() { // Skylark aspects are referred to on command line with <file>%<value ame> return String.format("%s%%%s of %s", extensionFile.toString(), skylarkValueName, targetLabel); @@ -240,7 +242,7 @@ public final class AspectValue extends ActionLookupValue { public static SkylarkAspectLoadingKey createSkylarkAspectKey( Label targetLabel, BuildConfiguration targetConfiguration, - PackageIdentifier skylarkFile, + PathFragment skylarkFile, String skylarkExportName) { return new SkylarkAspectLoadingKey( targetLabel, targetConfiguration, skylarkFile, skylarkExportName); |