Skip to content

Commit

Permalink
Remote: Make --incompatible_remote_build_event_upload_respect_no_cach…
Browse files Browse the repository at this point in the history
…e working with --incompatible_remote_results_ignore_disk.
  • Loading branch information
coeuvre committed Dec 22, 2021
1 parent 1c95255 commit bcfcad7
Show file tree
Hide file tree
Showing 3 changed files with 3,447 additions and 3,423 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,19 +356,6 @@ public boolean shouldAcceptCachedResult(Spawn spawn) {
}
}

public static boolean shouldUploadLocalResults(
RemoteOptions remoteOptions, Map<String, String> executionInfo) {
if (useRemoteCache(remoteOptions)) {
if (useDiskCache(remoteOptions)) {
return shouldUploadLocalResultsToCombinedDisk(remoteOptions, executionInfo);
} else {
return shouldUploadLocalResultsToRemoteCache(remoteOptions, executionInfo);
}
} else {
return shouldUploadLocalResultsToDiskCache(remoteOptions, executionInfo);
}
}

/**
* Returns {@code true} if the local results of the {@code spawn} should be uploaded to remote
* cache.
Expand All @@ -378,7 +365,15 @@ public boolean shouldUploadLocalResults(Spawn spawn) {
return false;
}

return shouldUploadLocalResults(remoteOptions, spawn.getExecutionInfo());
if (useRemoteCache(remoteOptions)) {
if (useDiskCache(remoteOptions)) {
return shouldUploadLocalResultsToCombinedDisk(remoteOptions, spawn);
} else {
return shouldUploadLocalResultsToRemoteCache(remoteOptions, spawn);
}
} else {
return shouldUploadLocalResultsToDiskCache(remoteOptions, spawn);
}
}

/** Returns {@code true} if the spawn may be executed remotely. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -763,8 +763,7 @@ private void parseNoCacheOutputs(AnalysisResult analysisResult) {
RuleConfiguredTarget ruleConfiguredTarget = (RuleConfiguredTarget) configuredTarget;
for (ActionAnalysisMetadata action : ruleConfiguredTarget.getActions()) {
boolean uploadLocalResults =
RemoteExecutionService.shouldUploadLocalResults(
remoteOptions, action.getExecutionInfo());
Utils.shouldUploadLocalResultsToRemoteCache(remoteOptions, action.getExecutionInfo());
if (!uploadLocalResults) {
for (Artifact output : action.getOutputs()) {
if (output.isTreeArtifact()) {
Expand Down
Loading

0 comments on commit bcfcad7

Please sign in to comment.