Skip to content

Commit b6631f9

Browse files
authored
Enable --experimental_sibling_repository_layout (#1128)
1 parent 09c6568 commit b6631f9

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

.bazelrc

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ build --tool_java_runtime_version=remotejdk_11
77
build --experimental_strict_java_deps=strict
88
build --explicit_java_test_deps
99

10+
build --experimental_sibling_repository_layout
11+
1012
# Make sure we get something helpful when tests fail
1113
test --verbose_failures
1214
test --test_output=errors

private/pin.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
1313

1414
set -euo pipefail
1515
# Workaround lack of rlocationpath, see comment on _BUILD_PIN in coursier.bzl
16-
readonly maven_unsorted_file=$(rlocation "${1#external\/}")
17-
if [[ ! -e $maven_unsorted_file ]]; then (echo >&2 "Failed to locate $1 in runfiles" && exit 1) fi
16+
maven_unsorted_file=$(rlocation "${1#external\/}")
17+
if [[ ! -e $maven_unsorted_file ]]; then
18+
# for --experimental_sibling_repository_layout
19+
maven_unsorted_file="${1#..\/}"
20+
fi
21+
if [[ ! -e $maven_unsorted_file ]]; then (echo >&2 "Failed to locate the unsorted_deps.json file: $1" && exit 1) fi
1822
readonly maven_install_json_loc={maven_install_location}
1923

2024
cp "$maven_unsorted_file" "$maven_install_json_loc"

private/rules/coursier.bzl

+1-5
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,7 @@ sh_binary(
6565
name = "pin",
6666
srcs = ["pin.sh"],
6767
args = [
68-
# TODO: change to rlocationpath once rules_jvm_external drops support for Bazel <5.4.0
69-
# "$(rlocationpath :unsorted_deps.json)",
70-
# We can use execpath in the meantime, because we know this file is always a source file
71-
# in that external repo.
72-
"$(execpath :unsorted_deps.json)",
68+
"$(rlocationpath :unsorted_deps.json)",
7369
],
7470
data = [
7571
":unsorted_deps.json",

0 commit comments

Comments
 (0)