Skip to content

Commit

Permalink
[6.4.0] Do not allow applicable_licenses on platform. (#19426)
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

Co-authored-by: Googler <[email protected]>
  • Loading branch information
comius and aiuto authored Sep 12, 2023
1 parent bc8bb95 commit f465abd
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 f465abd

Please sign in to comment.