diff options
author | Kristina Chodorow <kchodorow@google.com> | 2016-07-22 15:18:07 +0000 |
---|---|---|
committer | John Cater <jcater@google.com> | 2016-07-22 20:10:29 +0000 |
commit | 36a6c17629e76872a876cd313623246d4d0aa082 (patch) | |
tree | 0178e6b8487cfd00f7c7864f2c20620da3dbcb9d /src/main/java/com/google/devtools/build/lib/analysis | |
parent | 4545ef538664563d284ceb7d19d6dc357497b2d0 (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/analysis')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/BuildView.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java b/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java index 2f5f70f01d..e7c4ac468c 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java @@ -283,7 +283,8 @@ public class BuildView { ImmutableList.<ConfiguredTarget>of(), ImmutableList.<ConfiguredTarget>of(), null, - ImmutableMap.<PackageIdentifier, Path>of()); + ImmutableMap.<PackageIdentifier, Path>of(), + ""); private final ImmutableList<ConfiguredTarget> targetsToBuild; @Nullable private final ImmutableList<ConfiguredTarget> targetsToTest; @@ -295,6 +296,7 @@ public class BuildView { @Nullable private final TopLevelArtifactContext topLevelContext; private final ImmutableList<AspectValue> aspects; private final ImmutableMap<PackageIdentifier, Path> packageRoots; + private final String workspaceName; private AnalysisResult( Collection<ConfiguredTarget> targetsToBuild, @@ -306,7 +308,8 @@ public class BuildView { Collection<ConfiguredTarget> parallelTests, Collection<ConfiguredTarget> exclusiveTests, TopLevelArtifactContext topLevelContext, - ImmutableMap<PackageIdentifier, Path> packageRoots) { + ImmutableMap<PackageIdentifier, Path> packageRoots, + String workspaceName) { this.targetsToBuild = ImmutableList.copyOf(targetsToBuild); this.aspects = ImmutableList.copyOf(aspects); this.targetsToTest = targetsToTest == null ? null : ImmutableList.copyOf(targetsToTest); @@ -317,6 +320,7 @@ public class BuildView { this.exclusiveTests = ImmutableSet.copyOf(exclusiveTests); this.topLevelContext = topLevelContext; this.packageRoots = packageRoots; + this.workspaceName = workspaceName; } /** @@ -386,6 +390,10 @@ public class BuildView { public TopLevelArtifactContext getTopLevelContext() { return topLevelContext; } + + public String getWorkspaceName() { + return workspaceName; + } } @@ -602,7 +610,8 @@ public class BuildView { parallelTests, exclusiveTests, topLevelOptions, - skyframeAnalysisResult.getPackageRoots()); + skyframeAnalysisResult.getPackageRoots(), + loadingResult.getWorkspaceName()); } private static NestedSet<Artifact> getBaselineCoverageArtifacts( |