diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java b/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java
index 14520a72b57d67..3d6640aaa74b2a 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java
@@ -80,7 +80,7 @@ public class CoreOptions extends FragmentOptions implements Cloneable {
@Option(
name = "incompatible_use_platforms_repo_for_constraints",
- defaultValue = "true",
+ defaultValue = "false",
documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS,
effectTags = {OptionEffectTag.AFFECTS_OUTPUTS},
metadataTags = {OptionMetadataTag.INCOMPATIBLE_CHANGE},
diff --git a/src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java b/src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java
index 526ace30f98afe..ed3f7f752857ac 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java
@@ -523,7 +523,7 @@ public final class BuildLanguageOptions extends OptionsBase {
@Option(
name = "incompatible_unambiguous_label_stringification",
- defaultValue = "false",
+ defaultValue = "true",
documentationCategory = OptionDocumentationCategory.STARLARK_SEMANTICS,
effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS},
metadataTags = {OptionMetadataTag.INCOMPATIBLE_CHANGE},
@@ -759,7 +759,7 @@ public StarlarkSemantics toStarlarkSemantics() {
public static final String INCOMPATIBLE_USE_CC_CONFIGURE_FROM_RULES_CC =
"-incompatible_use_cc_configure_from_rules";
public static final String INCOMPATIBLE_UNAMBIGUOUS_LABEL_STRINGIFICATION =
- "-incompatible_unambiguous_label_stringification";
+ "+incompatible_unambiguous_label_stringification";
public static final String INCOMPATIBLE_VISIBILITY_PRIVATE_ATTRIBUTES_AT_DEFINITION =
"-incompatible_visibility_private_attributes_at_definition";
public static final String INCOMPATIBLE_TOP_LEVEL_ASPECTS_REQUIRE_PROVIDERS =
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java b/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java
index a6f1bb5222cacd..6125f27c825c97 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java
@@ -184,7 +184,7 @@ public void testGetArtifactOwnerInStarlark() throws Exception {
scratch.file("foo/BUILD", "load(':rule.bzl', 'gen')", "gen(name = 'a')");
update("//foo:a");
- assertContainsEvent("DEBUG /workspace/foo/rule.bzl:3:8: f owner is //foo:a");
+ assertContainsEvent("DEBUG /workspace/foo/rule.bzl:3:8: f owner is @//foo:a");
}
@Test
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/StarlarkAttrTransitionProviderTest.java b/src/test/java/com/google/devtools/build/lib/analysis/StarlarkAttrTransitionProviderTest.java
index e8009d23c5789a..9760886423bcab 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/StarlarkAttrTransitionProviderTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/StarlarkAttrTransitionProviderTest.java
@@ -562,7 +562,7 @@ private void writeReadAndPassthroughOptionsTestFiles() throws Exception {
"settings_under_test = {",
" '//command_line_option:cpu': 'armeabi-v7a',",
" '//command_line_option:compilation_mode': 'dbg',",
- " '//command_line_option:crosstool_top': '//android/crosstool:everything',",
+ " '//command_line_option:crosstool_top': '@//android/crosstool:everything',",
" '//command_line_option:platform_suffix': 'my-platform-suffix',",
"}",
"def set_options_transition_func(settings, attr):",
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/test/TestActionBuilderTest.java b/src/test/java/com/google/devtools/build/lib/analysis/test/TestActionBuilderTest.java
index 97749029007f38..3ee2c8462964cc 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/test/TestActionBuilderTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/test/TestActionBuilderTest.java
@@ -219,7 +219,7 @@ public void testAspectOverNonExpandingTestSuitesVisitsImplicitTests() throws Exc
new StarlarkProvider.Key(Label.parseAbsoluteUnchecked("//:aspect.bzl"), "StructImpl");
StructImpl info = (StructImpl) aspectValue.get(key);
assertThat(((Depset) info.getValue("labels")).getSet(String.class).toList())
- .containsExactly("//:suite", "//:test_a", "//:test_b");
+ .containsExactly("@//:suite", "@//:test_a", "@//:test_b");
}
@Test
@@ -252,7 +252,7 @@ public void testAspectOverNonExpandingTestSuitesVisitsExplicitTests() throws Exc
new StarlarkProvider.Key(Label.parseAbsoluteUnchecked("//:aspect.bzl"), "StructImpl");
StructImpl info = (StructImpl) aspectValue.get(key);
assertThat(((Depset) info.getValue("labels")).getSet(String.class).toList())
- .containsExactly("//:suite", "//:test_b");
+ .containsExactly("@//:suite", "@//:test_b");
}
@Test
@@ -285,7 +285,7 @@ public void testAspectOverExpandingTestSuitesDoesNotVisitSuite() throws Exceptio
StructImpl info = (StructImpl) a.get(key);
labels.addAll(((Depset) info.getValue("labels")).getSet(String.class).toList());
}
- assertThat(labels).containsExactly("//:test_a", "//:test_b");
+ assertThat(labels).containsExactly("@//:test_a", "@//:test_b");
}
private void writeLabelCollectionAspect() throws IOException {
diff --git a/src/test/java/com/google/devtools/build/lib/buildtool/KeepGoingTest.java b/src/test/java/com/google/devtools/build/lib/buildtool/KeepGoingTest.java
index d4b83e7510b9df..41ef1e83e4f1bc 100644
--- a/src/test/java/com/google/devtools/build/lib/buildtool/KeepGoingTest.java
+++ b/src/test/java/com/google/devtools/build/lib/buildtool/KeepGoingTest.java
@@ -259,7 +259,7 @@ public void testConfigurationErrorsAreToleratedWithKeepGoing() throws Exception
assertBuildFailedExceptionFromBuilding(
"command succeeded, but not all targets were analyzed", "//a", "//b");
events.assertContainsError(
- "in srcs attribute of cc_library rule //a:a: source file '//a:missing.foo' is misplaced"
+ "in srcs attribute of cc_library rule @//a:a: source file '@//a:missing.foo' is misplaced"
+ " here");
events.assertContainsInfo("Analysis succeeded for only 1 of 2 top-level targets");
diff --git a/src/test/java/com/google/devtools/build/lib/cmdline/LabelTest.java b/src/test/java/com/google/devtools/build/lib/cmdline/LabelTest.java
index acfad8778cb544..2be9d9473e085b 100644
--- a/src/test/java/com/google/devtools/build/lib/cmdline/LabelTest.java
+++ b/src/test/java/com/google/devtools/build/lib/cmdline/LabelTest.java
@@ -515,7 +515,7 @@ public void testWorkspaceName() throws Exception {
@Test
public void starlarkStrAndRepr() throws Exception {
Label label = Label.parseCanonical("//x");
- assertThat(Starlark.str(label, StarlarkSemantics.DEFAULT)).isEqualTo("//x:x");
+ assertThat(Starlark.str(label, StarlarkSemantics.DEFAULT)).isEqualTo("@//x:x");
assertThat(Starlark.repr(label)).isEqualTo("Label(\"//x:x\")");
label = Label.parseCanonical("@hello//x");
@@ -524,12 +524,12 @@ public void starlarkStrAndRepr() throws Exception {
}
@Test
- public void starlarkStr_unambiguous() throws Exception {
+ public void starlarkStr_ambiguous() throws Exception {
StarlarkSemantics semantics =
StarlarkSemantics.builder()
- .setBool(BuildLanguageOptions.INCOMPATIBLE_UNAMBIGUOUS_LABEL_STRINGIFICATION, true)
+ .setBool(BuildLanguageOptions.INCOMPATIBLE_UNAMBIGUOUS_LABEL_STRINGIFICATION, false)
.build();
- assertThat(Starlark.str(Label.parseCanonical("//x"), semantics)).isEqualTo("@//x:x");
+ assertThat(Starlark.str(Label.parseCanonical("//x"), semantics)).isEqualTo("//x:x");
assertThat(Starlark.str(Label.parseCanonical("@x//y"), semantics)).isEqualTo("@x//y:y");
}
@@ -537,18 +537,18 @@ public void starlarkStr_unambiguous() throws Exception {
public void starlarkStr_canonicalLabelLiteral() throws Exception {
StarlarkSemantics semantics =
StarlarkSemantics.builder().setBool(BuildLanguageOptions.ENABLE_BZLMOD, true).build();
- assertThat(Starlark.str(Label.parseCanonical("//x"), semantics)).isEqualTo("//x:x");
+ assertThat(Starlark.str(Label.parseCanonical("//x"), semantics)).isEqualTo("@@//x:x");
assertThat(Starlark.str(Label.parseCanonical("@x//y"), semantics)).isEqualTo("@@x//y:y");
}
@Test
- public void starlarkStr_unambiguousAndCanonicalLabelLiteral() throws Exception {
+ public void starlarkStr_ambiguousAndCanonicalLabelLiteral() throws Exception {
StarlarkSemantics semantics =
StarlarkSemantics.builder()
- .setBool(BuildLanguageOptions.INCOMPATIBLE_UNAMBIGUOUS_LABEL_STRINGIFICATION, true)
+ .setBool(BuildLanguageOptions.INCOMPATIBLE_UNAMBIGUOUS_LABEL_STRINGIFICATION, false)
.setBool(BuildLanguageOptions.ENABLE_BZLMOD, true)
.build();
- assertThat(Starlark.str(Label.parseCanonical("//x"), semantics)).isEqualTo("@@//x:x");
+ assertThat(Starlark.str(Label.parseCanonical("//x"), semantics)).isEqualTo("//x:x");
assertThat(Starlark.str(Label.parseCanonical("@x//y"), semantics)).isEqualTo("@@x//y:y");
}
}
diff --git a/src/test/java/com/google/devtools/build/lib/rules/android/AbstractAndroidLocalTestTestBase.java b/src/test/java/com/google/devtools/build/lib/rules/android/AbstractAndroidLocalTestTestBase.java
index e2d7c34d91d3ec..8578ca0c2a987b 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/android/AbstractAndroidLocalTestTestBase.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/android/AbstractAndroidLocalTestTestBase.java
@@ -318,7 +318,9 @@ public void testFeatureFlagsAttributeSetsFeatureFlagProviderValues() throws Exce
"/FooFlags.java");
FileWriteAction action = (FileWriteAction) getGeneratingAction(flagList);
assertThat(action.getFileContents())
- .isEqualTo("//java/com/foo:flag1: on\n//java/com/foo:flag2: off");
+ .isAnyOf(
+ "//java/com/foo:flag1: on\n//java/com/foo:flag2: off",
+ "@//java/com/foo:flag1: on\n@//java/com/foo:flag2: off");
}
@Test
diff --git a/src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java b/src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java
index 58b1b2ea2aa7e0..71c5e1d8ed3f01 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java
@@ -3777,7 +3777,7 @@ public void testFeatureFlagsAttributeSetsFeatureFlagProviderValues() throws Exce
"/FooFlags.java");
FileWriteAction action = (FileWriteAction) getGeneratingAction(flagList);
assertThat(action.getFileContents())
- .isEqualTo("//java/com/foo:flag1: on\n//java/com/foo:flag2: off");
+ .isEqualTo("@//java/com/foo:flag1: on\n@//java/com/foo:flag2: off");
}
@Test
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcBadDependenciesTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcBadDependenciesTest.java
index 6adbd7654d1a76..a71998a731899e 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcBadDependenciesTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcBadDependenciesTest.java
@@ -30,12 +30,11 @@ private ConfiguredTarget configure(String targetLabel) throws Exception {
@Test
public void testRejectsSingleUnknownSourceFile() throws Exception {
reporter.removeHandler(failFastHandler);
- scratch.file("foo/BUILD",
- "cc_library(name = 'foo', srcs = ['unknown.oops'])");
+ scratch.file("foo/BUILD", "cc_library(name = 'foo', srcs = ['unknown.oops'])");
scratch.file("foo/unknown.oops", "foo");
configure("//foo:foo");
- assertContainsEvent(getErrorMsgMisplacedFiles(
- "srcs", "cc_library", "//foo:foo", "//foo:unknown.oops"));
+ assertContainsEvent(
+ getErrorMsgMisplacedFiles("srcs", "cc_library", "@//foo:foo", "@//foo:unknown.oops"));
}
@Test
@@ -65,6 +64,6 @@ public void testRejectsBadGeneratedFile() throws Exception {
assertContainsEvent(
String.format(
"attribute srcs: '%s' does not produce any cc_library srcs files",
- "//dependency:generated"));
+ "@//dependency:generated"));
}
}
diff --git a/src/test/java/com/google/devtools/build/lib/rules/proto/BazelProtoCommonTest.java b/src/test/java/com/google/devtools/build/lib/rules/proto/BazelProtoCommonTest.java
index 6caaee58a68a15..386959289bb4ea 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/proto/BazelProtoCommonTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/proto/BazelProtoCommonTest.java
@@ -580,11 +580,11 @@ public void shouldGenerateCode_mixed() throws Exception {
getConfiguredTarget("//bar:simple");
assertContainsEvent(
- "The 'srcs' attribute of '//third_party/x:mixed' contains protos for which 'MyRule'"
+ "The 'srcs' attribute of '@//third_party/x:mixed' contains protos for which 'MyRule'"
+ " shouldn't generate code (third_party/x/metadata.proto,"
+ " third_party/x/descriptor.proto), in addition to protos for which it should"
+ " (third_party/x/something.proto).\n"
- + "Separate '//third_party/x:mixed' into 2 proto_library rules.");
+ + "Separate '@//third_party/x:mixed' into 2 proto_library rules.");
}
/** Verifies proto_common.declare_generated_files
call. */
diff --git a/src/test/java/com/google/devtools/build/lib/rules/python/PythonSrcsVersionAspectTest.java b/src/test/java/com/google/devtools/build/lib/rules/python/PythonSrcsVersionAspectTest.java
index 3ae0f09dbf8604..94313f73d99e2d 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/python/PythonSrcsVersionAspectTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/python/PythonSrcsVersionAspectTest.java
@@ -78,10 +78,10 @@ public void simpleCase() throws Exception {
"",
"",
"Python 3-only deps:",
- "//pkg:lib",
+ "@//pkg:lib",
"",
"Paths to these deps:",
- "//pkg:bin -> //pkg:lib",
+ "@//pkg:bin -> @//pkg:lib",
"");
assertThat(result).isEqualTo(golden);
}
@@ -138,14 +138,14 @@ public void twoContradictoryRequirements() throws Exception {
String golden =
join(
"Python 2-only deps:",
- "//pkg:lib2",
+ "@//pkg:lib2",
"",
"Python 3-only deps:",
- "//pkg:lib3",
+ "@//pkg:lib3",
"",
"Paths to these deps:",
- "//pkg:bin -> //pkg:lib2",
- "//pkg:bin -> //pkg:lib3",
+ "@//pkg:bin -> @//pkg:lib2",
+ "@//pkg:bin -> @//pkg:lib3",
"");
assertThat(result).isEqualTo(golden);
}
@@ -168,10 +168,10 @@ public void toplevelSelfContradictory() throws Exception {
"",
"",
"Python 3-only deps:",
- "//pkg:bin",
+ "@//pkg:bin",
"",
"Paths to these deps:",
- "//pkg:bin",
+ "@//pkg:bin",
"");
assertThat(result).isEqualTo(golden);
}
@@ -209,10 +209,10 @@ public void indirectDependencies() throws Exception {
"",
"",
"Python 3-only deps:",
- "//pkg:libB",
+ "@//pkg:libB",
"",
"Paths to these deps:",
- "//pkg:bin -> //pkg:libC -> //pkg:libB",
+ "@//pkg:bin -> @//pkg:libC -> @//pkg:libB",
"");
assertThat(result).isEqualTo(golden);
}
@@ -251,10 +251,10 @@ public void onlyReportTopmost() throws Exception {
"",
"",
"Python 3-only deps:",
- "//pkg:libC",
+ "@//pkg:libC",
"",
"Paths to these deps:",
- "//pkg:bin -> //pkg:libC",
+ "@//pkg:bin -> @//pkg:libC",
"");
assertThat(result).isEqualTo(golden);
}
@@ -294,12 +294,12 @@ public void oneTopmostReachesAnother() throws Exception {
"",
"",
"Python 3-only deps:",
- "//pkg:libA",
- "//pkg:libC",
+ "@//pkg:libA",
+ "@//pkg:libC",
"",
"Paths to these deps:",
- "//pkg:bin -> //pkg:libA",
- "//pkg:bin -> //pkg:libC",
+ "@//pkg:bin -> @//pkg:libA",
+ "@//pkg:bin -> @//pkg:libC",
"");
assertThat(result).isEqualTo(golden);
}
@@ -338,10 +338,10 @@ public void multiplePathsToRequirement() throws Exception {
"",
"",
"Python 3-only deps:",
- "//pkg:libA",
+ "@//pkg:libA",
"",
"Paths to these deps:",
- "//pkg:bin -> //pkg:libB -> //pkg:libA",
+ "@//pkg:bin -> @//pkg:libB -> @//pkg:libA",
"");
assertThat(result).isEqualTo(golden);
}
@@ -391,10 +391,10 @@ public void noSrcsVersionButIntroducesRequirement() throws Exception {
"",
"",
"Python 3-only deps:",
- "//pkg:libB",
+ "@//pkg:libB",
"",
"Paths to these deps:",
- "//pkg:bin -> //pkg:libC -> //pkg:libB",
+ "@//pkg:bin -> @//pkg:libC -> @//pkg:libB",
"");
assertThat(result).isEqualTo(golden);
}
diff --git a/src/test/java/com/google/devtools/build/lib/starlark/StarlarkDefinedAspectsTest.java b/src/test/java/com/google/devtools/build/lib/starlark/StarlarkDefinedAspectsTest.java
index 1bb42f83cba786..4ac097b651ed90 100644
--- a/src/test/java/com/google/devtools/build/lib/starlark/StarlarkDefinedAspectsTest.java
+++ b/src/test/java/com/google/devtools/build/lib/starlark/StarlarkDefinedAspectsTest.java
@@ -1720,13 +1720,13 @@ public void invalidateAspectOnBzlFileChange() throws Exception {
"repro_no_aspect(name = 'r0')",
"repro_no_aspect(name = 'r1', deps = [':r0'])",
"repro(name = 'r2', deps = [':r1'])");
- buildTargetAndCheckRuleInfo("//test:r0", "//test:r1");
+ buildTargetAndCheckRuleInfo("@//test:r0", "@//test:r1");
// Make aspect propagation list empty.
scratch.overwriteFile("test/build_defs.bzl", aspectBzlFile(""));
// The aspect should not propagate to //test:r0 anymore.
- buildTargetAndCheckRuleInfo("//test:r1");
+ buildTargetAndCheckRuleInfo("@//test:r1");
}
private void buildTargetAndCheckRuleInfo(String... expectedLabels) throws Exception {
@@ -2036,8 +2036,8 @@ public void aspectOnAspectLinear() throws Exception {
// "yes" means that aspect a2 sees a1's providers.
assertThat(result)
.containsExactly(
- "//test:r0[\"//test:aspect.bzl%a1\", \"//test:aspect.bzl%a2\"]=yes",
- "//test:r1[\"//test:aspect.bzl%a2\"]=no");
+ "@//test:r0[\"//test:aspect.bzl%a1\", \"//test:aspect.bzl%a2\"]=yes",
+ "@//test:r1[\"//test:aspect.bzl%a2\"]=no");
}
/**
@@ -2098,10 +2098,10 @@ public void aspectOnAspectDiamond() throws Exception {
Sequence> result = (Sequence>) target.get("result");
assertThat(result)
.containsExactly(
- "//test:r0[\"//test:aspect.bzl%a1\", \"//test:aspect.bzl%a3\"]=a1p",
- "//test:r1[\"//test:aspect.bzl%a3\"]=",
- "//test:r0[\"//test:aspect.bzl%a2\", \"//test:aspect.bzl%a3\"]=a2p",
- "//test:r2[\"//test:aspect.bzl%a3\"]=");
+ "@//test:r0[\"//test:aspect.bzl%a1\", \"//test:aspect.bzl%a3\"]=a1p",
+ "@//test:r1[\"//test:aspect.bzl%a3\"]=",
+ "@//test:r0[\"//test:aspect.bzl%a2\", \"//test:aspect.bzl%a3\"]=a2p",
+ "@//test:r2[\"//test:aspect.bzl%a3\"]=");
}
/**
@@ -2149,8 +2149,8 @@ public void aspectOnAspectLinearDuplicates() throws Exception {
// "yes" means that aspect a2 sees a1's providers.
assertThat(result)
.containsExactly(
- "//test:r0[\"//test:aspect.bzl%a2\"]=no",
- "//test:r1[\"//test:aspect.bzl%a2\"]=no", "//test:r2_1[\"//test:aspect.bzl%a2\"]=no");
+ "@//test:r0[\"//test:aspect.bzl%a2\"]=no",
+ "@//test:r1[\"//test:aspect.bzl%a2\"]=no", "@//test:r2_1[\"//test:aspect.bzl%a2\"]=no");
}
/** Linear aspects-on-aspects with alias rule. */
@@ -2193,8 +2193,8 @@ public void aspectOnAspectLinearAlias() throws Exception {
// "yes" means that aspect a2 sees a1's providers.
assertThat(result)
.containsExactly(
- "//test:r0[\"//test:aspect.bzl%a1\", \"//test:aspect.bzl%a2\"]=yes",
- "//test:r1[\"//test:aspect.bzl%a2\"]=no");
+ "@//test:r0[\"//test:aspect.bzl%a1\", \"//test:aspect.bzl%a2\"]=yes",
+ "@//test:r1[\"//test:aspect.bzl%a2\"]=no");
}
@Test
@@ -2231,8 +2231,8 @@ public void aspectDescriptions() throws Exception {
assertThat(result)
.containsExactly(
- "//test:r0[\"//test:aspect.bzl%a\"]=None",
- "//test:r1[\"//test:aspect.bzl%a\"]=//test:r0[\"//test:aspect.bzl%a\"],True");
+ "@//test:r0[\"//test:aspect.bzl%a\"]=None",
+ "@//test:r1[\"//test:aspect.bzl%a\"]=@//test:r0[\"//test:aspect.bzl%a\"],True");
}
@Test
@@ -2431,11 +2431,11 @@ public void aspectOnAspectOnAspect() throws Exception {
StructImpl p3Provider = (StructImpl) configuredAspect.get(p3);
assertThat((Sequence>) p3Provider.getValue("value"))
.containsExactly(
- "//test:r0_1=True",
- "//test:r0_2=True",
- "//test:r0_3=True",
- "//test:r1_1=False",
- "//test:r2_1=False");
+ "@//test:r0_1=True",
+ "@//test:r0_2=True",
+ "@//test:r0_3=True",
+ "@//test:r1_1=False",
+ "@//test:r2_1=False");
}
/**
@@ -2493,7 +2493,7 @@ public void multipleDepsDifferentAspects() throws Exception {
new StarlarkProvider.Key(Label.parseCanonical("//test:aspect.bzl"), "PCollector");
StructImpl pCollectorProvider = (StructImpl) configuredTarget.get(pCollector);
assertThat((Sequence>) pCollectorProvider.getValue("result"))
- .containsExactly("//test:r1", "//test:r0", "//test:r0+PAspect");
+ .containsExactly("@//test:r1", "@//test:r0", "@//test:r0+PAspect");
}
@Test
@@ -2763,7 +2763,7 @@ public void testRuleAndAspectAttrConflict() throws Exception {
StarlarkProvider.Key myInfoKey =
new StarlarkProvider.Key(Label.parseCanonical("//test:aspect.bzl"), "MyInfo");
StructImpl myInfo = (StructImpl) configuredAspect.get(myInfoKey);
- assertThat(myInfo.getValue("hidden_attr_label")).isEqualTo("//test:zzz");
+ assertThat(myInfo.getValue("hidden_attr_label")).isEqualTo("@//test:zzz");
}
/** Simple straightforward linear aspects-on-aspects. */
@@ -2806,7 +2806,7 @@ public void aspectOnAspectAttrConflict() throws Exception {
ConfiguredTarget target = Iterables.getOnlyElement(analysisResult.getTargetsToBuild());
String result = (String) target.get("result");
- assertThat(result).isEqualTo("//test:zzz");
+ assertThat(result).isEqualTo("@//test:zzz");
}
@Test
@@ -3232,10 +3232,10 @@ public void testAspectRequiredProviders_defaultNoRequiredProviders() throws Exce
// my_aspect does not require any providers so it will be applied to all the dependencies of
// main target
List expected = new ArrayList<>();
- expected.add("//test:defs.bzl%my_aspect(//test:target_without_providers)");
- expected.add("//test:defs.bzl%my_aspect(//test:target_with_providers)");
- expected.add("//test:defs.bzl%my_aspect(//test:target_with_providers_not_advertised)");
- expected.add("//test:defs.bzl%my_aspect(//test:target_with_providers_indeps)");
+ expected.add("//test:defs.bzl%my_aspect(@//test:target_without_providers)");
+ expected.add("//test:defs.bzl%my_aspect(@//test:target_with_providers)");
+ expected.add("//test:defs.bzl%my_aspect(@//test:target_with_providers_not_advertised)");
+ expected.add("//test:defs.bzl%my_aspect(@//test:target_with_providers_indeps)");
assertThat(getLabelsToBuild(analysisResult)).containsExactly("//test:main");
ConfiguredTarget target = analysisResult.getTargetsToBuild().iterator().next();
Object ruleDepsUnchecked = target.get("rule_deps");
@@ -3345,8 +3345,8 @@ public void testAspectRequiredProviders_flatSetOfRequiredProviders() throws Exce
// However, my_aspect cannot be propagated to target_with_ab_indeps_not_reached because it was
// not applied to its parent (target_with_a)
List expected = new ArrayList<>();
- expected.add("//test:defs.bzl%my_aspect(//test:target_with_ab)");
- expected.add("//test:defs.bzl%my_aspect(//test:target_with_ab_indeps_reached)");
+ expected.add("//test:defs.bzl%my_aspect(@//test:target_with_ab)");
+ expected.add("//test:defs.bzl%my_aspect(@//test:target_with_ab_indeps_reached)");
assertThat(getLabelsToBuild(analysisResult)).containsExactly("//test:main");
ConfiguredTarget target = analysisResult.getTargetsToBuild().iterator().next();
Object ruleDepsUnchecked = target.get("rule_deps");
@@ -3472,9 +3472,9 @@ public void testAspectRequiredProviders_listOfRequiredProvidersLists() throws Ex
// However, my_aspect cannot be propagated to target_with_c_indeps_not_reached because it was
// not applied to its parent (target_with_a)
List expected = new ArrayList<>();
- expected.add("//test:defs.bzl%my_aspect(//test:target_with_ab)");
- expected.add("//test:defs.bzl%my_aspect(//test:target_with_c)");
- expected.add("//test:defs.bzl%my_aspect(//test:target_with_c_indeps_reached)");
+ expected.add("//test:defs.bzl%my_aspect(@//test:target_with_ab)");
+ expected.add("//test:defs.bzl%my_aspect(@//test:target_with_c)");
+ expected.add("//test:defs.bzl%my_aspect(@//test:target_with_c_indeps_reached)");
assertThat(getLabelsToBuild(analysisResult)).containsExactly("//test:main");
ConfiguredTarget target = analysisResult.getTargetsToBuild().iterator().next();
Object ruleDepsUnchecked = target.get("rule_deps");
@@ -3564,10 +3564,10 @@ public void testAspectRequiredByMultipleAspects_inheritsAttrAspects() throws Exc
StructImpl aResultProvider = (StructImpl) aspectA.get(aResult);
assertThat((Sequence>) aResultProvider.getValue("val"))
.containsExactly(
- "aspect_c runs on target //test:dep_target_a",
- "aspect_a runs on target //test:dep_target_a",
- "aspect_c runs on target //test:main_target",
- "aspect_a runs on target //test:main_target");
+ "aspect_c runs on target @//test:dep_target_a",
+ "aspect_a runs on target @//test:dep_target_a",
+ "aspect_c runs on target @//test:main_target",
+ "aspect_a runs on target @//test:main_target");
// aspect_b should run on main_target and dep_target_b and can retrieve aspect_c provider value
// on both of them
@@ -3578,10 +3578,10 @@ public void testAspectRequiredByMultipleAspects_inheritsAttrAspects() throws Exc
StructImpl bResultProvider = (StructImpl) aspectB.get(bResult);
assertThat((Sequence>) bResultProvider.getValue("val"))
.containsExactly(
- "aspect_c runs on target //test:dep_target_b",
- "aspect_b runs on target //test:dep_target_b",
- "aspect_c runs on target //test:main_target",
- "aspect_b runs on target //test:main_target");
+ "aspect_c runs on target @//test:dep_target_b",
+ "aspect_b runs on target @//test:dep_target_b",
+ "aspect_c runs on target @//test:main_target",
+ "aspect_b runs on target @//test:main_target");
}
@Test
@@ -3714,10 +3714,10 @@ public void testAspectRequiredByMultipleAspects_inheritsRequiredProviders() thro
StructImpl aResultProvider = (StructImpl) aspectA.get(aResult);
assertThat((Sequence>) aResultProvider.getValue("val"))
.containsExactly(
- "aspect_c runs on target //test:dep_target_with_prov_c",
- "aspect_a runs on target //test:dep_target_with_prov_c",
- "aspect_a runs on target //test:dep_target_with_prov_a",
- "aspect_a runs on target //test:main_target");
+ "aspect_c runs on target @//test:dep_target_with_prov_c",
+ "aspect_a runs on target @//test:dep_target_with_prov_c",
+ "aspect_a runs on target @//test:dep_target_with_prov_a",
+ "aspect_a runs on target @//test:main_target");
// aspect_b runs on main_target, dep_target_with_prov_b and dep_target_with_prov_c and it can
// only retrieve aspect_c provider value on dep_target_with_prov_c
@@ -3728,10 +3728,10 @@ public void testAspectRequiredByMultipleAspects_inheritsRequiredProviders() thro
StructImpl bResultProvider = (StructImpl) aspectB.get(bResult);
assertThat((Sequence>) bResultProvider.getValue("val"))
.containsExactly(
- "aspect_c runs on target //test:dep_target_with_prov_c",
- "aspect_b runs on target //test:dep_target_with_prov_c",
- "aspect_b runs on target //test:dep_target_with_prov_b",
- "aspect_b runs on target //test:main_target");
+ "aspect_c runs on target @//test:dep_target_with_prov_c",
+ "aspect_b runs on target @//test:dep_target_with_prov_c",
+ "aspect_b runs on target @//test:dep_target_with_prov_b",
+ "aspect_b runs on target @//test:main_target");
}
@Test
@@ -3845,10 +3845,10 @@ public void testAspectRequiredByMultipleAspects_withDifferentParametersValues()
StructImpl provA = (StructImpl) target1.get(provAkey);
assertThat((Sequence>) provA.getValue("val"))
.containsExactly(
- "aspect_c runs on target //test:dep_1 and param = rule_1_val",
- "aspect_a runs on target //test:dep_1",
- "aspect_c runs on target //test:dep_3 and param = rule_1_val",
- "aspect_a runs on target //test:dep_3");
+ "aspect_c runs on target @//test:dep_1 and param = rule_1_val",
+ "aspect_a runs on target @//test:dep_1",
+ "aspect_c runs on target @//test:dep_3 and param = rule_1_val",
+ "aspect_a runs on target @//test:dep_3");
// aspect_b runs on dep_2 and dep_3 and it can retrieve aspect_c provider value on them.
// aspect_c here should get its parameter value from rule_2
@@ -3858,10 +3858,10 @@ public void testAspectRequiredByMultipleAspects_withDifferentParametersValues()
StructImpl provB = (StructImpl) target2.get(provBkey);
assertThat((Sequence>) provB.getValue("val"))
.containsExactly(
- "aspect_c runs on target //test:dep_2 and param = rule_2_val",
- "aspect_b runs on target //test:dep_2",
- "aspect_c runs on target //test:dep_3 and param = rule_2_val",
- "aspect_b runs on target //test:dep_3");
+ "aspect_c runs on target @//test:dep_2 and param = rule_2_val",
+ "aspect_b runs on target @//test:dep_2",
+ "aspect_c runs on target @//test:dep_3 and param = rule_2_val",
+ "aspect_b runs on target @//test:dep_3");
}
@Test
@@ -3916,9 +3916,9 @@ public void testAspectRequiresAspect_requireNativeAspect() throws Exception {
StructImpl aResultProvider = (StructImpl) aspectA.get(aResult);
assertThat((Sequence>) aResultProvider.getValue("val"))
.containsExactly(
- "aspect_a on target //test:main_target cannot see native aspect provider",
- "aspect_a on target //test:dep_1 cannot see native aspect provider",
- "aspect_a on target //test:dep_2 can see native aspect provider");
+ "aspect_a on target @//test:main_target cannot see native aspect provider",
+ "aspect_a on target @//test:dep_1 cannot see native aspect provider",
+ "aspect_a on target @//test:dep_2 can see native aspect provider");
}
@Test
@@ -3992,17 +3992,17 @@ public void testAspectRequiresAspect_aspectsParameters() throws Exception {
new StarlarkProvider.Key(Label.parseCanonical("//test:defs.bzl"), "RequiredAspectProv");
StructImpl requiredAspectProvider = (StructImpl) configuredTarget.get(requiredAspectProv);
assertThat(requiredAspectProvider.getValue("p1_val"))
- .isEqualTo("In required_aspect, p1 = p1_v1 on target //test:dep_target");
+ .isEqualTo("In required_aspect, p1 = p1_v1 on target @//test:dep_target");
assertThat(requiredAspectProvider.getValue("p2_val"))
- .isEqualTo("In required_aspect, p2 not found on target //test:dep_target");
+ .isEqualTo("In required_aspect, p2 not found on target @//test:dep_target");
StarlarkProvider.Key baseAspectProv =
new StarlarkProvider.Key(Label.parseCanonical("//test:defs.bzl"), "BaseAspectProv");
StructImpl baseAspectProvider = (StructImpl) configuredTarget.get(baseAspectProv);
assertThat(baseAspectProvider.getValue("p1_val"))
- .isEqualTo("In base_aspect, p1 not found on target //test:dep_target");
+ .isEqualTo("In base_aspect, p1 not found on target @//test:dep_target");
assertThat(baseAspectProvider.getValue("p2_val"))
- .isEqualTo("In base_aspect, p2 = p2_v1 on target //test:dep_target");
+ .isEqualTo("In base_aspect, p2 = p2_v1 on target @//test:dep_target");
}
@Test
@@ -4067,13 +4067,13 @@ public void testAspectRequiresAspect_ruleAttributes() throws Exception {
new StarlarkProvider.Key(Label.parseCanonical("//test:defs.bzl"), "RequiredAspectProv");
StructImpl requiredAspectProvider = (StructImpl) configuredTarget.get(requiredAspectProv);
assertThat(requiredAspectProvider.getValue("p_val"))
- .isEqualTo("In required_aspect, p = p_v2 on target //test:dep_target");
+ .isEqualTo("In required_aspect, p = p_v2 on target @//test:dep_target");
StarlarkProvider.Key baseAspectProv =
new StarlarkProvider.Key(Label.parseCanonical("//test:defs.bzl"), "BaseAspectProv");
StructImpl baseAspectProvider = (StructImpl) configuredTarget.get(baseAspectProv);
assertThat(baseAspectProvider.getValue("p_val"))
- .isEqualTo("In base_aspect, p = p_v2 on target //test:dep_target");
+ .isEqualTo("In base_aspect, p = p_v2 on target @//test:dep_target");
}
@Test
@@ -4179,15 +4179,15 @@ public void testAspectRequiresAspect_inheritPropagationAttributes() throws Excep
StructImpl baseAspectProvider = (StructImpl) configuredTarget.get(baseAspectProv);
assertThat((Sequence>) baseAspectProvider.getValue("result"))
.containsExactly(
- "second_required_aspect run on target //test:second_dep_target",
- "second_required_aspect run on target //test:dep_target",
- "second_required_aspect run on target //test:first_dep_target",
- "first_required_aspect run on target //test:first_dep_target",
- "first_required_aspect run on target //test:dep_target",
- "second_required_aspect run on target //test:base_dep_target",
- "first_required_aspect run on target //test:base_dep_target",
- "base_aspect run on target //test:base_dep_target",
- "base_aspect run on target //test:dep_target");
+ "second_required_aspect run on target @//test:second_dep_target",
+ "second_required_aspect run on target @//test:dep_target",
+ "second_required_aspect run on target @//test:first_dep_target",
+ "first_required_aspect run on target @//test:first_dep_target",
+ "first_required_aspect run on target @//test:dep_target",
+ "second_required_aspect run on target @//test:base_dep_target",
+ "first_required_aspect run on target @//test:base_dep_target",
+ "base_aspect run on target @//test:base_dep_target",
+ "base_aspect run on target @//test:dep_target");
}
@Test
@@ -4306,9 +4306,9 @@ public void testAspectRequiresAspect_inheritRequiredProviders() throws Exception
StructImpl collectorProvider = (StructImpl) configuredTarget.get(collectorProv);
assertThat((Sequence>) collectorProvider.getValue("result"))
.containsExactly(
- "aspect_c run on target //test:target_with_prov_c and value of Prov_C = val_c",
- "aspect_b run on target //test:target_with_prov_b and value of Prov_B = val_b",
- "aspect_a run on target //test:target_with_prov_a and value of Prov_A = val_a")
+ "aspect_c run on target @//test:target_with_prov_c and value of Prov_C = val_c",
+ "aspect_b run on target @//test:target_with_prov_b and value of Prov_B = val_b",
+ "aspect_a run on target @//test:target_with_prov_a and value of Prov_A = val_a")
.inOrder();
}
@@ -4518,10 +4518,10 @@ public void testAspectRequiresAspect_withRequiredAspectProvidersSatisfied() thro
Iterables.getOnlyElement(analysisResult.getTargetsToBuild());
String aspectAResult = (String) configuredTarget.get("aspect_a_result");
assertThat(aspectAResult)
- .isEqualTo("aspect_a on target //test:dep_target found prov_a = a1 and found prov_b = b1");
+ .isEqualTo("aspect_a on target @//test:dep_target found prov_a = a1 and found prov_b = b1");
String aspectBResult = (String) configuredTarget.get("aspect_b_result");
- assertThat(aspectBResult).isEqualTo("aspect_b on target //test:dep_target found prov_b = b1");
+ assertThat(aspectBResult).isEqualTo("aspect_b on target @//test:dep_target found prov_b = b1");
}
@Test
@@ -4597,10 +4597,10 @@ public void testAspectRequiresAspect_withRequiredAspectProvidersNotFound() throw
ConfiguredTarget configuredTarget =
Iterables.getOnlyElement(analysisResult.getTargetsToBuild());
String aspectAResult = (String) configuredTarget.get("aspect_a_result");
- assertThat(aspectAResult).isEqualTo("aspect_a on target //test:dep_target found prov_a = a1");
+ assertThat(aspectAResult).isEqualTo("aspect_a on target @//test:dep_target found prov_a = a1");
String aspectBResult = (String) configuredTarget.get("aspect_b_result");
- assertThat(aspectBResult).isEqualTo("aspect_b on target //test:dep_target cannot find prov_b");
+ assertThat(aspectBResult).isEqualTo("aspect_b on target @//test:dep_target cannot find prov_b");
}
/**
@@ -4717,8 +4717,8 @@ public void testTopLevelAspectOnAspect_stackOfAspects() throws Exception {
StructImpl a3ResultProvider = (StructImpl) a3.get(a3Result);
assertThat((Sequence>) a3ResultProvider.getValue("value"))
.containsExactly(
- "aspect a3 on target //test:dep_target cannot see a1p and cannot see a2p",
- "aspect a3 on target //test:main cannot see a1p and cannot see a2p");
+ "aspect a3 on target @//test:dep_target cannot see a1p and cannot see a2p",
+ "aspect a3 on target @//test:main cannot see a1p and cannot see a2p");
ConfiguredAspect a2 = getConfiguredAspect(configuredAspects, "a2");
assertThat(a2).isNotNull();
@@ -4727,8 +4727,8 @@ public void testTopLevelAspectOnAspect_stackOfAspects() throws Exception {
StructImpl a2ResultProvider = (StructImpl) a2.get(a2Result);
assertThat((Sequence>) a2ResultProvider.getValue("value"))
.containsExactly(
- "aspect a2 on target //test:dep_target cannot see a1p and sees a2p = a2p_val",
- "aspect a2 on target //test:main cannot see a1p and sees a2p = a2p_val");
+ "aspect a2 on target @//test:dep_target cannot see a1p and sees a2p = a2p_val",
+ "aspect a2 on target @//test:main cannot see a1p and sees a2p = a2p_val");
ConfiguredAspect a1 = getConfiguredAspect(configuredAspects, "a1");
assertThat(a1).isNotNull();
@@ -4737,8 +4737,8 @@ public void testTopLevelAspectOnAspect_stackOfAspects() throws Exception {
StructImpl a1ResultProvider = (StructImpl) a1.get(a1Result);
assertThat((Sequence>) a1ResultProvider.getValue("value"))
.containsExactly(
- "aspect a1 on target //test:dep_target sees a1p = a1p_val and cannot see a2p",
- "aspect a1 on target //test:main sees a1p = a1p_val and cannot see a2p");
+ "aspect a1 on target @//test:dep_target sees a1p = a1p_val and cannot see a2p",
+ "aspect a1 on target @//test:main sees a1p = a1p_val and cannot see a2p");
}
/**
@@ -4902,8 +4902,8 @@ public void testTopLevelAspectOnAspect_requiredProviderProvidedTwicePassed() thr
StructImpl a1ResultProvider = (StructImpl) a1.get(a1Result);
assertThat((Sequence>) a1ResultProvider.getValue("value"))
.containsExactly(
- "aspect a1 on target //test:dep_target sees a1p = a1p_a3_val",
- "aspect a1 on target //test:main sees a1p = a1p_a3_val");
+ "aspect a1 on target @//test:dep_target sees a1p = a1p_a3_val",
+ "aspect a1 on target @//test:main sees a1p = a1p_a3_val");
}
@Test
@@ -4970,8 +4970,8 @@ public void testTopLevelAspectOnAspect_requiredProviderNotProvided() throws Exce
StructImpl a1ResultProvider = (StructImpl) a1.get(a1Result);
assertThat((Sequence>) a1ResultProvider.getValue("value"))
.containsExactly(
- "aspect a1 on target //test:dep_target cannot see a1p",
- "aspect a1 on target //test:main cannot see a1p");
+ "aspect a1 on target @//test:dep_target cannot see a1p",
+ "aspect a1 on target @//test:main cannot see a1p");
}
/**
@@ -5041,8 +5041,8 @@ public void testTopLevelAspectOnAspect_requiredProviderProvidedAfterTheAspect()
StructImpl a1ResultProvider = (StructImpl) a1.get(a1Result);
assertThat((Sequence>) a1ResultProvider.getValue("value"))
.containsExactly(
- "aspect a1 on target //test:dep_target cannot see a1p",
- "aspect a1 on target //test:main cannot see a1p");
+ "aspect a1 on target @//test:dep_target cannot see a1p",
+ "aspect a1 on target @//test:main cannot see a1p");
}
/**
@@ -5118,9 +5118,9 @@ public void testTopLevelAspectOnAspect_differentAttrAspects() throws Exception {
StructImpl a1ResultProvider = (StructImpl) a1.get(a1Result);
assertThat((Sequence>) a1ResultProvider.getValue("value"))
.containsExactly(
- "aspect a1 on target //test:dep_target sees a1p = a1p_val",
- "aspect a1 on target //test:extra_dep_target cannot see a1p",
- "aspect a1 on target //test:main sees a1p = a1p_val");
+ "aspect a1 on target @//test:dep_target sees a1p = a1p_val",
+ "aspect a1 on target @//test:extra_dep_target cannot see a1p",
+ "aspect a1 on target @//test:main sees a1p = a1p_val");
}
/**
@@ -5212,9 +5212,9 @@ public void testTopLevelAspectOnAspect_differentRequiredRuleProviders() throws E
StructImpl a1ResultProvider = (StructImpl) a1.get(a1Result);
assertThat((Sequence>) a1ResultProvider.getValue("value"))
.containsExactly(
- "aspect a1 on target //test:target_with_prov_a sees a1p = a1p_val",
- "aspect a1 on target //test:target_with_prov_b cannot see a1p",
- "aspect a1 on target //test:main sees a1p = a1p_val");
+ "aspect a1 on target @//test:target_with_prov_a sees a1p = a1p_val",
+ "aspect a1 on target @//test:target_with_prov_b cannot see a1p",
+ "aspect a1 on target @//test:main sees a1p = a1p_val");
}
/**
@@ -5305,8 +5305,8 @@ public void testTopLevelAspectOnAspect_providerRequiredByMultipleAspects() throw
StructImpl a2ResultProvider = (StructImpl) a2.get(a2Result);
assertThat((Sequence>) a2ResultProvider.getValue("value"))
.containsExactly(
- "aspect a2 on target //test:dep_target sees a3p = a3p_val",
- "aspect a2 on target //test:main sees a3p = a3p_val");
+ "aspect a2 on target @//test:dep_target sees a3p = a3p_val",
+ "aspect a2 on target @//test:main sees a3p = a3p_val");
ConfiguredAspect a1 = getConfiguredAspect(configuredAspects, "a1");
assertThat(a1).isNotNull();
@@ -5315,8 +5315,8 @@ public void testTopLevelAspectOnAspect_providerRequiredByMultipleAspects() throw
StructImpl a1ResultProvider = (StructImpl) a1.get(a1Result);
assertThat((Sequence>) a1ResultProvider.getValue("value"))
.containsExactly(
- "aspect a1 on target //test:dep_target sees a3p = a3p_val",
- "aspect a1 on target //test:main sees a3p = a3p_val");
+ "aspect a1 on target @//test:dep_target sees a3p = a3p_val",
+ "aspect a1 on target @//test:main sees a3p = a3p_val");
}
/**
@@ -5436,11 +5436,11 @@ public void testTopLevelAspectOnAspect_diamondCase() throws Exception {
StructImpl a3ResultProvider = (StructImpl) a3.get(a3Result);
assertThat((Sequence>) a3ResultProvider.getValue("value"))
.containsExactly(
- "aspect a3 on target //test:t0 sees a1p = a1p_val and cannot see a2p",
- "aspect a3 on target //test:t0 cannot see a1p and sees a2p = a2p_val",
- "aspect a3 on target //test:t1 sees a1p = a1p_val and cannot see a2p",
- "aspect a3 on target //test:t2 cannot see a1p and sees a2p = a2p_val",
- "aspect a3 on target //test:main sees a1p = a1p_val and sees a2p = a2p_val");
+ "aspect a3 on target @//test:t0 sees a1p = a1p_val and cannot see a2p",
+ "aspect a3 on target @//test:t0 cannot see a1p and sees a2p = a2p_val",
+ "aspect a3 on target @//test:t1 sees a1p = a1p_val and cannot see a2p",
+ "aspect a3 on target @//test:t2 cannot see a1p and sees a2p = a2p_val",
+ "aspect a3 on target @//test:main sees a1p = a1p_val and sees a2p = a2p_val");
}
@Test
@@ -5583,8 +5583,8 @@ public void testTopLevelAspectOnAspect_requiredAspectProviderOnlyAvailableOnDep(
StructImpl a1ResultProvider = (StructImpl) a1.get(a1Result);
assertThat((Sequence>) a1ResultProvider.getValue("value"))
.containsExactly(
- "aspect a1 on target //test:dep_target sees a2p = a2p_val",
- "aspect a1 on target //test:main cannot see a2p");
+ "aspect a1 on target @//test:dep_target sees a2p = a2p_val",
+ "aspect a1 on target @//test:main cannot see a2p");
}
@Test
@@ -5648,13 +5648,13 @@ public void testTopLevelAspectOnAspect_multipleTopLevelTargets() throws Exceptio
new StarlarkProvider.Key(Label.parseCanonical("//test:defs.bzl"), "a1_result");
StructImpl a1ResultProvider = (StructImpl) a1Ont1.get(a1Result);
assertThat((Sequence>) a1ResultProvider.getValue("value"))
- .containsExactly("aspect a1 on target //test:t1 sees a2p = a2p_val");
+ .containsExactly("aspect a1 on target @//test:t1 sees a2p = a2p_val");
ConfiguredAspect a1Ont2 = getConfiguredAspect(configuredAspects, "a1", "t2");
assertThat(a1Ont2).isNotNull();
a1ResultProvider = (StructImpl) a1Ont2.get(a1Result);
assertThat((Sequence>) a1ResultProvider.getValue("value"))
- .containsExactly("aspect a1 on target //test:t2 sees a2p = a2p_val");
+ .containsExactly("aspect a1 on target @//test:t2 sees a2p = a2p_val");
}
@Test
@@ -5735,8 +5735,8 @@ public void testTopLevelAspectOnAspect_multipleRequiredProviders() throws Except
StructImpl a1ResultProvider = (StructImpl) a1.get(a1Result);
assertThat((Sequence>) a1ResultProvider.getValue("value"))
.containsExactly(
- "aspect a1 on target //test:dep_target sees a2p = a2p_val and sees a3p = a3p_val",
- "aspect a1 on target //test:main sees a2p = a2p_val and sees a3p = a3p_val");
+ "aspect a1 on target @//test:dep_target sees a2p = a2p_val and sees a3p = a3p_val",
+ "aspect a1 on target @//test:main sees a2p = a2p_val and sees a3p = a3p_val");
}
@Test
@@ -5829,8 +5829,8 @@ public void testTopLevelAspectOnAspect_multipleRequiredProviders2() throws Excep
StructImpl a1ResultProvider = (StructImpl) a1.get(a1Result);
assertThat((Sequence>) a1ResultProvider.getValue("value"))
.containsExactly(
- "aspect a1 on target //test:dep_target sees a2p = a2p_val and sees a3p = a3p_val",
- "aspect a1 on target //test:main sees a2p = a2p_val and sees a3p = a3p_val");
+ "aspect a1 on target @//test:dep_target sees a2p = a2p_val and sees a3p = a3p_val",
+ "aspect a1 on target @//test:main sees a2p = a2p_val and sees a3p = a3p_val");
ConfiguredAspect a2 = getConfiguredAspect(configuredAspects, "a2");
assertThat(a2).isNotNull();
@@ -5839,8 +5839,8 @@ public void testTopLevelAspectOnAspect_multipleRequiredProviders2() throws Excep
StructImpl a2ResultProvider = (StructImpl) a2.get(a2Result);
assertThat((Sequence>) a2ResultProvider.getValue("value"))
.containsExactly(
- "aspect a2 on target //test:dep_target sees a3p = a3p_val",
- "aspect a2 on target //test:main sees a3p = a3p_val");
+ "aspect a2 on target @//test:dep_target sees a3p = a3p_val",
+ "aspect a2 on target @//test:main sees a3p = a3p_val");
}
/**
@@ -6084,7 +6084,7 @@ public void testTopLevelAspectRequiresAspect_ruleAttributes() throws Exception {
new StarlarkProvider.Key(Label.parseCanonical("//test:defs.bzl"), "RequiredAspectProv");
StructImpl requiredAspectProvider = (StructImpl) requiredAspect.get(requiredAspectProv);
assertThat((Sequence>) requiredAspectProvider.getValue("p_val"))
- .containsExactly("In required_aspect, p = main_val on target //test:main_target");
+ .containsExactly("In required_aspect, p = main_val on target @//test:main_target");
// base_aspect can run on main_target and dep_target and it can also see the providers created
// by running required_target on them.
@@ -6095,10 +6095,10 @@ public void testTopLevelAspectRequiresAspect_ruleAttributes() throws Exception {
StructImpl baseAspectProvider = (StructImpl) baseAspect.get(baseAspectProv);
assertThat((Sequence>) baseAspectProvider.getValue("p_val"))
.containsExactly(
- "In base_aspect, p = dep_val on target //test:dep_target",
- "In base_aspect, p = main_val on target //test:main_target",
- "In required_aspect, p = dep_val on target //test:dep_target",
- "In required_aspect, p = main_val on target //test:main_target");
+ "In base_aspect, p = dep_val on target @//test:dep_target",
+ "In base_aspect, p = main_val on target @//test:main_target",
+ "In required_aspect, p = dep_val on target @//test:dep_target",
+ "In required_aspect, p = main_val on target @//test:main_target");
}
@Test
@@ -6193,15 +6193,15 @@ public void testTopLevelAspectRequiresAspect_inheritPropagationAttributes() thro
StructImpl baseAspectProvider = (StructImpl) baseAspect.get(baseAspectProv);
assertThat((Sequence>) baseAspectProvider.getValue("result"))
.containsExactly(
- "second_required_aspect run on target //test:second_dep_target",
- "second_required_aspect run on target //test:main_target",
- "second_required_aspect run on target //test:first_dep_target",
- "second_required_aspect run on target //test:base_dep_target",
- "first_required_aspect run on target //test:first_dep_target",
- "first_required_aspect run on target //test:main_target",
- "first_required_aspect run on target //test:base_dep_target",
- "base_aspect run on target //test:base_dep_target",
- "base_aspect run on target //test:main_target");
+ "second_required_aspect run on target @//test:second_dep_target",
+ "second_required_aspect run on target @//test:main_target",
+ "second_required_aspect run on target @//test:first_dep_target",
+ "second_required_aspect run on target @//test:base_dep_target",
+ "first_required_aspect run on target @//test:first_dep_target",
+ "first_required_aspect run on target @//test:main_target",
+ "first_required_aspect run on target @//test:base_dep_target",
+ "base_aspect run on target @//test:base_dep_target",
+ "base_aspect run on target @//test:main_target");
}
@Test
@@ -6323,10 +6323,10 @@ public void testTopLevelAspectRequiresAspect_inheritRequiredProviders() throws E
StructImpl collectorProvider = (StructImpl) aspectA.get(collectorProv);
assertThat((Sequence>) collectorProvider.getValue("result"))
.containsExactly(
- "aspect_c run on target //test:target_with_prov_c and value of Prov_C = val_c",
- "aspect_b run on target //test:target_with_prov_b and value of Prov_B = val_b",
- "aspect_a run on target //test:target_with_prov_a and value of Prov_A = val_a",
- "aspect_a run on target //test:main_target and value of Prov_A = main_val_a")
+ "aspect_c run on target @//test:target_with_prov_c and value of Prov_C = val_c",
+ "aspect_b run on target @//test:target_with_prov_b and value of Prov_B = val_b",
+ "aspect_a run on target @//test:target_with_prov_a and value of Prov_A = val_a",
+ "aspect_a run on target @//test:main_target and value of Prov_A = main_val_a")
.inOrder();
}
@@ -6515,12 +6515,13 @@ public void testTopLevelAspectRequiresAspect_withRequiredAspectProvidersSatisfie
assertThat(aspectA).isNotNull();
String aspectAResult = (String) aspectA.get("aspect_a_result");
assertThat(aspectAResult)
- .isEqualTo("aspect_a on target //test:main_target found prov_a = a1 and found prov_b = b1");
+ .isEqualTo(
+ "aspect_a on target @//test:main_target found prov_a = a1 and found prov_b = b1");
ConfiguredAspect aspectB = getConfiguredAspect(configuredAspects, "aspect_b");
assertThat(aspectB).isNotNull();
String aspectBResult = (String) aspectB.get("aspect_b_result");
- assertThat(aspectBResult).isEqualTo("aspect_b on target //test:main_target found prov_b = b1");
+ assertThat(aspectBResult).isEqualTo("aspect_b on target @//test:main_target found prov_b = b1");
}
@Test
@@ -6587,12 +6588,13 @@ public void testTopLevelAspectRequiresAspect_withRequiredAspectProvidersNotFound
ConfiguredAspect aspectA = getConfiguredAspect(configuredAspects, "aspect_a");
assertThat(aspectA).isNotNull();
String aspectAResult = (String) aspectA.get("aspect_a_result");
- assertThat(aspectAResult).isEqualTo("aspect_a on target //test:main_target found prov_a = a1");
+ assertThat(aspectAResult).isEqualTo("aspect_a on target @//test:main_target found prov_a = a1");
ConfiguredAspect aspectB = getConfiguredAspect(configuredAspects, "aspect_b");
assertThat(aspectB).isNotNull();
String aspectBResult = (String) aspectB.get("aspect_b_result");
- assertThat(aspectBResult).isEqualTo("aspect_b on target //test:main_target cannot find prov_b");
+ assertThat(aspectBResult)
+ .isEqualTo("aspect_b on target @//test:main_target cannot find prov_b");
}
@Ignore("TODO(b/206127051): Fix the crash, rename the test and add a check the error message.")
@@ -6687,18 +6689,18 @@ public void testTopLevelAspectsWithParameters() throws Exception {
StarlarkList> aspectAResult = (StarlarkList) aspectA.get("aspect_a_result");
assertThat(Starlark.toIterable(aspectAResult))
.containsExactly(
- "aspect_a on target //test:main_target, p1 = p1_v1 and a_p = a_p_v1",
- "aspect_a on target //test:dep_target_1, p1 = p1_v1 and a_p = a_p_v1",
- "aspect_a on target //test:dep_target_2, p1 = p1_v1 and a_p = a_p_v1");
+ "aspect_a on target @//test:main_target, p1 = p1_v1 and a_p = a_p_v1",
+ "aspect_a on target @//test:dep_target_1, p1 = p1_v1 and a_p = a_p_v1",
+ "aspect_a on target @//test:dep_target_2, p1 = p1_v1 and a_p = a_p_v1");
ConfiguredAspect aspectB = getConfiguredAspect(configuredAspects, "aspect_b");
assertThat(aspectB).isNotNull();
StarlarkList> aspectBResult = (StarlarkList) aspectB.get("aspect_b_result");
assertThat(Starlark.toIterable(aspectBResult))
.containsExactly(
- "aspect_b on target //test:main_target, p1 = p1_v1 and b_p = b_p_v1",
- "aspect_b on target //test:dep_target_1, p1 = p1_v1 and b_p = b_p_v1",
- "aspect_b on target //test:dep_target_2, p1 = p1_v1 and b_p = b_p_v1");
+ "aspect_b on target @//test:main_target, p1 = p1_v1 and b_p = b_p_v1",
+ "aspect_b on target @//test:dep_target_1, p1 = p1_v1 and b_p = b_p_v1",
+ "aspect_b on target @//test:dep_target_2, p1 = p1_v1 and b_p = b_p_v1");
}
@Test
@@ -6827,9 +6829,9 @@ public void testTopLevelAspectsWithParameters_useDefaultValue() throws Exception
StarlarkList> aspectAResult = (StarlarkList) aspectA.get("aspect_a_result");
assertThat(Starlark.toIterable(aspectAResult))
.containsExactly(
- "aspect_a on target //test:main_target, p1 = p1_v2 and p2 = p2_v1",
- "aspect_a on target //test:dep_target_1, p1 = p1_v2 and p2 = p2_v1",
- "aspect_a on target //test:dep_target_2, p1 = p1_v2 and p2 = p2_v1");
+ "aspect_a on target @//test:main_target, p1 = p1_v2 and p2 = p2_v1",
+ "aspect_a on target @//test:dep_target_1, p1 = p1_v2 and p2 = p2_v1",
+ "aspect_a on target @//test:dep_target_2, p1 = p1_v2 and p2 = p2_v1");
}
@Test
@@ -6898,18 +6900,18 @@ public void testTopLevelAspectsWithParameters_passParametersToRequiredAspect() t
StarlarkList> aspectAResult = (StarlarkList) aspectA.get("aspect_a_result");
assertThat(Starlark.toIterable(aspectAResult))
.containsExactly(
- "aspect_a on target //test:main_target, p1 = p1_v1 and p2 = p2_v2",
- "aspect_a on target //test:dep_target_1, p1 = p1_v1 and p2 = p2_v2",
- "aspect_a on target //test:dep_target_2, p1 = p1_v1 and p2 = p2_v2");
+ "aspect_a on target @//test:main_target, p1 = p1_v1 and p2 = p2_v2",
+ "aspect_a on target @//test:dep_target_1, p1 = p1_v1 and p2 = p2_v2",
+ "aspect_a on target @//test:dep_target_2, p1 = p1_v1 and p2 = p2_v2");
ConfiguredAspect aspectB = getConfiguredAspect(configuredAspects, "aspect_b");
assertThat(aspectB).isNotNull();
StarlarkList> aspectBResult = (StarlarkList) aspectB.get("aspect_b_result");
assertThat(Starlark.toIterable(aspectBResult))
.containsExactly(
- "aspect_b on target //test:main_target, p1 = p1_v1 and p3 = p3_v3",
- "aspect_b on target //test:dep_target_1, p1 = p1_v1 and p3 = p3_v3",
- "aspect_b on target //test:dep_target_2, p1 = p1_v1 and p3 = p3_v3");
+ "aspect_b on target @//test:main_target, p1 = p1_v1 and p3 = p3_v3",
+ "aspect_b on target @//test:dep_target_1, p1 = p1_v1 and p3 = p3_v3",
+ "aspect_b on target @//test:dep_target_2, p1 = p1_v1 and p3 = p3_v3");
}
@Test
@@ -7220,9 +7222,9 @@ public void testTopLevelAspectsWithParameters_noNeedForAllowedValues() throws Ex
StarlarkList> aspectAResult = (StarlarkList) aspectA.get("aspect_a_result");
assertThat(Starlark.toIterable(aspectAResult))
.containsExactly(
- "aspect_a on target //test:main_target, p = p_v",
- "aspect_a on target //test:dep_target_1, p = p_v",
- "aspect_a on target //test:dep_target_2, p = p_v");
+ "aspect_a on target @//test:main_target, p = p_v",
+ "aspect_a on target @//test:dep_target_1, p = p_v",
+ "aspect_a on target @//test:dep_target_2, p = p_v");
}
/**
@@ -7531,7 +7533,7 @@ public void aspectIntegerParameter_withDefaultValue() throws Exception {
Iterables.getOnlyElement(analysisResult.getTargetsToBuild());
StarlarkList> ruleResult = (StarlarkList) configuredTarget.get("my_rule_result");
assertThat(Starlark.toIterable(ruleResult))
- .containsExactly("my_aspect on target //test:dep_target, my_attr = 1");
+ .containsExactly("my_aspect on target @//test:dep_target, my_attr = 1");
}
@Test
@@ -7574,7 +7576,7 @@ public void aspectIntegerParameter_valueOverwrittenByRuleDefault() throws Except
Iterables.getOnlyElement(analysisResult.getTargetsToBuild());
StarlarkList> ruleResult = (StarlarkList) configuredTarget.get("my_rule_result");
assertThat(Starlark.toIterable(ruleResult))
- .containsExactly("my_aspect on target //test:dep_target, my_attr = 2");
+ .containsExactly("my_aspect on target @//test:dep_target, my_attr = 2");
}
@Test
@@ -7618,7 +7620,7 @@ public void aspectIntegerParameter_valueOverwrittenByTargetValue() throws Except
Iterables.getOnlyElement(analysisResult.getTargetsToBuild());
StarlarkList> ruleResult = (StarlarkList) configuredTarget.get("my_rule_result");
assertThat(Starlark.toIterable(ruleResult))
- .containsExactly("my_aspect on target //test:dep_target, my_attr = 3");
+ .containsExactly("my_aspect on target @//test:dep_target, my_attr = 3");
}
@Test
@@ -7733,9 +7735,9 @@ public void testTopLevelAspectsWithIntegerParameter() throws Exception {
StarlarkList> aspectAResult = (StarlarkList) aspectA.get("aspect_a_result");
assertThat(Starlark.toIterable(aspectAResult))
.containsExactly(
- "aspect_a on target //test:main_target, p = 2",
- "aspect_a on target //test:dep_target_1, p = 2",
- "aspect_a on target //test:dep_target_2, p = 2");
+ "aspect_a on target @//test:main_target, p = 2",
+ "aspect_a on target @//test:dep_target_1, p = 2",
+ "aspect_a on target @//test:dep_target_2, p = 2");
}
@Test
@@ -7785,9 +7787,9 @@ public void testTopLevelAspectsWithIntegerParameter_useDefaultValue() throws Exc
StarlarkList> aspectAResult = (StarlarkList) aspectA.get("aspect_a_result");
assertThat(Starlark.toIterable(aspectAResult))
.containsExactly(
- "aspect_a on target //test:main_target, p = 1",
- "aspect_a on target //test:dep_target_1, p = 1",
- "aspect_a on target //test:dep_target_2, p = 1");
+ "aspect_a on target @//test:main_target, p = 1",
+ "aspect_a on target @//test:dep_target_1, p = 1",
+ "aspect_a on target @//test:dep_target_2, p = 1");
}
@Test
@@ -7963,7 +7965,7 @@ public void aspectBooleanParameter_withDefaultValue() throws Exception {
Iterables.getOnlyElement(analysisResult.getTargetsToBuild());
StarlarkList> ruleResult = (StarlarkList) configuredTarget.get("my_rule_result");
assertThat(Starlark.toIterable(ruleResult))
- .containsExactly("my_aspect on target //test:dep_target, my_attr = True");
+ .containsExactly("my_aspect on target @//test:dep_target, my_attr = True");
}
@Test
@@ -8006,7 +8008,7 @@ public void aspectBooleanParameter_valueOverwrittenByRuleDefault() throws Except
Iterables.getOnlyElement(analysisResult.getTargetsToBuild());
StarlarkList> ruleResult = (StarlarkList) configuredTarget.get("my_rule_result");
assertThat(Starlark.toIterable(ruleResult))
- .containsExactly("my_aspect on target //test:dep_target, my_attr = False");
+ .containsExactly("my_aspect on target @//test:dep_target, my_attr = False");
}
@Test
@@ -8050,7 +8052,7 @@ public void aspectBooleanParameter_valueOverwrittenByTargetValue() throws Except
Iterables.getOnlyElement(analysisResult.getTargetsToBuild());
StarlarkList> ruleResult = (StarlarkList) configuredTarget.get("my_rule_result");
assertThat(Starlark.toIterable(ruleResult))
- .containsExactly("my_aspect on target //test:dep_target, my_attr = False");
+ .containsExactly("my_aspect on target @//test:dep_target, my_attr = False");
}
@Test
@@ -8103,9 +8105,9 @@ public void testTopLevelAspectsWithBooleanParameter() throws Exception {
StarlarkList> aspectAResult = (StarlarkList) aspectA.get("aspect_a_result");
assertThat(Starlark.toIterable(aspectAResult))
.containsExactly(
- "aspect_a on target //test:main_target, p = True",
- "aspect_a on target //test:dep_target_1, p = True",
- "aspect_a on target //test:dep_target_2, p = True");
+ "aspect_a on target @//test:main_target, p = True",
+ "aspect_a on target @//test:dep_target_1, p = True",
+ "aspect_a on target @//test:dep_target_2, p = True");
}
@Test
@@ -8155,9 +8157,9 @@ public void testTopLevelAspectsWithBooleanParameter_useDefaultValue() throws Exc
StarlarkList> aspectAResult = (StarlarkList) aspectA.get("aspect_a_result");
assertThat(Starlark.toIterable(aspectAResult))
.containsExactly(
- "aspect_a on target //test:main_target, p = False",
- "aspect_a on target //test:dep_target_1, p = False",
- "aspect_a on target //test:dep_target_2, p = False");
+ "aspect_a on target @//test:main_target, p = False",
+ "aspect_a on target @//test:dep_target_1, p = False",
+ "aspect_a on target @//test:dep_target_2, p = False");
}
@Test
@@ -8368,7 +8370,7 @@ public void testRuleAspectWithMandatoryParameter_useRuleDefault() throws Excepti
ConfiguredTarget configuredTarget =
Iterables.getOnlyElement(analysisResult.getTargetsToBuild());
String aspectAResult = (String) configuredTarget.get("aspect_a_result");
- assertThat(aspectAResult).isEqualTo("aspect_a on target //test:dep_target, p = p_v2");
+ assertThat(aspectAResult).isEqualTo("aspect_a on target @//test:dep_target, p = p_v2");
}
@Test
@@ -8415,7 +8417,7 @@ public void testRuleAspectWithMandatoryParameterProvided() throws Exception {
ConfiguredTarget configuredTarget =
Iterables.getOnlyElement(analysisResult.getTargetsToBuild());
String aspectAResult = (String) configuredTarget.get("aspect_a_result");
- assertThat(aspectAResult).isEqualTo("aspect_a on target //test:dep_target, p = p_v1");
+ assertThat(aspectAResult).isEqualTo("aspect_a on target @//test:dep_target, p = p_v1");
}
@Test
diff --git a/src/test/java/com/google/devtools/build/lib/starlark/StarlarkIntegrationTest.java b/src/test/java/com/google/devtools/build/lib/starlark/StarlarkIntegrationTest.java
index a4a0e53c459bda..21526932b03694 100644
--- a/src/test/java/com/google/devtools/build/lib/starlark/StarlarkIntegrationTest.java
+++ b/src/test/java/com/google/devtools/build/lib/starlark/StarlarkIntegrationTest.java
@@ -1347,7 +1347,7 @@ public void testRuleClassImplicitOutputFunctionPrints() throws Exception {
getConfiguredTarget("//test/starlark:cr");
assertContainsEvent("output function cr");
- assertContainsEvent("implementation //test/starlark:cr");
+ assertContainsEvent("implementation @//test/starlark:cr");
}
@Test
diff --git a/src/test/java/com/google/devtools/build/lib/starlark/StarlarkStringRepresentationsTest.java b/src/test/java/com/google/devtools/build/lib/starlark/StarlarkStringRepresentationsTest.java
index e0d2d0572a934c..35c1f6515d149a 100644
--- a/src/test/java/com/google/devtools/build/lib/starlark/StarlarkStringRepresentationsTest.java
+++ b/src/test/java/com/google/devtools/build/lib/starlark/StarlarkStringRepresentationsTest.java
@@ -233,9 +233,9 @@ public void testStringRepresentations_strings() throws Exception {
@Test
public void testStringRepresentations_labels() throws Exception {
- assertThat(starlarkLoadingEval("str(Label('//foo:bar'))")).isEqualTo("//foo:bar");
- assertThat(starlarkLoadingEval("'%s' % Label('//foo:bar')")).isEqualTo("//foo:bar");
- assertThat(starlarkLoadingEval("'{}'.format(Label('//foo:bar'))")).isEqualTo("//foo:bar");
+ assertThat(starlarkLoadingEval("str(Label('//foo:bar'))")).isEqualTo("@//foo:bar");
+ assertThat(starlarkLoadingEval("'%s' % Label('//foo:bar')")).isEqualTo("@//foo:bar");
+ assertThat(starlarkLoadingEval("'{}'.format(Label('//foo:bar'))")).isEqualTo("@//foo:bar");
assertThat(starlarkLoadingEval("repr(Label('//foo:bar'))")).isEqualTo("Label(\"//foo:bar\")");
assertThat(starlarkLoadingEval("'%r' % Label('//foo:bar')")).isEqualTo("Label(\"//foo:bar\")");
diff --git a/src/test/shell/bazel/platform_mapping_test.sh b/src/test/shell/bazel/platform_mapping_test.sh
index b7e05453de4003..d1fd6cd697b1ff 100755
--- a/src/test/shell/bazel/platform_mapping_test.sh
+++ b/src/test/shell/bazel/platform_mapping_test.sh
@@ -69,7 +69,7 @@ EOF
bazel build --cpu=arm64 package:report &> $TEST_log \
|| fail "Build failed unexpectedly"
- expect_log "platform: //plat:platform1"
+ expect_log "platform: @//plat:platform1"
}
function test_top_level_platform_to_flags_mapping() {
@@ -104,7 +104,7 @@ EOF
bazel build --cpu=arm64 --platform_mappings=custom/platform_mappings \
package:report &> $TEST_log || fail "Build failed unexpectedly"
- expect_log "platform: //plat:platform1"
+ expect_log "platform: @//plat:platform1"
}
function test_custom_platform_mapping_location_after_exec_transition() {
@@ -140,7 +140,7 @@ EOF
--platform_mappings=custom/platform_mappings \
--extra_execution_platforms=//plat:platform1 \
package:genrule1 &> $TEST_log || fail "Build failed unexpectedly"
- expect_log "platform: //plat:platform1"
+ expect_log "platform: @//plat:platform1"
expect_log "copts: \[\"foo\"\]"
}
@@ -203,8 +203,8 @@ EOF
bazel build --cpu=k8 package:custom &> $TEST_log \
|| fail "Build failed unexpectedly"
- expect_not_log "platform: //plat:platform1"
- expect_log "platform: //plat:platform2"
+ expect_not_log "platform: @//plat:platform1"
+ expect_log "platform: @//plat:platform2"
}
function test_target_platform_fallback() {
@@ -223,7 +223,7 @@ EOF
--noincompatible_auto_configure_host_platform \
--target_platform_fallback=//plat:platform2 &> "${TEST_log}" \
|| fail "Build failed unexpectedly"
- expect_log "platform: //plat:platform2"
+ expect_log "platform: @//plat:platform2"
}
function test_target_platform_fallback_after_exec() {
@@ -294,7 +294,7 @@ EOF
--noincompatible_auto_configure_host_platform \
--target_platform_fallback=//plat:platform2 &> "${TEST_log}" \
|| fail "Build failed unexpectedly"
- expect_log "platform: //plat:platform2"
+ expect_log "platform: @//plat:platform2"
}
run_suite "platform mapping test"
diff --git a/src/test/shell/integration/aspect_test.sh b/src/test/shell/integration/aspect_test.sh
index b000901d06e042..50d4333960ff58 100755
--- a/src/test/shell/integration/aspect_test.sh
+++ b/src/test/shell/integration/aspect_test.sh
@@ -175,16 +175,16 @@ EOF
# Only aspect_a is applied on target_with_a because its "provided" providers
# do not macth aspect_b required providers.
- expect_log "aspect_a runs on target //${package}:target_with_a"
- expect_not_log "aspect_b runs on target //${package}:target_with_a"
+ expect_log "aspect_a runs on target @//${package}:target_with_a"
+ expect_not_log "aspect_b runs on target @//${package}:target_with_a"
# Only aspect_a can run on target_with_a_indeps
- expect_log "aspect_a runs on target //${package}:target_with_a_indeps"
- expect_not_log "aspect_b runs on target //${package}:target_with_a_indeps"
+ expect_log "aspect_a runs on target @//${package}:target_with_a_indeps"
+ expect_not_log "aspect_b runs on target @//${package}:target_with_a_indeps"
# Only aspect_b can run on target_with_bc
- expect_not_log "aspect_a runs on target //${package}:target_with_bc"
- expect_log "aspect_b runs on target //${package}:target_with_bc"
+ expect_not_log "aspect_a runs on target @//${package}:target_with_bc"
+ expect_log "aspect_b runs on target @//${package}:target_with_bc"
# using --incompatible_top_level_aspects_require_providers, the top level
# target rule's advertised providers will be checked and only aspect_a will be
@@ -196,17 +196,17 @@ EOF
|| fail "Build failed but should have succeeded"
# Only aspect_a is applied on target_with_a
- expect_log "aspect_a runs on target //${package}:target_with_a"
- expect_not_log "aspect_b runs on target //${package}:target_with_a"
+ expect_log "aspect_a runs on target @//${package}:target_with_a"
+ expect_not_log "aspect_b runs on target @//${package}:target_with_a"
# Only aspect_a can run on target_with_a_indeps
- expect_log "aspect_a runs on target //${package}:target_with_a_indeps"
- expect_not_log "aspect_b runs on target //${package}:target_with_a_indeps"
+ expect_log "aspect_a runs on target @//${package}:target_with_a_indeps"
+ expect_not_log "aspect_b runs on target @//${package}:target_with_a_indeps"
# rule_with_bc advertised provides only match the required providers for
# aspect_b, but aspect_b is not propagated from target_with_a
- expect_not_log "aspect_a runs on target //${package}:target_with_bc"
- expect_not_log "aspect_b runs on target //${package}:target_with_bc"
+ expect_not_log "aspect_a runs on target @//${package}:target_with_bc"
+ expect_not_log "aspect_b runs on target @//${package}:target_with_bc"
}
function test_aspect_required_providers_default_no_required_providers() {
@@ -268,10 +268,10 @@ EOF
# my_aspect does not require any providers so it will be applied to all the
# dependencies of main target
- expect_log "my_aspect runs on target //${package}:target_without_providers"
- expect_log "my_aspect runs on target //${package}:target_with_providers"
- expect_log "my_aspect runs on target //${package}:target_with_providers_not_advertised"
- expect_log "my_aspect runs on target //${package}:target_with_providers_indeps"
+ expect_log "my_aspect runs on target @//${package}:target_without_providers"
+ expect_log "my_aspect runs on target @//${package}:target_with_providers"
+ expect_log "my_aspect runs on target @//${package}:target_with_providers_not_advertised"
+ expect_log "my_aspect runs on target @//${package}:target_with_providers_indeps"
}
function test_aspect_required_providers_flat_set_of_required_providers() {
@@ -352,15 +352,15 @@ EOF
# my_aspect will only be applied on target_with_ab and
# target_with_ab_indeps_reached since their rule (rule_with_ab) is the only
# rule that advertises the aspect required providers.
- expect_log "my_aspect runs on target //${package}:target_with_ab"
- expect_log "my_aspect runs on target //${package}:target_with_ab_indeps_reached"
- expect_not_log "/^my_aspect runs on target //${package}:target_with_a$/"
- expect_not_log "my_aspect runs on target //${package}:target_without_providers"
- expect_not_log "my_aspect runs on target //${package}:target_with_ab_not_advertised"
+ expect_log "my_aspect runs on target @//${package}:target_with_ab"
+ expect_log "my_aspect runs on target @//${package}:target_with_ab_indeps_reached"
+ expect_not_log "/^my_aspect runs on target @//${package}:target_with_a$/"
+ expect_not_log "my_aspect runs on target @//${package}:target_without_providers"
+ expect_not_log "my_aspect runs on target @//${package}:target_with_ab_not_advertised"
# my_aspect cannot be propagated to target_with_ab_indeps_not_reached
# because it was not applied to its parent (target_with_a)
- expect_not_log "my_aspect runs on target //${package}:target_with_ab_indeps_not_reached"
+ expect_not_log "my_aspect runs on target @//${package}:target_with_ab_indeps_not_reached"
}
function test_aspect_required_providers_with_list_of_required_providers_lists() {
@@ -453,16 +453,16 @@ EOF
# my_aspect will only be applied on target_with_ab, target_wtih_c and
# target_with_c_indeps_reached because their rules (rule_with_ab and
# rule_with_c) are the only rules advertising the aspect required providers
- expect_log "my_aspect runs on target //${package}:target_with_ab"
- expect_log "my_aspect runs on target //${package}:target_with_c"
- expect_log "my_aspect runs on target //${package}:target_with_c_indeps_reached"
- expect_not_log "my_aspect runs on target //${package}:target_without_providers"
- expect_not_log "/^my_aspect runs on target //${package}:target_with_a$/"
- expect_not_log "my_aspect runs on target //${package}:target_with_ab_not_advertised"
+ expect_log "my_aspect runs on target @//${package}:target_with_ab"
+ expect_log "my_aspect runs on target @//${package}:target_with_c"
+ expect_log "my_aspect runs on target @//${package}:target_with_c_indeps_reached"
+ expect_not_log "my_aspect runs on target @//${package}:target_without_providers"
+ expect_not_log "/^my_aspect runs on target @//${package}:target_with_a$/"
+ expect_not_log "my_aspect runs on target @//${package}:target_with_ab_not_advertised"
# my_aspect cannot be propagated to target_with_c_indeps_not_reached because it was
# not applied to its parent (target_with_a)
- expect_not_log "my_aspect runs on target //${package}:target_with_c_indeps_not_reached"
+ expect_not_log "my_aspect runs on target @//${package}:target_with_c_indeps_not_reached"
}
function test_aspects_propagating_other_aspects() {
@@ -536,12 +536,12 @@ EOF
# dep_target_without_providers_1 and dep_target_with_prov_a but
# required_aspect will only run on dep_target_with_prov_a because
# it satisfies its required providers
- expect_log "base_aspect runs on target //${package}:dep_target_with_prov_a"
- expect_log "base_aspect runs on target //${package}:dep_target_without_providers_1"
- expect_log "base_aspect runs on target //${package}:dep_target_without_providers"
- expect_log "required_aspect runs on target //${package}:dep_target_with_prov_a"
- expect_not_log "required_aspect runs on target //${package}:dep_target_without_providers_1"
- expect_not_log "required_aspect runs on target //${package}:dep_target_without_providers/"
+ expect_log "base_aspect runs on target @//${package}:dep_target_with_prov_a"
+ expect_log "base_aspect runs on target @//${package}:dep_target_without_providers_1"
+ expect_log "base_aspect runs on target @//${package}:dep_target_without_providers"
+ expect_log "required_aspect runs on target @//${package}:dep_target_with_prov_a"
+ expect_not_log "required_aspect runs on target @//${package}:dep_target_without_providers_1"
+ expect_not_log "required_aspect runs on target @//${package}:dep_target_without_providers/"
}
function test_aspects_propagating_other_aspects_stack_of_required_aspects() {
@@ -615,12 +615,12 @@ EOF
# Check that aspects: aspect_a, aspect_b, aspect_c were propagated to the
# dependencies of target test: t and x when only aspect_a is specified
# in the rule definition
- expect_log_once "Aspect 'c' applied on target: //${package}:x"
- expect_log_once "Aspect 'c' applied on target: //${package}:t"
- expect_log_once "Aspect 'b' applied on target: //${package}:x"
- expect_log_once "Aspect 'b' applied on target: //${package}:t"
- expect_log_once "Aspect 'a' applied on target: //${package}:x"
- expect_log_once "Aspect 'a' applied on target: //${package}:t"
+ expect_log_once "Aspect 'c' applied on target: @//${package}:x"
+ expect_log_once "Aspect 'c' applied on target: @//${package}:t"
+ expect_log_once "Aspect 'b' applied on target: @//${package}:x"
+ expect_log_once "Aspect 'b' applied on target: @//${package}:t"
+ expect_log_once "Aspect 'a' applied on target: @//${package}:x"
+ expect_log_once "Aspect 'a' applied on target: @//${package}:t"
}
function test_aspect_has_access_to_aspect_hints_attribute_in_native_rules() {
@@ -1034,12 +1034,12 @@ EOF
--aspects_parameters="p3=p3_v3" \
&> $TEST_log || fail "Build failed"
- expect_log "aspect_a on target //test:main_target, p1 = p1_v1 and p3 = p3_v3"
- expect_log "aspect_a on target //test:dep_target_1, p1 = p1_v1 and p3 = p3_v3"
- expect_log "aspect_a on target //test:dep_target_2, p1 = p1_v1 and p3 = p3_v3"
- expect_log "aspect_b on target //test:main_target, p1 = p1_v1 and p2 = p2_v2"
- expect_log "aspect_b on target //test:dep_target_1, p1 = p1_v1 and p2 = p2_v2"
- expect_log "aspect_b on target //test:dep_target_2, p1 = p1_v1 and p2 = p2_v2"
+ expect_log "aspect_a on target @//test:main_target, p1 = p1_v1 and p3 = p3_v3"
+ expect_log "aspect_a on target @//test:dep_target_1, p1 = p1_v1 and p3 = p3_v3"
+ expect_log "aspect_a on target @//test:dep_target_2, p1 = p1_v1 and p3 = p3_v3"
+ expect_log "aspect_b on target @//test:main_target, p1 = p1_v1 and p2 = p2_v2"
+ expect_log "aspect_b on target @//test:dep_target_1, p1 = p1_v1 and p2 = p2_v2"
+ expect_log "aspect_b on target @//test:dep_target_2, p1 = p1_v1 and p2 = p2_v2"
}
# aspect_a is propagated from command line on top level target main_target with
@@ -1087,9 +1087,9 @@ EOF
--aspects_parameters="p=p_v1" \
&> $TEST_log || fail "Build failed"
- expect_log "aspect_a on target //test:main_target, p = p_v1"
- expect_log "aspect_a on target //test:dep_target, p = p_v1"
- expect_log "aspect_a on target //test:dep_target, p = p_v2"
+ expect_log "aspect_a on target @//test:main_target, p = p_v1"
+ expect_log "aspect_a on target @//test:dep_target, p = p_v1"
+ expect_log "aspect_a on target @//test:dep_target, p = p_v2"
}
function test_top_level_aspects_parameters_invalid_multiple_param_values() {
diff --git a/src/test/shell/integration/configured_query_test.sh b/src/test/shell/integration/configured_query_test.sh
index ff34224e4aa6be..a1bb12e6f50217 100755
--- a/src/test/shell/integration/configured_query_test.sh
+++ b/src/test/shell/integration/configured_query_test.sh
@@ -1221,7 +1221,7 @@ EOF
2>"$TEST_log" || fail "Expected success"
assert_contains "//$pkg:pylib.py:providers=.*FileProvider.*FilesToRunProvider.*LicensesProvider.*VisibilityProvider" \
output
- assert_contains "VisbilityProvider.label://$pkg:pylib.py" output
+ assert_contains "VisbilityProvider.label:@//$pkg:pylib.py" output
}
function test_starlark_output_providers_starlark_provider() {
diff --git a/src/test/shell/integration/cpp_test.sh b/src/test/shell/integration/cpp_test.sh
index 743b2d9de51a2a..d38bd2cbe1d5f5 100755
--- a/src/test/shell/integration/cpp_test.sh
+++ b/src/test/shell/integration/cpp_test.sh
@@ -365,9 +365,9 @@ EOF
--cpu=fake --host_cpu=fake \
--crosstool_top=//$pkg/toolchain:alpha \
//$pkg:outer >& $TEST_log || fail "build failed"
- expect_log "Outer //$pkg:outer found cc toolchain toolchain-alpha"
- expect_log "Inner //$pkg:inner found cc toolchain toolchain-beta"
- expect_log "Tool //$pkg:tool found cc toolchain toolchain-alpha"
+ expect_log "Outer @//$pkg:outer found cc toolchain toolchain-alpha"
+ expect_log "Inner @//$pkg:inner found cc toolchain toolchain-beta"
+ expect_log "Tool @//$pkg:tool found cc toolchain toolchain-alpha"
}
run_suite "Tests for Bazel's C++ rules"
diff --git a/src/test/shell/integration/target_compatible_with_test.sh b/src/test/shell/integration/target_compatible_with_test.sh
index 6cd1dbba194290..0f2387bb58724e 100755
--- a/src/test/shell/integration/target_compatible_with_test.sh
+++ b/src/test/shell/integration/target_compatible_with_test.sh
@@ -1248,9 +1248,9 @@ EOF
--output=starlark --starlark:file=target_skipping/compatibility.cquery \
&> "${TEST_log}"
- expect_log '^//target_skipping:pass_on_foo1 is compatible$'
- expect_log '^//target_skipping:fail_on_foo2 is incompatible$'
- expect_log '^//target_skipping:some_foo3_target is incompatible$'
+ expect_log '^@//target_skipping:pass_on_foo1 is compatible$'
+ expect_log '^@//target_skipping:fail_on_foo2 is incompatible$'
+ expect_log '^@//target_skipping:some_foo3_target is incompatible$'
bazel cquery \
--host_platform=//target_skipping:foo3_platform \
@@ -1259,9 +1259,9 @@ EOF
--output=starlark --starlark:file=target_skipping/compatibility.cquery \
&> "${TEST_log}"
- expect_log '^//target_skipping:pass_on_foo1 is incompatible$'
- expect_log '^//target_skipping:fail_on_foo2 is incompatible$'
- expect_log '^//target_skipping:some_foo3_target is compatible$'
+ expect_log '^@//target_skipping:pass_on_foo1 is incompatible$'
+ expect_log '^@//target_skipping:fail_on_foo2 is incompatible$'
+ expect_log '^@//target_skipping:some_foo3_target is compatible$'
}
# Run an aquery on a target that is compatible. This should pass.
diff --git a/src/test/shell/integration/toolchain_test.sh b/src/test/shell/integration/toolchain_test.sh
index 6c6797ef92b1b1..24623e24840f8c 100755
--- a/src/test/shell/integration/toolchain_test.sh
+++ b/src/test/shell/integration/toolchain_test.sh
@@ -204,7 +204,7 @@ report_toolchain(
EOF
bazel build "//${pkg}:report" &> $TEST_log || fail "Build failed"
- expect_log "extra_label = \"//${pkg}:dep_rule\""
+ expect_log "extra_label = \"@//${pkg}:dep_rule\""
expect_log 'extra_str = "bar"'
}
@@ -1877,7 +1877,7 @@ EOF
bazel build \
--extra_execution_platforms="//${pkg}/platforms:all" \
"//${pkg}/demo:use" &> $TEST_log || fail "Build failed"
- expect_log "//${pkg}/demo:dep target platform: //${pkg}/platforms:platform2"
+ expect_log "@//${pkg}/demo:dep target platform: @//${pkg}/platforms:platform2"
}
function test_config_setting_with_constraints {
@@ -2111,13 +2111,13 @@ EOF
bazel build \
--extra_execution_platforms="//${pkg}/platforms:platform1,//${pkg}/platforms:platform2" \
"//${pkg}/demo:sample" &> $TEST_log || fail "Build failed"
- expect_log "//${pkg}/demo:tool target platform: //${pkg}/platforms:platform1"
+ expect_log "@//${pkg}/demo:tool target platform: @//${pkg}/platforms:platform1"
bazel build \
--extra_execution_platforms="//${pkg}/platforms:platform1,//${pkg}/platforms:platform2" \
--experimental_add_exec_constraints_to_targets "//${pkg}/demo:sample=//${pkg}/platforms:value2" \
"//${pkg}/demo:sample" &> $TEST_log || fail "Build failed"
- expect_log "//${pkg}/demo:tool target platform: //${pkg}/platforms:platform2"
+ expect_log "@//${pkg}/demo:tool target platform: @//${pkg}/platforms:platform2"
}
function test_deps_includes_exec_group_toolchain() {
@@ -2354,7 +2354,7 @@ demo_rule(name = "demo")
EOF
bazel build "//${pkg}/demo:demo" &> $TEST_log || fail "Build failed"
- expect_log "Inner toolchain //${pkg}/inner:impl"
+ expect_log "Inner toolchain @//${pkg}/inner:impl"
}
# Test that toolchain type labels are correctly resolved relative to the