aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/actions
diff options
context:
space:
mode:
authorGravatar Kristina Chodorow <kchodorow@google.com>2016-05-10 22:20:12 +0000
committerGravatar Klaus Aehlig <aehlig@google.com>2016-05-11 10:23:49 +0000
commitd15c5be755b86017a19864a230e613c166d63737 (patch)
tree16e7ac4f574db15bb30aeb3e70533e0e77b58b4f /src/main/java/com/google/devtools/build/lib/actions
parent0a447860fa68bdfefe6d5cd506f0de0562f18955 (diff)
Use runfiles path, not execroot path, for Skylark's short_path
Will help with fixing #1233. -- MOS_MIGRATED_REVID=121993946
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/actions')
-rw-r--r--src/main/java/com/google/devtools/build/lib/actions/Artifact.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/Artifact.java b/src/main/java/com/google/devtools/build/lib/actions/Artifact.java
index 3c71f88baf..e801a7e0a0 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/Artifact.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/Artifact.java
@@ -512,6 +512,18 @@ public class Artifact
return relativePath;
}
+ @SkylarkCallable(
+ name = "short_path",
+ structField = true,
+ doc =
+ "The path of this file relative to its root. This excludes the aforementioned "
+ + "<i>root</i>, i.e. configuration-specific fragments of the path. This is also the "
+ + "path under which the file is mapped if it's in the runfiles of a binary."
+ )
+ public final String getRunfilesPathString() {
+ return getRunfilesPath().getPathString();
+ }
+
/**
* Returns this.getExecPath().getPathString().
*/
@@ -541,14 +553,6 @@ public class Artifact
return ShellUtils.shellEscape(getExecPathString());
}
- @SkylarkCallable(
- name = "short_path",
- structField = true,
- doc =
- "The path of this file relative to its root. This excludes the aforementioned "
- + "<i>root</i>, i.e. configuration-specific fragments of the path. This is also the "
- + "path under which the file is mapped if it's in the runfiles of a binary."
- )
public final String getRootRelativePathString() {
return getRootRelativePath().getPathString();
}