From 9c96529fca4a135c162e35ce2882834b879438fb Mon Sep 17 00:00:00 2001 From: Googler Date: Mon, 26 Jun 2023 06:14:18 -0700 Subject: [PATCH] Build without the bytes by default by changing the default value of `--remote_download_outputs` to `toplevel`. PiperOrigin-RevId: 543417930 Change-Id: Ibd4a79bc17a395028eb9c8b230968ff0935319d9 --- .../devtools/build/lib/remote/options/RemoteOptions.java | 2 +- .../build/lib/remote/DiskCacheIntegrationTest.java | 3 ++- src/test/shell/bazel/remote/remote_execution_test.sh | 8 ++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/remote/options/RemoteOptions.java b/src/main/java/com/google/devtools/build/lib/remote/options/RemoteOptions.java index 39f31ccafac4d8..6f3fe9176b957f 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/options/RemoteOptions.java +++ b/src/main/java/com/google/devtools/build/lib/remote/options/RemoteOptions.java @@ -439,7 +439,7 @@ public RemoteBuildEventUploadModeConverter() { @Option( name = "remote_download_outputs", oldName = "experimental_remote_download_outputs", - defaultValue = "all", + defaultValue = "toplevel", category = "remote", documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS, effectTags = {OptionEffectTag.AFFECTS_OUTPUTS}, diff --git a/src/test/java/com/google/devtools/build/lib/remote/DiskCacheIntegrationTest.java b/src/test/java/com/google/devtools/build/lib/remote/DiskCacheIntegrationTest.java index 5c6bf046b48529..9cfee8b1ffeebf 100644 --- a/src/test/java/com/google/devtools/build/lib/remote/DiskCacheIntegrationTest.java +++ b/src/test/java/com/google/devtools/build/lib/remote/DiskCacheIntegrationTest.java @@ -205,7 +205,8 @@ private void doRemoteExecWithDiskCache(String... additionalOptions) throws Excep @Test public void remoteExecWithDiskCache_hitDiskCache() throws Exception { - doRemoteExecWithDiskCache(); + // Download all outputs to populate the disk cache. + doRemoteExecWithDiskCache("--remote_download_all"); // Assert: Should hit the disk cache events.assertContainsInfo("2 disk cache hit"); diff --git a/src/test/shell/bazel/remote/remote_execution_test.sh b/src/test/shell/bazel/remote/remote_execution_test.sh index ad1044f80c9d6a..88c0682ad14dda 100755 --- a/src/test/shell/bazel/remote/remote_execution_test.sh +++ b/src/test/shell/bazel/remote/remote_execution_test.sh @@ -928,10 +928,13 @@ EOF function test_symlinks_in_directory() { set_symlinks_in_directory_testfixtures + # Need --remote_download_all because the genrule generates directory output + # for one of the declared outputs which is not supported when BwoB. bazel build \ --incompatible_remote_symlinks \ --noincompatible_remote_disallow_symlink_in_tree_artifact \ --remote_executor=grpc://localhost:${worker_port} \ + --remote_download_all \ --spawn_strategy=remote \ //:make-links &> $TEST_log \ || fail "Failed to build //:make-links with remote execution" @@ -948,11 +951,15 @@ function test_symlinks_in_directory() { function test_symlinks_in_directory_cache_only() { # This test is the same as test_symlinks_in_directory, except it works # locally and uses the remote cache to query results. + # + # Need --remote_download_all because the genrule generates directory output + # for one of the declared outputs which is not supported when BwoB. set_symlinks_in_directory_testfixtures bazel build \ --incompatible_remote_symlinks \ --noincompatible_remote_disallow_symlink_in_tree_artifact \ --remote_cache=grpc://localhost:${worker_port} \ + --remote_download_all \ --spawn_strategy=local \ //:make-links &> $TEST_log \ || fail "Failed to build //:make-links with remote cache service" @@ -962,6 +969,7 @@ function test_symlinks_in_directory_cache_only() { --incompatible_remote_symlinks \ --noincompatible_remote_disallow_symlink_in_tree_artifact \ --remote_cache=grpc://localhost:${worker_port} \ + --remote_download_all \ --spawn_strategy=local \ //:make-links &> $TEST_log \ || fail "Failed to build //:make-links with remote cache service"