diff options
author | 2016-09-19 18:08:59 +0000 | |
---|---|---|
committer | 2016-09-20 06:45:52 +0000 | |
commit | 82d43279f93d95e4c41b4bc598a3cc05ddd1ae1a (patch) | |
tree | 6554cd4499ca265d9ad9ae1d3ef9867afe97e0c6 /src/main/java/com/google/devtools/build/lib/analysis/CompilationHelper.java | |
parent | 35b50d26893147c642eeb48b8247350a87f03741 (diff) |
Change execution root for external repositories to be ../repo
Some of the important aspect of this change:
* Remote repos in the execution root are under output_base/execroot/repo_name, so the prefix is ../repo_name (to escape the local workspace name).
* Package roots for external repos were previously "output_base/", they are now output_base/external/repo_name (which means source artifacts always have a relative path from their repository).
* Outputs are under bazel-bin/external/repo_name/ (or similarly under genfiles). Note that this is a bit of a change from how this was implemented in the previous cl.
Fixes #1262.
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.
Roll forward of bdfd58a.
--
MOS_MIGRATED_REVID=133606309
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/CompilationHelper.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/CompilationHelper.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/CompilationHelper.java b/src/main/java/com/google/devtools/build/lib/analysis/CompilationHelper.java index 8a1fddc6ff..a3769e3e07 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/CompilationHelper.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/CompilationHelper.java @@ -54,8 +54,8 @@ public final class CompilationHelper { } MiddlemanFactory factory = env.getMiddlemanFactory(); return ImmutableList.of(factory.createMiddlemanAllowMultiple( - env, actionOwner, ruleContext.getPackageDirectory(), purpose, filesToBuild, - ruleContext.getConfiguration().getMiddlemanDirectory( + env, actionOwner, ruleContext.getRule().getLabel().getPackageIdentifier().getSourceRoot(), + purpose, filesToBuild, ruleContext.getConfiguration().getMiddlemanDirectory( ruleContext.getRule().getRepository()))); } @@ -87,7 +87,8 @@ public final class CompilationHelper { MiddlemanFactory factory = env.getMiddlemanFactory(); Iterable<Artifact> artifacts = dep.getProvider(FileProvider.class).getFilesToBuild(); return ImmutableList.of( - factory.createMiddlemanAllowMultiple(env, actionOwner, ruleContext.getPackageDirectory(), + factory.createMiddlemanAllowMultiple(env, actionOwner, + ruleContext.getRule().getLabel().getPackageIdentifier().getSourceRoot(), purpose, artifacts, ruleContext.getConfiguration().getMiddlemanDirectory( ruleContext.getRule().getRepository()))); } |