aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternPhaseValue.java
diff options
context:
space:
mode:
authorGravatar Kristina Chodorow <kchodorow@google.com>2016-07-22 15:18:07 +0000
committerGravatar John Cater <jcater@google.com>2016-07-22 20:10:29 +0000
commit36a6c17629e76872a876cd313623246d4d0aa082 (patch)
tree0178e6b8487cfd00f7c7864f2c20620da3dbcb9d /src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternPhaseValue.java
parent4545ef538664563d284ceb7d19d6dc357497b2d0 (diff)
Create a symlink with the right workspace name under the execroot
The execution root currently uses the basename of the workspace directory for the workspace name, not the name in the WORKSPACE file. (For example, if our sources were in /path/to/foo and our WORKSPACE file had workspace(name = "bar"), our execution root would look like execroot/foo.) This creates a symlink bar -> foo, so that accessing ../repo_name actually works for the main repository. RELNOTES[INC]: The main repository's execution root is under the main repository's workspace name, not the source directory's basename. This shouldn't have any effect on most builds, but it's possible it could break someone doing weird things with paths in actions. -- MOS_MIGRATED_REVID=128175455
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternPhaseValue.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternPhaseValue.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternPhaseValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternPhaseValue.java
index 0e43191dbc..ca8881386f 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternPhaseValue.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternPhaseValue.java
@@ -53,11 +53,12 @@ public final class TargetPatternPhaseValue implements SkyValue {
// TODO(ulfjack): Support EventBus event posting in Skyframe, and remove this code again.
private final ImmutableSet<Target> originalTargets;
private final ImmutableSet<Target> testSuiteTargets;
+ private final String workspaceName;
TargetPatternPhaseValue(ImmutableSet<Target> targets, @Nullable ImmutableSet<Target> testsToRun,
boolean hasError, boolean hasPostExpansionError, ImmutableSet<Target> filteredTargets,
ImmutableSet<Target> testFilteredTargets, ImmutableSet<Target> originalTargets,
- ImmutableSet<Target> testSuiteTargets) {
+ ImmutableSet<Target> testSuiteTargets, String workspaceName) {
this.targets = Preconditions.checkNotNull(targets);
this.testsToRun = testsToRun;
this.hasError = hasError;
@@ -66,6 +67,7 @@ public final class TargetPatternPhaseValue implements SkyValue {
this.testFilteredTargets = Preconditions.checkNotNull(testFilteredTargets);
this.originalTargets = Preconditions.checkNotNull(originalTargets);
this.testSuiteTargets = Preconditions.checkNotNull(testSuiteTargets);
+ this.workspaceName = workspaceName;
}
public ImmutableSet<Target> getTargets() {
@@ -101,8 +103,13 @@ public final class TargetPatternPhaseValue implements SkyValue {
return testSuiteTargets;
}
+ public String getWorkspaceName() {
+ return workspaceName;
+ }
+
public LoadingResult toLoadingResult() {
- return new LoadingResult(hasError(), hasPostExpansionError(), getTargets(), getTestsToRun());
+ return new LoadingResult(
+ hasError(), hasPostExpansionError(), getTargets(), getTestsToRun(), getWorkspaceName());
}
@SuppressWarnings("unused")