aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/packages/AbstractAttributeMapper.java
diff options
context:
space:
mode:
authorGravatar Lukacs Berki <lberki@google.com>2016-01-13 09:11:31 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2016-01-13 13:17:12 +0000
commit17ed2ce60a8336cc695beeeb64ac8b38446f9744 (patch)
treea32c23e905b3233b3bdd3dcbf897ae32f88ca27d /src/main/java/com/google/devtools/build/lib/packages/AbstractAttributeMapper.java
parenteea8efaf39da92e4811ed7b551b2a978e34ff92e (diff)
Make repository-local labels in visibility declarations actually be repository-local.
Fixes #765. -- MOS_MIGRATED_REVID=112027627
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/packages/AbstractAttributeMapper.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/AbstractAttributeMapper.java23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/AbstractAttributeMapper.java b/src/main/java/com/google/devtools/build/lib/packages/AbstractAttributeMapper.java
index 2c1837a836..39c3183bed 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/AbstractAttributeMapper.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/AbstractAttributeMapper.java
@@ -15,12 +15,10 @@ package com.google.devtools.build.lib.packages;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.packages.BuildType.SelectorList;
import com.google.devtools.build.lib.syntax.Type;
-import com.google.devtools.build.lib.vfs.PathFragment;
import javax.annotation.Nullable;
@@ -32,19 +30,6 @@ import javax.annotation.Nullable;
* data before exposing it to consumers.
*/
public abstract class AbstractAttributeMapper implements AttributeMap {
-
- /**
- * Package names that aren't made relative to the current repository because they mean special
- * things to Bazel.
- */
- private static final ImmutableSet<PathFragment> ABSOLUTE_PACKAGE_NAMES = ImmutableSet.of(
- // dependencies that are a function of the configuration
- new PathFragment("tools/defaults"),
- // Visibility is labels aren't actually targets
- new PathFragment("visibility"),
- // There is only one //external package
- Label.EXTERNAL_PACKAGE_NAME);
-
private final Package pkg;
private final RuleClass ruleClass;
private final Label ruleLabel;
@@ -172,13 +157,7 @@ public abstract class AbstractAttributeMapper implements AttributeMap {
Object value = get(attribute.getName(), type);
if (value != null) { // null values are particularly possible for computed defaults.
for (Label label : extractLabels(type, value)) {
- Label absoluteLabel;
- if (label.getPackageIdentifier().getRepository().isDefault()
- && ABSOLUTE_PACKAGE_NAMES.contains(label.getPackageIdentifier().getPackageFragment())) {
- absoluteLabel = label;
- } else {
- absoluteLabel = ruleLabel.resolveRepositoryRelative(label);
- }
+ Label absoluteLabel = ruleLabel.resolveRepositoryRelative(label);
observer.acceptLabelAttribute(absoluteLabel, attribute);
}
}