diff options
author | 2016-04-19 13:55:24 +0000 | |
---|---|---|
committer | 2016-04-20 11:12:35 +0000 | |
commit | 857cda2c45a5cc68c3fa398311c48c571a64915d (patch) | |
tree | 8a2ad9cd0c92752b1b6105c27d9995dcaf3d24a4 /src/main/java/com/google/devtools/build/lib/analysis/SourceManifestAction.java | |
parent | 0b26f446f8312d1c43d162fe706467ef458c4db8 (diff) |
Move the runfiles for external repositories to under the x.runfiles/ directory
This also sets the Bazel workspace name to io_bazel_source.
Fixes #848.
Relevant to #1116, #1124,
RELNOTES[INC]: All repositories are now directly under the x.runfiles directory in the runfiles tree (previously, external repositories were at x.runfiles/main-repo/external/other-repo. This simplifies handling remote repository runfiles considerably, but will break existing references to external repository runfiles.
---
Furthermore, if a Bazel project does not provide a workspace name in the WORKSPACE file, Bazel will now default to using __main__ as the workspace name (instead of "", as previously). The repository's runfiles will appear under x.runfiles/__main__/.
--
MOS_MIGRATED_REVID=120224534
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/SourceManifestAction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/SourceManifestAction.java | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/SourceManifestAction.java b/src/main/java/com/google/devtools/build/lib/analysis/SourceManifestAction.java index f1e633967f..513fdc4e21 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/SourceManifestAction.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/SourceManifestAction.java @@ -192,17 +192,21 @@ public final class SourceManifestAction extends AbstractFileWriteAction { protected String computeKey() { Fingerprint f = new Fingerprint(); f.addString(GUID); - Map<PathFragment, Artifact> symlinks = runfiles.getSymlinksAsMap(null); + Map<PathFragment, Artifact> symlinks = runfiles.getSymlinksAsMap(); f.addInt(symlinks.size()); for (Map.Entry<PathFragment, Artifact> symlink : symlinks.entrySet()) { f.addPath(symlink.getKey()); - f.addPath(symlink.getValue().getPath()); + if (symlink.getValue() != null) { + f.addPath(symlink.getValue().getPath()); + } } Map<PathFragment, Artifact> rootSymlinks = runfiles.getRootSymlinksAsMap(null); f.addInt(rootSymlinks.size()); for (Map.Entry<PathFragment, Artifact> rootSymlink : rootSymlinks.entrySet()) { f.addPath(rootSymlink.getKey()); - f.addPath(rootSymlink.getValue().getPath()); + if (rootSymlink.getValue() != null) { + f.addPath(rootSymlink.getValue().getPath()); + } } for (Artifact artifact : runfiles.getArtifactsWithoutMiddlemen()) { @@ -294,16 +298,18 @@ public final class SourceManifestAction extends AbstractFileWriteAction { private final Artifact output; private final Runfiles.Builder runfilesBuilder; - public Builder(String prefix, ManifestType manifestType, ActionOwner owner, Artifact output) { - this.runfilesBuilder = new Runfiles.Builder(prefix); + public Builder( + String prefix, ManifestType manifestType, ActionOwner owner, Artifact output, + boolean legacyExternalRunfiles) { + this.runfilesBuilder = new Runfiles.Builder(prefix, legacyExternalRunfiles); manifestWriter = manifestType; this.owner = owner; this.output = output; } - @VisibleForTesting + @VisibleForTesting // Only used for testing. Builder(String prefix, ManifestWriter manifestWriter, ActionOwner owner, Artifact output) { - this.runfilesBuilder = new Runfiles.Builder(prefix); + this.runfilesBuilder = new Runfiles.Builder(prefix, false); this.manifestWriter = manifestWriter; this.owner = owner; this.output = output; |