Skip to content

Commit 1f10baa

Browse files
committed
Remove the obsolete exec_tools attribute from genrule.
DO NOT SUBMIT. Part of bazelbuild#19132.
1 parent ef9c3b3 commit 1f10baa

File tree

4 files changed

+0
-50
lines changed

4 files changed

+0
-50
lines changed

src/main/java/com/google/devtools/build/lib/bazel/BazelConfiguration.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,10 @@ public static class Options extends FragmentOptions {
4040
help = "If enabled, visibility checking also applies to toolchain implementations.")
4141
public boolean checkVisibilityForToolchains;
4242

43-
@Option(
44-
name = "incompatible_remove_exec_tools",
45-
defaultValue = "false",
46-
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
47-
effectTags = {OptionEffectTag.BUILD_FILE_SEMANTICS},
48-
metadataTags = {OptionMetadataTag.INCOMPATIBLE_CHANGE},
49-
help = "If enabled, use of genrule's exec_tools attribute will cause an error..")
50-
public boolean removeExecTools;
51-
5243
@Override
5344
public FragmentOptions getExec() {
5445
Options exec = (Options) getDefault();
5546
exec.checkVisibilityForToolchains = checkVisibilityForToolchains;
56-
exec.removeExecTools = removeExecTools;
5747

5848
return exec;
5949
}

src/main/java/com/google/devtools/build/lib/bazel/rules/genrule/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ java_library(
1818
"//src/main/java/com/google/devtools/build/lib/analysis:analysis_cluster",
1919
"//src/main/java/com/google/devtools/build/lib/analysis:config/execution_transition_factory",
2020
"//src/main/java/com/google/devtools/build/lib/analysis:rule_definition_environment",
21-
"//src/main/java/com/google/devtools/build/lib/bazel:bazel_configuration",
2221
"//src/main/java/com/google/devtools/build/lib/packages",
2322
"//src/main/java/com/google/devtools/build/lib/rules/genrule",
2423
"//src/main/java/com/google/devtools/build/lib/util:filetype",

src/main/java/com/google/devtools/build/lib/bazel/rules/genrule/BazelGenRule.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
import com.google.devtools.build.lib.analysis.CommandHelper;
1818
import com.google.devtools.build.lib.analysis.RuleContext;
19-
import com.google.devtools.build.lib.bazel.BazelConfiguration;
20-
import com.google.devtools.build.lib.packages.BuildType;
2119
import com.google.devtools.build.lib.packages.Type;
2220
import com.google.devtools.build.lib.rules.genrule.GenRuleBase;
2321

@@ -33,24 +31,4 @@ protected boolean isStampingEnabled(RuleContext ruleContext) {
3331
}
3432
return ruleContext.attributes().get("stamp", Type.BOOLEAN);
3533
}
36-
37-
// TODO(https://github.com/bazelbuild/bazel/issues/19132): Remove this override once downstream
38-
// projects are migrated.
39-
@Override
40-
protected CommandHelper.Builder commandHelperBuilder(RuleContext ruleContext) {
41-
BazelConfiguration.Options bazelOptions =
42-
ruleContext.getConfiguration().getOptions().get(BazelConfiguration.Options.class);
43-
44-
if (bazelOptions.removeExecTools
45-
&& ruleContext.attributes().has("exec_tools", BuildType.LABEL_LIST)
46-
&& !ruleContext.attributes().get("exec_tools", BuildType.LABEL_LIST).isEmpty()) {
47-
ruleContext.attributeError(
48-
"exec_tools", "genrule.exec_tools has been removed, use tools instead");
49-
}
50-
51-
return CommandHelper.builder(ruleContext)
52-
.addToolDependencies("tools")
53-
.addToolDependencies("exec_tools")
54-
.addToolDependencies("toolchains");
55-
}
5634
}

src/main/java/com/google/devtools/build/lib/bazel/rules/genrule/BazelGenRuleRule.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,6 @@ public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env)
4646
.cfg(ExecutionTransitionFactory.createFactory())
4747
.value(env.getToolsLabel(GENRULE_SETUP_LABEL)))
4848

49-
// TODO(https://github.com/bazelbuild/bazel/issues/19132): Remove this once downstream
50-
// projects are migrated.
51-
/* <!-- #BLAZE_RULE(genrule).ATTRIBUTE(exec_tools) -->
52-
<b>Deprecated. Use <a href="#genrule.tools"><code>tools</code></a> instead.</b>
53-
54-
<p>
55-
There was a period of time when <code>exec_tools</code> and <code>tools</code> behaved
56-
differently, but they are now equivalent and the Blaze team will be migrating all uses of
57-
<code>exec_tools</code> to <code>tools</code>.
58-
</p>
59-
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
60-
.add(
61-
attr("exec_tools", LABEL_LIST)
62-
.cfg(ExecutionTransitionFactory.createFactory())
63-
.allowedFileTypes(FileTypeSet.ANY_FILE)
64-
.dontCheckConstraints())
65-
6649
// TODO(bazel-team): stamping doesn't seem to work. Fix it or remove attribute.
6750
.add(attr("stamp", BOOLEAN).value(false))
6851
.build();

0 commit comments

Comments
 (0)