aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/build_rules
diff options
context:
space:
mode:
authorGravatar Kristina Chodorow <kchodorow@google.com>2017-02-16 17:00:53 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2017-02-16 17:02:42 +0000
commit4b73e972d909bcd533f2f9940f95a00b9b73bdde (patch)
tree9144d26934aef8e16036d80d249f416bc585bbe4 /tools/build_rules
parentb222872e8d61cbd590bdaeb3cbb1764df70e4270 (diff)
Roll forward execroot change
RELNOTES[INC]: Previously, an external repository would be symlinked into the execution root at execroot/local_repo/external/remote_repo. This changes it to be at execroot/remote_repo. This may break genrules/Skylark actions that hardcode execution root paths. If this causes breakages for you, ensure that genrules are using $(location :target) to access files and Skylark rules are using http://bazel.io/docs/skylark/lib/File.html's path, dirname, etc. functions. Custom crosstools that hardcode external/<repo> paths will have to be updated. Issue #1262. -- PiperOrigin-RevId: 147726370 MOS_MIGRATED_REVID=147726370
Diffstat (limited to 'tools/build_rules')
-rw-r--r--tools/build_rules/test_rules.bzl7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/build_rules/test_rules.bzl b/tools/build_rules/test_rules.bzl
index ef93d62d8d..d4ede3e81e 100644
--- a/tools/build_rules/test_rules.bzl
+++ b/tools/build_rules/test_rules.bzl
@@ -188,8 +188,11 @@ def _rule_test_impl(ctx):
prefix_parts = []
if rule_.label.workspace_root:
- # Create a prefix that is correctly relative to the output of this rule.
- prefix_parts = ["..", strip_prefix("external/", rule_.label.workspace_root)]
+ if rule_.label.workspace_root.startswith(".."):
+ prefix_parts = [rule_.label.workspace_root]
+ else:
+ # Create a prefix that is correctly relative to the output of this rule.
+ prefix_parts = ["..", strip_prefix("external/", rule_.label.workspace_root)]
if rule_.label.package:
prefix_parts.append(rule_.label.package)