Skip to content

Commit

Permalink
RemoteOptions: flip remote_use_output_paths
Browse files Browse the repository at this point in the history
  • Loading branch information
sluongng committed Sep 11, 2024
1 parent 1bb3bf6 commit 4602931
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -415,12 +415,12 @@ public RemoteBuildEventUploadModeConverter() {

@Option(
name = "incompatible_remote_use_output_paths",
defaultValue = "false",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.REMOTE,
effectTags = {OptionEffectTag.UNKNOWN},
help =
"If enabled, check if the remote server(s) support remote execution API v2.1 or newer."
+ "If yes, use the newer Command.output_paths field. Default is false.")
+ "If yes, use the newer Command.output_paths field. Default is true.")
public boolean useOutputPaths;

@Option(
Expand Down
18 changes: 8 additions & 10 deletions src/test/shell/bazel/remote/remote_execution_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ source "$(rlocation "io_bazel/src/test/shell/bazel/remote/remote_utils.sh")" \
|| { echo "remote_utils.sh not found!" >&2; exit 1; }

function set_up() {
start_worker --legacy_api
start_worker
}

function tear_down() {
Expand Down Expand Up @@ -91,7 +91,7 @@ function setup_credential_helper_test() {
EOF

stop_worker
start_worker --legacy_api --expected_authorization_token=TOKEN
start_worker --expected_authorization_token=TOKEN
}

function test_credential_helper_remote_cache() {
Expand Down Expand Up @@ -179,10 +179,9 @@ function test_credential_helper_clear_cache() {
}

function test_remote_grpc_cache_with_legacy_api() {
# TODO(sluongng): Add this when we flip the default to use Remote API version 2.1.
# Test if Bazel works with Remote Cache using Remote Api version 2.0.
# stop_worker
# start_worker --legacy_api
stop_worker
start_worker --legacy_api

mkdir -p a
cat > a/BUILD <<EOF
Expand All @@ -200,10 +199,9 @@ EOF
}

function test_remote_executor_with_legacy_api() {
# TODO(sluongng): Add this when we flip the default to use Remote API version 2.1.
# Test if Bazel works with Remote Executor using Remote Api version 2.0.
# stop_worker
# start_worker --legacy_api
stop_worker
start_worker --legacy_api

mkdir -p a
cat > a/BUILD <<EOF
Expand Down Expand Up @@ -1536,7 +1534,7 @@ EOF
# for FindMissingBLobs, the remote exec can still find it from the remote cache.

stop_worker
start_worker --legacy_api
start_worker
# need to reset flags after restarting worker [on new port]
local grpc_flags="--remote_cache=grpc://localhost:${worker_port}"
local remote_exec_flags="--remote_executor=grpc://localhost:${worker_port}"
Expand All @@ -1560,7 +1558,7 @@ EOF
# We should get one cache hit from disk and and one remote exec.

stop_worker
start_worker --legacy_api
start_worker
# reset port
local grpc_flags="--remote_cache=grpc://localhost:${worker_port}"
local remote_exec_flags="--remote_executor=grpc://localhost:${worker_port}"
Expand Down

0 comments on commit 4602931

Please sign in to comment.