Skip to content

Commit

Permalink
Make the name of the remote strategy overrideable, for internal reasons.
Browse files Browse the repository at this point in the history
Necessary for flipping `--internal_spawn_scheduler` to true.

PiperOrigin-RevId: 529131895
Change-Id: I081414c9507981d5f66cae9c82865b8ee14a7ef8
  • Loading branch information
larsrc-google authored and copybara-github committed May 3, 2023
1 parent c0e7d04 commit d81ef2d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import com.google.devtools.build.lib.util.DetailedExitCode;
import com.google.devtools.build.lib.util.io.FileOutErr;
import com.google.devtools.common.options.OptionsBase;
import com.google.errorprone.annotations.ForOverride;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -120,10 +121,15 @@ private ImmutableMap<String, List<String>> getRemoteStrategies(DynamicExecutionO
strategies.put(e.getKey(), e.getValue());
}
return options.dynamicRemoteStrategy.isEmpty()
? ImmutableMap.of("", ImmutableList.of("remote"))
? ImmutableMap.of("", ImmutableList.of(remoteStrategyName()))
: ImmutableMap.copyOf(strategies);
}

@ForOverride
protected String remoteStrategyName() {
return "remote";
}

@Override
public void registerSpawnStrategies(
SpawnStrategyRegistry.Builder registryBuilder, CommandEnvironment env)
Expand Down

0 comments on commit d81ef2d

Please sign in to comment.