aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google
diff options
context:
space:
mode:
authorGravatar shahan <shahan@google.com>2018-04-06 19:17:12 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-04-06 19:19:03 -0700
commitb3ba514ccc505481c77ff05a1fbed24844e0afd1 (patch)
tree266c048286bb8fc6a4ed80204943d87f8d5b0d8d /src/main/java/com/google
parent7f63bec55ef34fbaaab5f61987e77512543eece3 (diff)
Cleanup Artifact.getPath() usage in Runfiles.
PiperOrigin-RevId: 191971225
Diffstat (limited to 'src/main/java/com/google')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java b/src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java
index 78cb3c08ec..7319653078 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java
@@ -38,7 +38,6 @@ import com.google.devtools.build.lib.skylarkinterface.SkylarkModule;
import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory;
import com.google.devtools.build.lib.skylarkinterface.SkylarkPrinter;
import com.google.devtools.build.lib.skylarkinterface.SkylarkValue;
-import com.google.devtools.build.lib.vfs.Path;
import com.google.devtools.build.lib.vfs.PathFragment;
import java.io.BufferedReader;
import java.io.IOException;
@@ -423,11 +422,20 @@ public final class Runfiles {
continue outer;
}
PathFragment suffix = source.subFragment(n - j, n);
- Path viaAncestor = ancestor.getPath().getRelative(suffix);
- Path expected = symlink.getPath();
+ PathFragment viaAncestor = ancestor.getExecPath().getRelative(suffix);
+ PathFragment expected = symlink.getExecPath();
if (!viaAncestor.equals(expected)) {
- eventHandler.handle(Event.warn(location, "runfiles symlink " + source + " -> "
- + expected + " obscured by " + prefix + " -> " + ancestor.getPath()));
+ eventHandler.handle(
+ Event.warn(
+ location,
+ "runfiles symlink "
+ + source
+ + " -> "
+ + expected
+ + " obscured by "
+ + prefix
+ + " -> "
+ + ancestor.getExecPath()));
}
continue outer;
}
@@ -731,8 +739,10 @@ public final class Runfiles {
// Previous and new entry might have value of null
Artifact previous = map.get(path);
if (!Objects.equals(previous, artifact)) {
- String previousStr = (previous == null) ? "empty file" : previous.getPath().toString();
- String artifactStr = (artifact == null) ? "empty file" : artifact.getPath().toString();
+ String previousStr =
+ (previous == null) ? "empty file" : previous.getExecPath().toString();
+ String artifactStr =
+ (artifact == null) ? "empty file" : artifact.getExecPath().toString();
String message =
String.format(
"overwrote runfile %s, was symlink to %s, now symlink to %s",