Skip to content

Commit

Permalink
Add --experimental_action_cache_store_output_metadata to the expansio…
Browse files Browse the repository at this point in the history
…n of flag --remote_download_{toplevel,minimal}.

So users don't need to add it manually.

It is always desired to use this flag along with BwoB.

Closes bazelbuild#13912.

Closes bazelbuild#16720.

PiperOrigin-RevId: 487248820
Change-Id: I94f6486a0a61522dc9000de7e9a595ace65c97e2
  • Loading branch information
coeuvre authored and copybara-github committed Nov 9, 2022
1 parent 99a8186 commit 25558ad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -473,15 +473,17 @@ public RemoteOutputsStrategyConverter() {
"--nobuild_runfile_links",
"--experimental_inmemory_jdeps_files",
"--experimental_inmemory_dotd_files",
"--experimental_action_cache_store_output_metadata",
"--remote_download_outputs=minimal"
},
category = "remote",
documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS,
effectTags = {OptionEffectTag.AFFECTS_OUTPUTS},
help =
"Does not download any remote build outputs to the local machine. This flag is a "
+ "shortcut for three flags: --experimental_inmemory_jdeps_files, "
+ "--experimental_inmemory_dotd_files and "
"Does not download any remote build outputs to the local machine. This flag is a shortcut"
+ " for flags: --experimental_inmemory_jdeps_files,"
+ " --experimental_inmemory_dotd_files,"
+ " --experimental_action_cache_store_output_metadata and "
+ "--remote_download_outputs=minimal.")
public Void remoteOutputsMinimal;

Expand All @@ -492,15 +494,17 @@ public RemoteOutputsStrategyConverter() {
expansion = {
"--experimental_inmemory_jdeps_files",
"--experimental_inmemory_dotd_files",
"--experimental_action_cache_store_output_metadata",
"--remote_download_outputs=toplevel"
},
category = "remote",
documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS,
effectTags = {OptionEffectTag.AFFECTS_OUTPUTS},
help =
"Only downloads remote outputs of top level targets to the local machine. This flag is a "
+ "shortcut for three flags: --experimental_inmemory_jdeps_files, "
+ "--experimental_inmemory_dotd_files and "
"Only downloads remote outputs of top level targets to the local machine. This flag is a"
+ " shortcut for flags: --experimental_inmemory_jdeps_files,"
+ " --experimental_inmemory_dotd_files,"
+ " --experimental_action_cache_store_output_metadata and "
+ "--remote_download_outputs=toplevel.")
public Void remoteOutputsToplevel;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ protected void setupOptions() throws Exception {
addOptions(
"--remote_executor=grpc://localhost:" + worker.getPort(),
"--remote_download_minimal",
"--experimental_action_cache_store_output_metadata",
"--dynamic_local_strategy=standalone",
"--dynamic_remote_strategy=remote");
}
Expand Down
12 changes: 0 additions & 12 deletions src/test/shell/bazel/remote/build_without_the_bytes_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ EOF

bazel build \
--experimental_ui_debug_all_events \
--experimental_action_cache_store_output_metadata \
--remote_executor=grpc://localhost:${worker_port} \
--remote_download_minimal \
//a:foobar >& $TEST_log || fail "Failed to build //a:foobar"
Expand All @@ -171,7 +170,6 @@ EOF

bazel build \
--experimental_ui_debug_all_events \
--experimental_action_cache_store_output_metadata \
--remote_executor=grpc://localhost:${worker_port} \
--remote_download_minimal \
//a:foobar >& $TEST_log || fail "Failed to build //a:foobar"
Expand Down Expand Up @@ -1173,14 +1171,6 @@ EOF
}

function test_download_toplevel_when_turn_remote_cache_off() {
download_toplevel_when_turn_remote_cache_off
}

function test_download_toplevel_when_turn_remote_cache_off_with_metadata() {
download_toplevel_when_turn_remote_cache_off --experimental_action_cache_store_output_metadata
}

function download_toplevel_when_turn_remote_cache_off() {
# Test that BwtB doesn't cause build failure if remote cache is disabled in a following build.
# See https://github.com/bazelbuild/bazel/issues/13882.

Expand Down Expand Up @@ -1215,7 +1205,6 @@ EOF
bazel build \
--remote_cache=grpc://localhost:${worker_port} \
--remote_download_toplevel \
"$@" \
//a:consumer >& $TEST_log || fail "Failed to download outputs"
[[ -f bazel-bin/a/a.txt ]] || [[ -f bazel-bin/a/b.txt ]] \
&& fail "Expected outputs of producer are not downloaded"
Expand All @@ -1224,7 +1213,6 @@ EOF
echo 'bar' > a/in.txt
bazel build \
--remote_download_toplevel \
"$@" \
//a:consumer >& $TEST_log || fail "Failed to build without remote cache"
}

Expand Down

0 comments on commit 25558ad

Please sign in to comment.