Implement starlark rule class transitions.
Add the `cfg` parameter to rule definition which can take transitions created by the transition() fxn. Split out common work for attribute and rule transitions into a util class and rename attribute transition work to distinguish from rule transition work.
Prohibit build settings targets from transitioning themselves since there is no use case for this (yet).
For now, prohibit rule transitions from accessing *any* attributes that are resolved through selects. This is an overly restrictive way to deal with the potential cycles caused by attribute-parameterized rule transitions and configurable attributes. But will fine tuned in follow up CLs to prevent this CL from being too large.
PiperOrigin-RevId: 228017175
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkSemantics.java b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkSemantics.java
index 492ceb8..413c818 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkSemantics.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkSemantics.java
@@ -43,6 +43,8 @@
SkylarkSemantics::experimentalEnableAndroidMigrationApis),
EXPERIMENTAL_BUILD_SETTING_API(SkylarkSemantics::experimentalBuildSettingApi),
EXPERIMENTAL_PLATFORM_API(SkylarkSemantics::experimentalPlatformsApi),
+ EXPERIMENTAL_STARLARK_CONFIG_TRANSITION(
+ SkylarkSemantics::experimentalStarlarkConfigTransitions),
INCOMPATIBLE_DISABLE_OBJC_PROVIDER_RESOURCES(
SkylarkSemantics::incompatibleDisableObjcProviderResources),
INCOMPATIBLE_NO_OUTPUT_ATTR_DEFAULT(SkylarkSemantics::incompatibleNoOutputAttrDefault),