Skip to content

Commit

Permalink
Include explicit dep on @bazel_tools//tools/bash/runfiles (#2299)
Browse files Browse the repository at this point in the history
  • Loading branch information
brentleyjones authored Oct 17, 2023
1 parent b68115f commit dc17c01
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions test/bazel_testrunner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@
# test_script: The name of the test script to execute inside the test
# directory.

# --- begin runfiles.bash initialization v3 ---
# Copy-pasted from the Bazel Bash runfiles library v3.
set -uo pipefail; f=bazel_tools/tools/bash/runfiles/runfiles.bash
source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \
source "$0.runfiles/$f" 2>/dev/null || \
source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
{ echo>&2 "ERROR: cannot find $f"; exit 1; }; f=;
# --- end runfiles.bash initialization v3 ---

test_script="$1"; shift

# Use the image's default Xcode version when running tests to avoid flakes
Expand Down
4 changes: 3 additions & 1 deletion test/test_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ def apple_shell_test(
"//test/testdata/provisioning:integration_testing_profiles",
"//test:unittest.bash",
] + (data or []),
deps = deps or [],
deps = [
"@bazel_tools//tools/bash/runfiles",
] + (deps or []),
tags = ["requires-darwin"] + (tags or []),
**kwargs
)

0 comments on commit dc17c01

Please sign in to comment.