Skip to content

Commit 9c03a5d

Browse files
committed
[bazel] Replace bazel sync with bazel fetch
For whatever reason they've changed `sync` to `fetch` with Bzlmod and `sync` fully crashes Bazel when hybrid mode is disabled rather than giving an error. Signed-off-by: James Wainwright <[email protected]> (cherry picked from commit c323ef3)
1 parent 320a8be commit 9c03a5d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

rules/bitstreams.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def _bitstreams_repo_impl(rctx):
7070
if result.return_code != 0:
7171
fail("Bitstream cache not initialized properly.")
7272

73-
# The bitstream repo should be evaluated with `bazel sync --configure` after
73+
# The bitstream repo should be evaluated with `bazel fetch --configure` after
7474
# every Git checkout. Once the cache is initialized, a typical invocation will
7575
# find the latest cached artifacts and map them to Bazel targets.
7676
#
@@ -124,7 +124,7 @@ bitstreams_repo = repository_rule(
124124
# This rule depends on the Git repository, but there's no ergonomic way to
125125
# encode the dependency in Bazel. Instead, indicate that the rule depends on
126126
# something outside of Bazel's dependency graph and rely on the user calling
127-
# `bazel sync --configure` when checking out new revisions. For historical
127+
# `bazel fetch --configure` when checking out new revisions. For historical
128128
# context, see <https://github.com/lowRISC/opentitan/issues/16832>.
129129
configure = True,
130130
)

util/prep-bazel-airgapped-build.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,11 @@ if [[ ${AIRGAPPED_DIR_CONTENTS} == "ALL" || \
116116
--output bazel
117117
chmod +x bazel
118118

119-
# Make Bazel sync its own dependencies to the repository cache:
119+
# Make Bazel fetch its own dependencies to the repository cache:
120120
# https://bazel.build/run/build#repository_cache_with_bazel_7_or_later
121121
mkdir -p "${BAZEL_AIRGAPPED_DIR}/empty_workspace"
122122
pushd "${BAZEL_AIRGAPPED_DIR}/empty_workspace"
123123
touch MODULE.bazel
124-
touch WORKSPACE
125124
cp "${REPO_TOP}/.bazelversion" .
126125
bazel fetch --repository_cache="${BAZEL_AIRGAPPED_DIR}/${BAZEL_CACHEDIR}"
127126
popd

0 commit comments

Comments
 (0)