Make `Label#toString` return `@@`-prefixed labels
This change causes all labels in error messages, log output, Build Event Protocol, etc. to be prefixed with double-at (`@@`) if they are from non-main repos. This prevents cases where messages contain stuff like `the target @abc~1.0//:def is wrong` but the user can't do `bazel query @abc~1.0//:def` at all, since the actual target is `@@abc~1.0//:def`.
This required more test changes than expected as there have been many places in the codebase where we compare labels using some sort of string form (for example, toolchain types as automatic exec groups).
Fixes https://github.com/bazelbuild/bazel/issues/18543.
RELNOTES[INC]: All labels in Bazel error messages, log output, Build Event Protocol, etc. are now prefixed with double-at (`@@`) instead of single-at (`@`) where applicable, to properly denote that they contain canonical repo names.
PiperOrigin-RevId: 581287175
Change-Id: I1261ab14067bcf5d44cd140e5528b5da5916dc87
diff --git a/src/test/java/com/google/devtools/build/lib/testutil/TestConstants.java b/src/test/java/com/google/devtools/build/lib/testutil/TestConstants.java
index 118086d..2019515 100644
--- a/src/test/java/com/google/devtools/build/lib/testutil/TestConstants.java
+++ b/src/test/java/com/google/devtools/build/lib/testutil/TestConstants.java
@@ -176,10 +176,10 @@
"@bazel_tools//tools/jdk:proguard_whitelister";
/** The java toolchain type. */
- public static final String JAVA_TOOLCHAIN_TYPE = "@bazel_tools//tools/jdk:toolchain_type";
+ public static final String JAVA_TOOLCHAIN_TYPE = "@@bazel_tools//tools/jdk:toolchain_type";
/** The cpp toolchain type. */
- public static final String CPP_TOOLCHAIN_TYPE = "@bazel_tools//tools/cpp:toolchain_type";
+ public static final String CPP_TOOLCHAIN_TYPE = "@@bazel_tools//tools/cpp:toolchain_type";
/** A choice of test execution mode, only varies internally. */
public enum InternalTestExecutionMode {