Skip to content

Commit

Permalink
Enable --experimental_sibling_repository_layout (#1128)
Browse files Browse the repository at this point in the history
  • Loading branch information
jin authored May 8, 2024
1 parent 09c6568 commit b6631f9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ build --tool_java_runtime_version=remotejdk_11
build --experimental_strict_java_deps=strict
build --explicit_java_test_deps

build --experimental_sibling_repository_layout

# Make sure we get something helpful when tests fail
test --verbose_failures
test --test_output=errors
Expand Down
8 changes: 6 additions & 2 deletions private/pin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \

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

cp "$maven_unsorted_file" "$maven_install_json_loc"
Expand Down
6 changes: 1 addition & 5 deletions private/rules/coursier.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ sh_binary(
name = "pin",
srcs = ["pin.sh"],
args = [
# TODO: change to rlocationpath once rules_jvm_external drops support for Bazel <5.4.0
# "$(rlocationpath :unsorted_deps.json)",
# We can use execpath in the meantime, because we know this file is always a source file
# in that external repo.
"$(execpath :unsorted_deps.json)",
"$(rlocationpath :unsorted_deps.json)",
],
data = [
":unsorted_deps.json",
Expand Down

0 comments on commit b6631f9

Please sign in to comment.