Skip to content

remote_download_minimal: downloaded inputs shouldn't be deleted after the build #12855

@brentleyjones

Description

@brentleyjones

Description of the problem / feature request:

When using --remote_download_minimal, downloaded inputs shouldn't be deleted after the build.

Feature requests: what underlying problem are you trying to solve with this feature?

Currently, when bazel needs to download inputs for a locally run action while using --remote_download_minimal, it deletes these inputs after the build:

/**
* Delete any input files that have been fetched from the remote cache during the build. This is
* so that Bazel's view of the output base is identical with the output base after a build i.e.
* files that Bazel thinks exist only remotely actually do.
*/
private void deleteDownloadedInputs() throws IOException {
if (actionInputFetcher == null) {
return;
}
IOException deletionFailure = null;
for (Path file : actionInputFetcher.downloadedFiles()) {
try {
file.delete();
} catch (IOException e) {
logger.atSevere().withCause(e).log(
"Failed to delete remote output '%s' from the output base.", file);
deletionFailure = e;
}
}
if (deletionFailure != null) {
throw deletionFailure;
}
}

This makes incremental compilation less efficient.

For example, if we set a bundling rule to run locally, bazel will download all of the various artifacts that need to be bundled together, and if we incrementally only change a single artifact in that bundle, bazel will have to re-download all of the artifacts, even though they didn't change since the last build. The fact that disk_cache doesn't work with remote builds ensure that this is a slow download as well.

What operating system are you running Bazel on?

macOS 10.15.7

What's the output of bazel info release?

release 4.0.0rc10

Have you found anything relevant by searching the web?

Metadata

Metadata

Assignees

Labels

P2We'll consider working on this in future. (Assignee optional)team-Remote-ExecIssues and PRs for the Execution (Remote) teamtype: feature request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions