Skip to content

Commit

Permalink
Make rlocation in test-setup.sh compatible with /bin/sh
Browse files Browse the repository at this point in the history
Addressing #24256 (comment)

PiperOrigin-RevId: 704624513
Change-Id: I73ec6559a7a7b2465abd2faae0e687a97ea77db9
  • Loading branch information
meteorcloudy authored and bazel-io committed Dec 10, 2024
1 parent c8217fd commit c98a283
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/test/test-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,11 @@ fi
# Redefine rlocation to notify users of its removal - it used to be exported.
# TODO: Remove this before Bazel 9.
function rlocation() {
read LINE SUB FILE < <(caller 0);
>&2 echo "ERROR: rlocation is no longer implicitly provided by Bazel's test setup, but called from $SUB in line $LINE of $FILE. Please use https://github.com/bazelbuild/rules_shell/blob/main/shell/runfiles/runfiles.bash instead."
exit 1
caller 0 | {
read LINE SUB FILE
echo >&2 "ERROR: rlocation is no longer implicitly provided by Bazel's test setup, but called from $SUB in line $LINE of $FILE. Please use https://github.com/bazelbuild/rules_shell/blob/main/shell/runfiles/runfiles.bash instead."
exit 1
}
}
export -f rlocation

Expand Down

0 comments on commit c98a283

Please sign in to comment.