From 5541146892eefaa70d8911587500284a90dbe68b Mon Sep 17 00:00:00 2001 From: Googler Date: Tue, 18 Apr 2023 07:49:24 -0700 Subject: [PATCH] Remove unused `ExtraActionInfoSupplier` from `SpawnAction`. It's always null. Extra actions were deprecated in favor of aspects, which may explain the obsolete field. PiperOrigin-RevId: 525145135 Change-Id: Id1924b40eb003fa4e617b7aa6bd8388341a5938c --- .../lib/analysis/actions/SpawnAction.java | 29 ++----------------- .../lib/analysis/actions/StarlarkAction.java | 3 +- .../build/lib/analysis/extra/ExtraAction.java | 1 - .../android/AndroidBinaryMobileInstall.java | 1 - .../build/lib/rules/cpp/LtoBackendAction.java | 1 - .../lib/rules/genrule/GenRuleAction.java | 1 - .../java/JavaHeaderCompileActionBuilder.java | 1 - 7 files changed, 3 insertions(+), 34 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java b/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java index 8c728065b8cc3d..97877178ade52b 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java @@ -99,11 +99,6 @@ /** An Action representing an arbitrary subprocess to be forked and exec'd. */ public class SpawnAction extends AbstractAction implements CommandAction { - /** Sets extensions on {@link ExtraActionInfo}. */ - public interface ExtraActionInfoSupplier { - void extend(ExtraActionInfo.Builder builder); - } - private static final String GUID = "ebd6fce3-093e-45ee-adb6-bf513b602f0d"; private static final Interner> executionInfoInterner = @@ -117,8 +112,6 @@ public interface ExtraActionInfoSupplier { private final ResourceSetOrBuilder resourceSetOrBuilder; private final ImmutableMap executionInfo; - - private final ExtraActionInfoSupplier extraActionInfoSupplier; private final Consumer>> resultConsumer; private final boolean stripOutputPaths; @@ -165,7 +158,6 @@ public SpawnAction( EmptyRunfilesSupplier.INSTANCE, mnemonic, null, - null, /* stripOutputPaths= */ false); } @@ -203,7 +195,6 @@ public SpawnAction( CharSequence progressMessage, RunfilesSupplier runfilesSupplier, String mnemonic, - ExtraActionInfoSupplier extraActionInfoSupplier, Consumer>> resultConsumer, boolean stripOutputPaths) { super(owner, tools, inputs, runfilesSupplier, outputs, env); @@ -216,7 +207,6 @@ public SpawnAction( this.commandLineLimits = commandLineLimits; this.progressMessage = progressMessage; this.mnemonic = mnemonic; - this.extraActionInfoSupplier = extraActionInfoSupplier; this.resultConsumer = resultConsumer; this.stripOutputPaths = stripOutputPaths; } @@ -485,15 +475,8 @@ protected String getRawProgressMessage() { @Override public ExtraActionInfo.Builder getExtraActionInfo(ActionKeyContext actionKeyContext) throws CommandLineExpansionException, InterruptedException { - ExtraActionInfo.Builder builder = super.getExtraActionInfo(actionKeyContext); - if (extraActionInfoSupplier == null) { - SpawnInfo spawnInfo = getExtraActionSpawnInfo(); - return builder - .setExtension(SpawnInfo.spawnInfo, spawnInfo); - } else { - extraActionInfoSupplier.extend(builder); - return builder; - } + return super.getExtraActionInfo(actionKeyContext) + .setExtension(SpawnInfo.spawnInfo, getExtraActionSpawnInfo()); } /** @@ -643,7 +626,6 @@ public static class Builder { private CharSequence progressMessage; private String mnemonic = "Unknown"; - ExtraActionInfoSupplier extraActionInfoSupplier = null; private boolean disableSandboxing = false; private String execGroup = DEFAULT_EXEC_GROUP_NAME; @@ -811,7 +793,6 @@ protected SpawnAction createSpawnAction( progressMessage, runfilesSupplier, mnemonic, - extraActionInfoSupplier, resultConsumer, stripOutputPaths); } @@ -1333,12 +1314,6 @@ public Builder stripOutputPaths(boolean stripPaths) { return this; } - @CanIgnoreReturnValue - public Builder setExtraActionInfo(ExtraActionInfoSupplier extraActionInfoSupplier) { - this.extraActionInfoSupplier = extraActionInfoSupplier; - return this; - } - @CanIgnoreReturnValue public Builder disableSandboxing() { this.disableSandboxing = true; diff --git a/src/main/java/com/google/devtools/build/lib/analysis/actions/StarlarkAction.java b/src/main/java/com/google/devtools/build/lib/analysis/actions/StarlarkAction.java index 6104604f7888e3..6d718015896d9a 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/actions/StarlarkAction.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/actions/StarlarkAction.java @@ -130,8 +130,7 @@ private StarlarkAction( progressMessage, runfilesSupplier, mnemonic, - /* extraActionInfoSupplier */ null, - /* resultConsumer */ null, + /* resultConsumer= */ null, stripOutputPaths); this.allStarlarkActionInputs = inputs; diff --git a/src/main/java/com/google/devtools/build/lib/analysis/extra/ExtraAction.java b/src/main/java/com/google/devtools/build/lib/analysis/extra/ExtraAction.java index df9f1188c115d5..f4e0a5a14e3dd8 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/extra/ExtraAction.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/extra/ExtraAction.java @@ -83,7 +83,6 @@ public final class ExtraAction extends SpawnAction { CompositeRunfilesSupplier.of(shadowedAction.getRunfilesSupplier(), runfilesSupplier), mnemonic, null, - null, /*stripOutputPaths=*/ false); this.shadowedAction = shadowedAction; this.createDummyOutput = createDummyOutput; diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinaryMobileInstall.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinaryMobileInstall.java index d35b4468e5b704..a1215d6f2584a7 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinaryMobileInstall.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinaryMobileInstall.java @@ -527,7 +527,6 @@ private static final class InstallAction extends SpawnAction { progressMessage, runfilesSupplier, mnemonic, - /* extraActionInfoSupplier= */ null, /* resultConsumer= */ null, /* stripOutputPaths= */ false); } diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendAction.java index 82d872222e485d..a1d20637b8053e 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendAction.java @@ -102,7 +102,6 @@ public LtoBackendAction( runfilesSupplier, mnemonic, null, - null, /*stripOutputPaths=*/ false); mandatoryInputs = inputs; Preconditions.checkState( diff --git a/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleAction.java b/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleAction.java index bd0632629a060f..691449046318ad 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleAction.java @@ -63,7 +63,6 @@ public GenRuleAction( runfilesSupplier, MNEMONIC, null, - null, /*stripOutputPaths=*/ false); } diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileActionBuilder.java index c29479fc701261..939e7919435b9c 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileActionBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileActionBuilder.java @@ -447,7 +447,6 @@ public void build(JavaToolchainProvider javaToolchain) throws InterruptedExcepti /* progressMessage= */ progressMessage, /* runfilesSupplier= */ EmptyRunfilesSupplier.INSTANCE, /* mnemonic= */ "Turbine", - /* extraActionInfoSupplier= */ null, /* resultConsumer= */ resultConsumer, /* stripOutputPaths= */ stripOutputPaths)); return;