Skip to content

Commit

Permalink
Remove unused ExtraActionInfoSupplier from SpawnAction.
Browse files Browse the repository at this point in the history
It's always null. Extra actions were deprecated in favor of aspects, which may explain the obsolete field.

PiperOrigin-RevId: 525145135
Change-Id: Id1924b40eb003fa4e617b7aa6bd8388341a5938c
  • Loading branch information
justinhorvitz authored and fweikert committed May 25, 2023
1 parent 248dbac commit 5541146
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<ImmutableSortedMap<String, String>> executionInfoInterner =
Expand All @@ -117,8 +112,6 @@ public interface ExtraActionInfoSupplier {

private final ResourceSetOrBuilder resourceSetOrBuilder;
private final ImmutableMap<String, String> executionInfo;

private final ExtraActionInfoSupplier extraActionInfoSupplier;
private final Consumer<Pair<ActionExecutionContext, List<SpawnResult>>> resultConsumer;
private final boolean stripOutputPaths;

Expand Down Expand Up @@ -165,7 +158,6 @@ public SpawnAction(
EmptyRunfilesSupplier.INSTANCE,
mnemonic,
null,
null,
/* stripOutputPaths= */ false);
}

Expand Down Expand Up @@ -203,7 +195,6 @@ public SpawnAction(
CharSequence progressMessage,
RunfilesSupplier runfilesSupplier,
String mnemonic,
ExtraActionInfoSupplier extraActionInfoSupplier,
Consumer<Pair<ActionExecutionContext, List<SpawnResult>>> resultConsumer,
boolean stripOutputPaths) {
super(owner, tools, inputs, runfilesSupplier, outputs, env);
Expand All @@ -216,7 +207,6 @@ public SpawnAction(
this.commandLineLimits = commandLineLimits;
this.progressMessage = progressMessage;
this.mnemonic = mnemonic;
this.extraActionInfoSupplier = extraActionInfoSupplier;
this.resultConsumer = resultConsumer;
this.stripOutputPaths = stripOutputPaths;
}
Expand Down Expand Up @@ -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());
}

/**
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -811,7 +793,6 @@ protected SpawnAction createSpawnAction(
progressMessage,
runfilesSupplier,
mnemonic,
extraActionInfoSupplier,
resultConsumer,
stripOutputPaths);
}
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ private StarlarkAction(
progressMessage,
runfilesSupplier,
mnemonic,
/* extraActionInfoSupplier */ null,
/* resultConsumer */ null,
/* resultConsumer= */ null,
stripOutputPaths);

this.allStarlarkActionInputs = inputs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,6 @@ private static final class InstallAction extends SpawnAction {
progressMessage,
runfilesSupplier,
mnemonic,
/* extraActionInfoSupplier= */ null,
/* resultConsumer= */ null,
/* stripOutputPaths= */ false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ public LtoBackendAction(
runfilesSupplier,
mnemonic,
null,
null,
/*stripOutputPaths=*/ false);
mandatoryInputs = inputs;
Preconditions.checkState(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public GenRuleAction(
runfilesSupplier,
MNEMONIC,
null,
null,
/*stripOutputPaths=*/ false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5541146

Please sign in to comment.