Skip to content

Commit

Permalink
Flip the default value of --experimental_remote_discard_merkle_trees …
Browse files Browse the repository at this point in the history
…to true

Closes #19941.

PiperOrigin-RevId: 576939270
Change-Id: Iafe4eb6d885e339db52ff2b496bd0a571ec6609d
  • Loading branch information
moroten authored and copybara-github committed Oct 26, 2023
1 parent ef0d71f commit 08360cc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ public RemoteOutputsStrategyConverter() {

@Option(
name = "experimental_remote_discard_merkle_trees",
defaultValue = "false",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.REMOTE,
effectTags = {OptionEffectTag.UNKNOWN},
help =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2186,6 +2186,7 @@ public void buildRemoteActionForRemotePersistentWorkers() throws Exception {
.build();
FakeSpawnExecutionContext context = newSpawnExecutionContext(spawn);
remoteOptions.markToolInputs = true;
remoteOptions.remoteDiscardMerkleTrees = false;
RemoteExecutionService service = newRemoteExecutionService(remoteOptions);

// Check that worker files are properly marked in the merkle tree.
Expand Down Expand Up @@ -2277,6 +2278,7 @@ public void buildRemoteActionWithScrubbing() throws Exception {
.setSource("some/path")
.setTarget("another/dir"))))
.build());
remoteOptions.remoteDiscardMerkleTrees = false;
RemoteExecutionService service = newRemoteExecutionService(remoteOptions);

RemoteAction remoteAction = service.buildRemoteAction(spawn, context);
Expand Down Expand Up @@ -2332,6 +2334,7 @@ public void buildRemoteActionWithPathMapping(@TestParameter boolean remoteMerkle
.setPathMapper(pathMapper)
.build();
FakeSpawnExecutionContext context = newSpawnExecutionContext(spawn);
remoteOptions.remoteDiscardMerkleTrees = false;
RemoteExecutionService service = newRemoteExecutionService(remoteOptions);

// Check that inputs and outputs of the remote action are mapped correctly.
Expand Down
12 changes: 6 additions & 6 deletions src/test/shell/bazel/remote/remote_execution_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2338,8 +2338,8 @@ function test_empty_tree_artifact_as_inputs() {
bazel build \
--spawn_strategy=remote \
--remote_executor=grpc://localhost:${worker_port} \
--experimental_remote_discard_merkle_trees \
//pkg:a &>$TEST_log || fail "expected build to succeed with Merkle tree discarding"
--experimental_remote_discard_merkle_trees=false \
//pkg:a &>$TEST_log || fail "expected build to succeed without Merkle tree discarding"

bazel clean --expunge
bazel build \
Expand Down Expand Up @@ -2419,8 +2419,8 @@ function test_create_tree_artifact_outputs() {
bazel build \
--spawn_strategy=remote \
--remote_executor=grpc://localhost:${worker_port} \
--experimental_remote_discard_merkle_trees \
//pkg:a &>$TEST_log || fail "expected build to succeed with Merkle tree discarding"
--experimental_remote_discard_merkle_trees=false \
//pkg:a &>$TEST_log || fail "expected build to succeed without Merkle tree discarding"
[[ -f bazel-bin/pkg/a/non_empty_dir/out ]] || fail "expected tree artifact to contain a file"
[[ -d bazel-bin/pkg/a/empty_dir ]] || fail "expected directory to exist"

Expand Down Expand Up @@ -3180,8 +3180,8 @@ EOF
build \
--spawn_strategy=remote \
--remote_executor=grpc://localhost:${worker_port} \
--experimental_remote_discard_merkle_trees \
//pkg:b &>$TEST_log || fail "expected build to succeed with Merkle tree discarding"
--experimental_remote_discard_merkle_trees=false \
//pkg:b &>$TEST_log || fail "expected build to succeed without Merkle tree discarding"

if [[ "$(cat bazel-bin/pkg/b.txt)" != "$link_target" ]]; then
fail "expected symlink target to be $link_target"
Expand Down

0 comments on commit 08360cc

Please sign in to comment.