Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Platform on Action not just Command #13134

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public ExecutionResult execute(
MerkleTree merkleTree = MerkleTree.build(inputFiles, digestUtil);
Action action =
RemoteSpawnRunner.buildAction(
commandHash, merkleTree.getRootDigest(), timeout, acceptCached);
commandHash, merkleTree.getRootDigest(), platform, timeout, acceptCached);
Digest actionDigest = digestUtil.compute(action);
ActionKey actionKey = new ActionKey(actionDigest);
ActionResult actionResult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public CacheHandle lookup(Spawn spawn, SpawnExecutionContext context)
RemoteOutputsMode remoteOutputsMode = options.remoteOutputsMode;
Action action =
RemoteSpawnRunner.buildAction(
digestUtil.compute(command), merkleTreeRoot, context.getTimeout(), true);
digestUtil.compute(command), merkleTreeRoot, platform, context.getTimeout(), true);
// Look up action cache, and reuse the action output if it is found.
ActionKey actionKey = digestUtil.computeActionKey(action);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public SpawnResult exec(Spawn spawn, SpawnExecutionContext context)
Digest commandHash = digestUtil.compute(command);
Action action =
buildAction(
commandHash, merkleTree.getRootDigest(), context.getTimeout(), spawnCacheableRemotely);
commandHash, merkleTree.getRootDigest(), platform, context.getTimeout(), spawnCacheableRemotely);

spawnMetrics.setParseTime(totalTime.elapsed());

Expand Down Expand Up @@ -695,7 +695,7 @@ private SpawnResult handleError(
.build();
}

static Action buildAction(Digest command, Digest inputRoot, Duration timeout, boolean cacheable) {
static Action buildAction(Digest command, Digest inputRoot, @Nullable Platform platform, Duration timeout, boolean cacheable) {

Action.Builder action = Action.newBuilder();
action.setCommandDigest(command);
Expand All @@ -706,6 +706,9 @@ static Action buildAction(Digest command, Digest inputRoot, Duration timeout, bo
if (!cacheable) {
action.setDoNotCache(true);
}
if (platform != null) {
action.setPlatform(platform);
}
return action.build();
}

Expand Down