Thanks for fixing this!

cc @lberki 
build_setting rules should not use toolchain resolution
Following from #9097.  Rules created using the build_setting features (https://docs.bazel.build/versions/master/skylark/config.html#instantiating-build-settings) should disable toolchain resolution (and probably also be non-configurable).
src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
diff --git a/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java b/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
index f4119496292500..0a08231e4c6bc0 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
@@ -853,6 +853,10 @@ public RuleClass build(String name, String key) {
           attrBuilder.allowedRuleClasses(ANY_RULE);
         }
         this.add(attrBuilder);
+
+        // Build setting rules should opt out of toolchain resolution, since they form part of the
+        // configuration.
+        this.useToolchainResolution(false);
       }
 
       return new RuleClass(
