File tree Expand file tree Collapse file tree 4 files changed +19
-16
lines changed
Expand file tree Collapse file tree 4 files changed +19
-16
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,10 @@ sh_library(
4545 "unittest.bash" ,
4646 "unittest_utils.sh" ,
4747 ],
48- data = [":testenv.sh" ],
48+ data = [
49+ ":testenv.sh" ,
50+ "@bazel_tools//tools/bash/runfiles" ,
51+ ],
4952 visibility = ["//visibility:public" ],
5053)
5154
Original file line number Diff line number Diff line change @@ -22,14 +22,6 @@ gen_workspace_stanza(
2222 ],
2323)
2424
25- gen_workspace_stanza (
26- name = "rules_proto_stanza" ,
27- out = "rules_proto_stanza.txt" ,
28- repos = [
29- "rules_proto" ,
30- ],
31- )
32-
3325filegroup (
3426 name = "test-deps" ,
3527 testonly = 1 ,
@@ -346,10 +338,7 @@ sh_test(
346338 name = "bazel_proto_library_test" ,
347339 size = "large" , # Downloads and compiles protobuf for *every* *test* *case*
348340 srcs = ["bazel_proto_library_test.sh" ],
349- data = [
350- ":rules_proto_stanza.txt" ,
351- ":test-deps" ,
352- ],
341+ data = [":test-deps" ],
353342 exec_compatible_with = ["//:highcpu_machine" ],
354343 tags = ["no_windows" ], # Doesn't work on Windows for unknown reason
355344)
Original file line number Diff line number Diff line change @@ -48,8 +48,6 @@ function write_workspace() {
4848 mkdir -p " $workspace "
4949 fi
5050
51- cat $( rlocation io_bazel/src/tests/shell/bazel/rules_proto_stanza.txt) >> " $workspace " WORKSPACE
52-
5351 cat >> " $workspace " WORKSPACE << EOF
5452load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
5553rules_proto_dependencies()
Original file line number Diff line number Diff line change @@ -20,7 +20,20 @@ function print_message_and_exit() {
2020}
2121
2222if type rlocation >& /dev/null; then
23- # If rlocation is defined, use it to look up data-dependencies.
23+ # An incomplete rlocation function is defined in Bazel's test-setup.sh script,
24+ # load the actual Bash runfiles library from @bazel_tools//tools/bash/runfiles
25+ # to make sure repo mappings is respected.
26+ # --- begin runfiles.bash initialization v3 ---
27+ # Copy-pasted from the Bazel Bash runfiles library v3.
28+ set -uo pipefail; set +e; f=bazel_tools/tools/bash/runfiles/runfiles.bash
29+ source " ${RUNFILES_DIR:-/ dev/ null} /$f " 2> /dev/null || \
30+ source " $( grep -sm1 " ^$f " " ${RUNFILES_MANIFEST_FILE:-/ dev/ null} " | cut -f2- -d' ' ) " 2> /dev/null || \
31+ source " $0 .runfiles/$f " 2> /dev/null || \
32+ source " $( grep -sm1 " ^$f " " $0 .runfiles_manifest" | cut -f2- -d' ' ) " 2> /dev/null || \
33+ source " $( grep -sm1 " ^$f " " $0 .exe.runfiles_manifest" | cut -f2- -d' ' ) " 2> /dev/null || \
34+ { echo>&2 " ERROR: cannot find $f " ; exit 1; }; f=; set -e
35+ # --- end runfiles.bash initialization v3 ---
36+
2437 # Load the unit test framework
2538 source " $( rlocation io_bazel/src/test/shell/unittest.bash) " \
2639 || print_message_and_exit " unittest.bash not found!"
You can’t perform that action at this time.
0 commit comments