From 857cda2c45a5cc68c3fa398311c48c571a64915d Mon Sep 17 00:00:00 2001 From: Kristina Chodorow Date: Tue, 19 Apr 2016 13:55:24 +0000 Subject: Move the runfiles for external repositories to under the x.runfiles/ directory This also sets the Bazel workspace name to io_bazel_source. Fixes #848. Relevant to #1116, #1124, RELNOTES[INC]: All repositories are now directly under the x.runfiles directory in the runfiles tree (previously, external repositories were at x.runfiles/main-repo/external/other-repo. This simplifies handling remote repository runfiles considerably, but will break existing references to external repository runfiles. --- Furthermore, if a Bazel project does not provide a workspace name in the WORKSPACE file, Bazel will now default to using __main__ as the workspace name (instead of "", as previously). The repository's runfiles will appear under x.runfiles/__main__/. -- MOS_MIGRATED_REVID=120224534 --- src/test/shell/bazel/bazel_example_test.sh | 17 +++-------------- src/test/shell/bazel/bazel_rules_test.sh | 6 +++--- src/test/shell/bazel/bazel_sandboxing_test.sh | 2 +- src/test/shell/bazel/external_integration_test.sh | 12 ++++++------ src/test/shell/bazel/generate_workspace_test.sh | 2 -- src/test/shell/bazel/git_repository_test.sh | 8 ++++---- src/test/shell/bazel/local_repository_test.sh | 2 +- src/test/shell/bazel/testenv.sh | 3 ++- src/test/shell/integration/runfiles_test.sh | 7 +++---- 9 files changed, 23 insertions(+), 36 deletions(-) (limited to 'src/test/shell') diff --git a/src/test/shell/bazel/bazel_example_test.sh b/src/test/shell/bazel/bazel_example_test.sh index b9d2aef276..93075fddb6 100755 --- a/src/test/shell/bazel/bazel_example_test.sh +++ b/src/test/shell/bazel/bazel_example_test.sh @@ -23,6 +23,9 @@ source $(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/test-setup.sh \ function set_up() { copy_examples + cat > WORKSPACE <WORKSPACE <<'EOF' -workspace(name = "toto") -EOF - - assert_build_output ./bazel-bin/${java_pkg}/hello-world ${java_pkg}:hello-world - assert_binary_run_from_subdir "bazel-bin/${java_pkg}/hello-world foo" "Hello foo" -} - function test_genrule_and_genquery() { # The --javabase flag is to force the tools/jdk:jdk label to be used # so it appears in the dependency list. diff --git a/src/test/shell/bazel/bazel_rules_test.sh b/src/test/shell/bazel/bazel_rules_test.sh index b0f7e4e312..c82b9cd996 100755 --- a/src/test/shell/bazel/bazel_rules_test.sh +++ b/src/test/shell/bazel/bazel_rules_test.sh @@ -63,7 +63,7 @@ function test_extra_action() { # a program that parses the proto here. cat > mypkg/echoer.sh <&2 exit 1 fi @@ -357,8 +357,8 @@ def Fib(n): EOF cat > module2/bez.py < zoo/female.sh < test/test.sh < test/test.sh < zoo/female.sh <&2; exit 1; } -export JAVA_RUNFILES=$TEST_SRCDIR - function set_up() { # Set up custom repository directory. m2=$TEST_TMPDIR/my-m2 diff --git a/src/test/shell/bazel/git_repository_test.sh b/src/test/shell/bazel/git_repository_test.sh index 67a630dd1b..2c862b7f7e 100755 --- a/src/test/shell/bazel/git_repository_test.sh +++ b/src/test/shell/bazel/git_repository_test.sh @@ -85,7 +85,7 @@ EOF cat > planets/planet_info.sh < planets/planet_info.sh < planets/planet_info.sh < zoo/dumper.sh <&2; exit 1; } +TEST_SRCDIR="$TEST_SRCDIR/io_bazel" # Load the unit-testing framework source "${TEST_SRCDIR}/src/test/shell/unittest.bash" || \ @@ -29,7 +30,7 @@ bazel="${TEST_SRCDIR}/src/bazel" bazel_data="${TEST_SRCDIR}" # Java -jdk_dir="${TEST_SRCDIR}/external/local_jdk" +jdk_dir="${TEST_SRCDIR}/../local_jdk" langtools="${TEST_SRCDIR}/src/test/shell/bazel/langtools.jar" # Tools directory location diff --git a/src/test/shell/integration/runfiles_test.sh b/src/test/shell/integration/runfiles_test.sh index 6821b30dcd..ee26ca130c 100755 --- a/src/test/shell/integration/runfiles_test.sh +++ b/src/test/shell/integration/runfiles_test.sh @@ -55,16 +55,16 @@ EOF bazel build pkg:py >&$TEST_log 2>&1 || fail "build failed" # we get a warning that hidden.py is inaccessible - expect_log_once "/genfiles/pkg/e/f/g/hidden.py obscured by pkg/e/f " + expect_log_once "/genfiles/pkg/e/f/g/hidden.py obscured by .*/pkg/e/f " } function test_foo_runfiles() { -cat > BUILD << EOF + cat > BUILD << EOF py_library(name = "root", srcs = ["__init__.py"], visibility = ["//visibility:public"]) EOF -cat > pkg/BUILD << EOF + cat > pkg/BUILD << EOF sh_binary(name = "foo", srcs = [ "x/y/z.sh" ], data = [ ":py", @@ -149,4 +149,3 @@ EOF } run_suite "runfiles" - -- cgit v1.2.3