Skip to content

Commit 1772d65

Browse files
committed
Ignore the default when local repository_cache is used.
1 parent a288067 commit 1772d65

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

src/test/java/com/google/devtools/build/lib/blackbox/bazel/DefaultToolsSetup.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ public void setup(BlackBoxTestContext context) throws IOException {
7878
String sharedRepoCache = System.getenv("REPOSITORY_CACHE");
7979
if (sharedRepoCache != null) {
8080
lines.add("common --repository_cache=" + sharedRepoCache);
81+
// TODO(sluongng): Remove this flag once all dependencies are mirrored.
82+
// See https://github.com/bazelbuild/bazel/pull/19549 for more context.
83+
lines.add("common --norepository_cache_urls_as_default_canonical_id");
8184
if (OS.getCurrent() == OS.DARWIN) {
8285
// For reducing SSD usage on our physical Mac machines.
8386
lines.add("common --experimental_repository_cache_hardlinks");

src/test/py/bazel/test_base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ def setUp(self):
127127
shared_repo_cache = os.environ.get('REPOSITORY_CACHE')
128128
if shared_repo_cache:
129129
f.write('common --repository_cache={}\n'.format(shared_repo_cache))
130+
# TODO(sluongng): Remove this flag once all dependencies are mirrored.
131+
# See https://github.com/bazelbuild/bazel/pull/19549 for more context.
132+
f.write('common --norepository_cache_urls_as_default_canonical_id\n')
130133
if TestBase.IsDarwin():
131134
# For reducing SSD usage on our physical Mac machines.
132135
f.write('common --experimental_repository_cache_hardlinks\n')

src/test/shell/bazel/bazel_bootstrap_distfile_test.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,13 @@ function test_bootstrap() {
102102

103103
JAVABASE=$(echo reduced*)
104104

105+
# TODO: remove `norepository_cache_urls_as_default_canonical_id` once all dependencies are mirrored.
106+
# See https://github.com/bazelbuild/bazel/pull/19549 for more context.
105107
env EXTRA_BAZEL_ARGS="--tool_java_runtime_version=local_jdk" ./compile.sh \
106108
|| fail "Expected to be able to bootstrap bazel"
107109
./output/bazel \
108110
--server_javabase=$JAVABASE --host_jvm_args=--add-opens=java.base/java.nio=ALL-UNNAMED \
111+
--norepository_cache_urls_as_default_canonical_id \
109112
version --nognu_format &> "${TEST_log}" \
110113
|| fail "Generated bazel not working"
111114
expect_log "${SOURCE_DATE_EPOCH}"

src/test/shell/testenv.sh.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ EOF
324324
if [[ -n ${REPOSITORY_CACHE:-} ]]; then
325325
echo "testenv.sh: Using repository cache at $REPOSITORY_CACHE."
326326
echo "common --repository_cache=$REPOSITORY_CACHE" >> $TEST_TMPDIR/bazelrc
327+
# TODO(sluongng): Remove this flag once all dependencies are mirrored.
328+
# See https://github.com/bazelbuild/bazel/pull/19549 for more context.
329+
echo "common --norepository_cache_urls_as_default_canonical_id" >> $TEST_TMPDIR/bazelrc
327330
if is_darwin; then
328331
# For reducing SSD usage on our physical Mac machines.
329332
echo "testenv.sh: Enabling --experimental_repository_cache_hardlinks"

0 commit comments

Comments
 (0)