aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Kristina Chodorow <kchodorow@google.com>2016-05-03 15:06:39 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2016-05-03 15:39:35 +0000
commit4b71d2e1bc3afa0ce0a5b6e68dac3c559654d975 (patch)
tree9443c737b90ecf81a408227b7572441f49766799
parent1b836e71ecfe07db401e12b68e4d2767e812821c (diff)
Set the default workspace name to __main__
See https://github.com/bazelbuild/bazel/wiki/Updating-the-runfiles-tree-structure for more details about this change. RELNOTES[INC]: Bazel will now default to using __main__ as the workspace name (instead of "", as previously) if a project does not provide a workspace name in the WORKSPACE file. The repository's runfiles will appear under x.runfiles/__main__/. -- MOS_MIGRATED_REVID=121376094
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java2
-rw-r--r--src/test/java/com/google/devtools/build/lib/testutil/TestConstants.java2
-rwxr-xr-xsrc/test/shell/bazel/bazel_rules_test.sh2
-rwxr-xr-xsrc/test/shell/bazel/bazel_sandboxing_test.sh2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
index 986e31c2c2..674a88107e 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
@@ -253,7 +253,7 @@ public class BazelRuleClassProvider {
.addBuildInfoFactory(new ObjcBuildInfoFactory())
.setConfigurationCollectionFactory(new BazelConfigurationCollection())
.setPrelude("//tools/build_rules:prelude_bazel")
- .setRunfilesPrefix("")
+ .setRunfilesPrefix("__main__")
.setToolsRepository(TOOLS_REPOSITORY)
.setPrerequisiteValidator(new BazelPrerequisiteValidator())
.setSkylarkAccessibleTopLevels(skylarkBuiltinJavaObects);
diff --git a/src/test/java/com/google/devtools/build/lib/testutil/TestConstants.java b/src/test/java/com/google/devtools/build/lib/testutil/TestConstants.java
index a14172f55c..cab180b1a5 100644
--- a/src/test/java/com/google/devtools/build/lib/testutil/TestConstants.java
+++ b/src/test/java/com/google/devtools/build/lib/testutil/TestConstants.java
@@ -43,7 +43,7 @@ public class TestConstants {
/**
* Default workspace name.
*/
- public static final String WORKSPACE_NAME = "";
+ public static final String WORKSPACE_NAME = "__main__";
/**
* Name of a class with an INSTANCE field of type AnalysisMock to be used for analysis tests.
diff --git a/src/test/shell/bazel/bazel_rules_test.sh b/src/test/shell/bazel/bazel_rules_test.sh
index b0f7e4e312..73893ace8f 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 <<EOF
#!/bin/bash
-if [[ ! -e \$0.runfiles/mypkg/runfile ]]; then
+if [[ ! -e \$0.runfiles/__main__/mypkg/runfile ]]; then
echo "Runfile not found" >&2
exit 1
fi
diff --git a/src/test/shell/bazel/bazel_sandboxing_test.sh b/src/test/shell/bazel/bazel_sandboxing_test.sh
index 27097bc9c1..9e6bc857d8 100755
--- a/src/test/shell/bazel/bazel_sandboxing_test.sh
+++ b/src/test/shell/bazel/bazel_sandboxing_test.sh
@@ -164,7 +164,7 @@ EOF
#!/bin/sh
set -e
-cp $(dirname $0)/tool.runfiles/examples/genrule/datafile $1
+cp $(dirname $0)/tool.runfiles/__main__/examples/genrule/datafile $1
echo "Tools work!"
EOF
chmod +x examples/genrule/tool.sh