Automated rollback of commit 363413110f3a63a11d900864be1852adbaed2899.
*** Reason for rollback ***
Breaks //src/test/shell/bazel:bazel_bootstrap_distfile_test:
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO: ./compile.sh compile /path/to/bazel
🍃 Building Bazel from scratch......
🍃 Building Bazel with Bazel.
.WARNING: /tmp/bazel_cHivhPBc/out/external/bazel_tools/WORKSPACE:1: Workspace name in /tmp/bazel_cHivhPBc/out/external/bazel_tools/WORKSPACE (@io_bazel) does not match the name given in the repository's definition (@bazel_tools); this will cause a build error in future versions.
ERROR: in target '//external:cc_toolchain': error loading package '@local_config_cc//': Extension file not found. Unable to load file '@local_config_cc//:dummy_toolchain.bzl': file doesn't exist or isn't a file.
INFO: Elapsed time: 3.343s
ERROR: Could not build Bazel
Found by git bisect.
*** Original change description ***
Add a new toolchain type for c++. In order to do this, PlatformConfiguration is made a legal configuration fragment for every rule class.
Add a default "dummy" c++ toolchain to prevent resolution errors when legacy toolchain selection logic is used. Add toolchain mocks to java and shell tests.
PiperOrigin-RevId: 166750885
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java b/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java
index f52d66f..817f4d1 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java
@@ -182,60 +182,41 @@
* Share common attributes across both base and Skylark base rules.
*/
public static RuleClass.Builder commonCoreAndSkylarkAttributes(RuleClass.Builder builder) {
- return PlatformSemantics.platformAttributes(builder)
+ return builder
// The visibility attribute is special: it is a nodep label, and loading the
// necessary package groups is handled by {@link LabelVisitor#visitTargetVisibility}.
// Package groups always have the null configuration so that they are not duplicated
// needlessly.
- .add(
- attr("visibility", NODEP_LABEL_LIST)
- .orderIndependent()
- .cfg(HOST)
- .nonconfigurable(
- "special attribute integrated more deeply into Bazel's core logic"))
- .add(
- attr("deprecation", STRING)
- .value(deprecationDefault)
- .nonconfigurable("Used in core loading phase logic with no access to configs"))
- .add(
- attr("tags", STRING_LIST)
- .orderIndependent()
- .taggable()
- .nonconfigurable("low-level attribute, used in TargetUtils without configurations"))
- .add(
- attr("generator_name", STRING)
- .undocumented("internal")
- .nonconfigurable("static structure of a rule"))
- .add(
- attr("generator_function", STRING)
- .undocumented("internal")
- .nonconfigurable("static structure of a rule"))
- .add(
- attr("generator_location", STRING)
- .undocumented("internal")
- .nonconfigurable("static structure of a rule"))
- .add(
- attr("testonly", BOOLEAN)
- .value(testonlyDefault)
- .nonconfigurable("policy decision: rules testability should be consistent"))
+ .add(attr("visibility", NODEP_LABEL_LIST).orderIndependent().cfg(HOST)
+ .nonconfigurable("special attribute integrated more deeply into Bazel's core logic"))
+ .add(attr("deprecation", STRING).value(deprecationDefault)
+ .nonconfigurable("Used in core loading phase logic with no access to configs"))
+ .add(attr("tags", STRING_LIST).orderIndependent().taggable()
+ .nonconfigurable("low-level attribute, used in TargetUtils without configurations"))
+ .add(attr("generator_name", STRING).undocumented("internal")
+ .nonconfigurable("static structure of a rule"))
+ .add(attr("generator_function", STRING).undocumented("internal")
+ .nonconfigurable("static structure of a rule"))
+ .add(attr("generator_location", STRING).undocumented("internal")
+ .nonconfigurable("static structure of a rule"))
+ .add(attr("testonly", BOOLEAN).value(testonlyDefault)
+ .nonconfigurable("policy decision: rules testability should be consistent"))
.add(attr("features", STRING_LIST).orderIndependent())
.add(attr(":action_listener", LABEL_LIST).cfg(HOST).value(ACTION_LISTENER))
- .add(
- attr(RuleClass.COMPATIBLE_ENVIRONMENT_ATTR, LABEL_LIST)
- .allowedRuleClasses(EnvironmentRule.RULE_NAME)
- .cfg(Attribute.ConfigurationTransition.HOST)
- .allowedFileTypes(FileTypeSet.NO_FILE)
- .dontCheckConstraints()
- .nonconfigurable(
- "special logic for constraints and select: see ConstraintSemantics"))
- .add(
- attr(RuleClass.RESTRICTED_ENVIRONMENT_ATTR, LABEL_LIST)
- .allowedRuleClasses(EnvironmentRule.RULE_NAME)
- .cfg(Attribute.ConfigurationTransition.HOST)
- .allowedFileTypes(FileTypeSet.NO_FILE)
- .dontCheckConstraints()
- .nonconfigurable(
- "special logic for constraints and select: see ConstraintSemantics"));
+ .add(attr(RuleClass.COMPATIBLE_ENVIRONMENT_ATTR, LABEL_LIST)
+ .allowedRuleClasses(EnvironmentRule.RULE_NAME)
+ .cfg(Attribute.ConfigurationTransition.HOST)
+ .allowedFileTypes(FileTypeSet.NO_FILE)
+ .dontCheckConstraints()
+ .nonconfigurable("special logic for constraints and select: see ConstraintSemantics")
+ )
+ .add(attr(RuleClass.RESTRICTED_ENVIRONMENT_ATTR, LABEL_LIST)
+ .allowedRuleClasses(EnvironmentRule.RULE_NAME)
+ .cfg(Attribute.ConfigurationTransition.HOST)
+ .allowedFileTypes(FileTypeSet.NO_FILE)
+ .dontCheckConstraints()
+ .nonconfigurable("special logic for constraints and select: see ConstraintSemantics")
+ );
}
public static RuleClass.Builder nameAttribute(RuleClass.Builder builder) {