diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java index d5f9a1485a21d1..c3489dd730d98d 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java +++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java @@ -747,14 +747,6 @@ public void afterCommand() throws AbruptExitException { logger.atWarning().withCause(e).log(failureMessage); } - try { - deleteDownloadedInputs(); - } catch (IOException e) { - failure = e; - failureCode = Code.DOWNLOADED_INPUTS_DELETION_FAILURE; - failureMessage = "Failed to delete downloaded inputs"; - } - buildEventArtifactUploaderFactoryDelegate.reset(); repositoryRemoteExecutorFactoryDelegate.reset(); remoteDownloaderSupplier.set(null); @@ -768,30 +760,6 @@ public void afterCommand() throws AbruptExitException { } } - /** - * 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; - } - } - private void closeRpcLogFile() throws IOException { if (rpcLogFile != null) { AsynchronousFileOutputStream oldLogFile = rpcLogFile; diff --git a/src/test/shell/bazel/remote/remote_execution_test.sh b/src/test/shell/bazel/remote/remote_execution_test.sh index 2724c6110861ca..dce00f2b848d26 100755 --- a/src/test/shell/bazel/remote/remote_execution_test.sh +++ b/src/test/shell/bazel/remote/remote_execution_test.sh @@ -1011,8 +1011,8 @@ EOF [[ $(< ${localtxt}) == "remotelocal" ]] \ || fail "Unexpected contents in " ${localtxt} ": " $(< ${localtxt}) - (! [[ -f bazel-bin/a/remote.txt ]]) \ - || fail "Expected bazel-bin/a/remote.txt to have been deleted again" + [[ -f bazel-bin/a/remote.txt ]] \ + || fail "Expected bazel-bin/a/remote.txt to be downloaded" } function test_download_outputs_invalidation() { @@ -1105,8 +1105,8 @@ EOF [[ $(< ${outtxt}) == "Hello buchgr!" ]] \ || fail "Unexpected contents in "${outtxt}":" $(< ${outtxt}) - (! [[ -f bazel-bin/a/template.txt ]]) \ - || fail "Expected bazel-bin/a/template.txt to have been deleted again" + [[ -f bazel-bin/a/template.txt ]] \ + || fail "Expected bazel-bin/a/template.txt to be downloaded" } function test_downloads_toplevel() {