Skip to content

Commit

Permalink
ci: simplify bazel fetch
Browse files Browse the repository at this point in the history
Fixes: googleapis#6140

We only need to `bazel fetch ...`, which should get everything we need
for a `bazel build ...`. The extra packages that we previously had
listed were either redundant, or unnecessary, for example, a `bazel
build ...` never downloaded (or needed) `@go_sdk//...` in my local
experiments.
  • Loading branch information
devjgm committed Aug 13, 2021
1 parent a6329c1 commit 6f28a85
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions ci/cloudbuild/builds/lib/bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,13 @@ io::log "Using bazelisk version"
bazelisk version

io::log "Prefetching bazel deps..."
# Bazel downloads all the dependencies of a project, as well as a number of
# development tools during startup. In automated builds these downloads fail
# from time to time due to transient network problems. Running `bazel fetch` at
# the beginning of the build prevents such transient failures from flaking the
# build.
# Prefetch all of the external dependencies that bazel will need. In automated
# builds these downloads fail from time to time due to transient network
# problems. Running `bazel fetch ...` at the beginning of the build prevents
# such transient failures from flaking the build.
TIMEFORMAT="==> 🕑 prefetching done in %R seconds"
time {
"ci/retry-command.sh" 3 120 bazel fetch ... \
@local_config_platform//... \
@local_config_cc_toolchains//... \
@local_config_sh//... \
@go_sdk//... \
@remotejdk11_linux//:jdk
"ci/retry-command.sh" 3 120 bazel fetch ...
}
echo >&2

Expand Down

0 comments on commit 6f28a85

Please sign in to comment.