Skip to content

Commit

Permalink
Cleanup remote_download_output opts
Browse files Browse the repository at this point in the history
Summary:
Using `--remote_download_toplevel` to override `--remote_download_minimal`
causes bazel to warn us since those are both expansions. Instead use `--remote_download_outputs=all`
to override when we need it.

Test Plan: All the modified scripts continue to work.

Reviewers: zasgar, michelle, jamesbartlett

Reviewed By: jamesbartlett

Signed-off-by: Vihang Mehta <vihang@pixielabs.ai>

Differential Revision: https://phab.corp.pixielabs.ai/D11655

GitOrigin-RevId: ba48598
  • Loading branch information
vihangm authored and copybaranaut committed Jun 22, 2022
1 parent b12f6a4 commit 6963a93
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build --host_action_env=CLANG_COMPILER_VERSION=14.0_0

build --remote_download_minimal
test --remote_download_minimal
run --remote_download_toplevel
run --remote_download_outputs=all
coverage --build_runfile_links

build:clang --action_env=CC
Expand Down
6 changes: 0 additions & 6 deletions ci/jenkins.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ build --bes_timeout=10m
build --experimental_inmemory_dotd_files
build --experimental_inmemory_jdeps_files
build --keep_backend_build_event_connections_alive=false
# Debug what's causing this to fail in Jenkins. Some artifacts are not caching properly
# causing the build to fail because of: https://github.com/bazelbuild/bazel/issues/6862.
# build --remote_download_toplevel
build --remote_max_connections=128
build --remote_retries=2
build --remote_timeout=1h
Expand All @@ -28,9 +25,6 @@ build --remote_timeout=1h
test --bes_timeout=10m
test --experimental_inmemory_dotd_files
test --experimental_inmemory_jdeps_files
# Debug what's causing this to fail in Jenkins. Some artifacts are not caching properly
# causing the build to fail because of: https://github.com/bazelbuild/bazel/issues/6862.
# test --remote_download_toplevel
test --remote_max_connections=128
test --remote_retries=2

Expand Down
2 changes: 1 addition & 1 deletion scripts/run_all_bpf_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ done
for target in "${bpf_sh_tests[@]}";
do
message "Running ${target}";
bazel build --remote_download_toplevel "${target}";
bazel build --remote_download_outputs=all "${target}";
target_executable=$(bazel cquery "${target}" --output starlark --starlark:expr "target.files.to_list()[0].path" 2>/dev/null)

env_args=()
Expand Down
2 changes: 1 addition & 1 deletion scripts/sudo_bazel_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ echo "Run args: ${run_args[*]}"
echo "Pass through env. vars: ${pass_thru_env_vars[*]}"

# Perform the build as user (not as root).
bazel build --remote_download_toplevel "${options[@]}" "$target"
bazel build --remote_download_outputs=all "${options[@]}" "$target"

target_executable=$(bazel cquery "${options[@]}" "${target}" --output starlark --starlark:expr "target.files.to_list()[0].path" 2>/dev/null)

Expand Down
6 changes: 3 additions & 3 deletions scripts/update_go_protos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ function label_to_path() {

function build() {
# Exits with message if the bazel build command goes wrong.
# Force bazel to download all targets since bazel will delete
# targets with minimal download mode. This is a bug in bazel:
# https://github.com/bazelbuild/bazel/issues/12855
# Force bazel to download all targets since the output of
# go_proto rules is a .a file and not the .pb.go which is
# an intermediate output.
if ! out=$(bazel build --remote_download_outputs=all "$@" 2>&1); then
echo "${out}"
exit 1
Expand Down
5 changes: 1 addition & 4 deletions scripts/update_ts_protos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ function label_to_path() {

function build() {
# Exits with message if the bazel build command goes wrong.
# Force bazel to download all targets since bazel will delete
# targets with minimal download mode. This is a bug in bazel:
# https://github.com/bazelbuild/bazel/issues/12855
if ! out=$(bazel build --remote_download_outputs=all "$@" 2>&1); then
if ! out=$(bazel build "$@" 2>&1); then
echo "${out}"
exit 1
fi
Expand Down

0 comments on commit 6963a93

Please sign in to comment.