From 633d4496c287ccdf2f181846dd6dfc06b7767ff7 Mon Sep 17 00:00:00 2001 From: Googler Date: Fri, 5 May 2023 14:00:14 -0700 Subject: [PATCH] Do not allow applicable_licenses on platform. RELNOTES: `applicable_licenses` is no longer allowed on the `platform` rule. Additionally, `default_package_metadata` from any `package` rule will not be applied. PiperOrigin-RevId: 529808047 Change-Id: I7c2c682055bde6924d68858d38ef63f32457cdb9 --- .../build/lib/rules/platform/PlatformBaseRule.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/rules/platform/PlatformBaseRule.java b/src/main/java/com/google/devtools/build/lib/rules/platform/PlatformBaseRule.java index cabc5774a25745..70ca5848e2352b 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/platform/PlatformBaseRule.java +++ b/src/main/java/com/google/devtools/build/lib/rules/platform/PlatformBaseRule.java @@ -21,7 +21,6 @@ import com.google.devtools.build.lib.analysis.PlatformConfiguration; import com.google.devtools.build.lib.analysis.RuleDefinition; import com.google.devtools.build.lib.analysis.RuleDefinitionEnvironment; -import com.google.devtools.build.lib.packages.BuildType; import com.google.devtools.build.lib.packages.RuleClass; import com.google.devtools.build.lib.packages.RuleClass.ToolchainResolutionMode; import com.google.devtools.build.lib.packages.Type; @@ -42,13 +41,7 @@ public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env) // No need to show up in ":all", etc. target patterns. .value(ImmutableList.of("manual")) .nonconfigurable("low-level attribute, used in platform configuration")) - .override( - // A platform is essentially a constant which is never linked into a target. - // This will, in a very hacky way, suppress picking up default_applicable_licenses - attr("applicable_licenses", BuildType.LABEL_LIST) - .value(ImmutableList.of()) - .allowedFileTypes() - .nonconfigurable("fundamental constant, used in platform configuration")) + .removeAttribute("applicable_licenses") .exemptFromConstraintChecking("this rule helps *define* a constraint") .useToolchainResolution(ToolchainResolutionMode.DISABLED) .removeAttribute("deps")