Skip to content

Commit

Permalink
Do not allow applicable_licenses on platform.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
aiuto authored and comius committed Sep 6, 2023
1 parent ad813e2 commit 633d449
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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")
Expand Down

0 comments on commit 633d449

Please sign in to comment.