diff options
author | Kristina Chodorow <kchodorow@google.com> | 2017-02-16 17:00:53 +0000 |
---|---|---|
committer | Dmitry Lomov <dslomov@google.com> | 2017-02-16 17:02:42 +0000 |
commit | 4b73e972d909bcd533f2f9940f95a00b9b73bdde (patch) | |
tree | 9144d26934aef8e16036d80d249f416bc585bbe4 /src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java | |
parent | b222872e8d61cbd590bdaeb3cbb1764df70e4270 (diff) |
Roll forward execroot change
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. Custom crosstools that hardcode external/<repo> paths will have to
be updated.
Issue #1262.
--
PiperOrigin-RevId: 147726370
MOS_MIGRATED_REVID=147726370
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java b/src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java index 2bb3800eb6..788488e077 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java @@ -34,6 +34,7 @@ import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; import com.google.devtools.build.lib.rules.proto.ProtoCompileActionBuilder.ProtoCommandLineArgv; import com.google.devtools.build.lib.rules.proto.ProtoCompileActionBuilder.ToolchainInvocation; import com.google.devtools.build.lib.util.LazyString; +import com.google.devtools.build.lib.vfs.PathFragment; import com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem; import org.junit.Test; import org.junit.runner.RunWith; @@ -302,12 +303,24 @@ public class ProtoCompileActionBuilderTest { */ @Test public void testIncludeMapsOfExternalFiles() throws Exception { + Label externalLabel = Label.parseAbsolute("@bla//foo:bar"); + Root externalRoot = Root.asSourceRoot( + root.getPath().getRelative( + externalLabel.getPackageIdentifier().getRepository().getSourceRoot()), + false); + PathFragment externalPath = new PathFragment("foo/bar.proto"); + System.out.println("Root: " + externalRoot + " path: " + externalPath); + Artifact externalArtifact = new Artifact( + externalRoot.getPath().getRelative(externalPath), + externalRoot, + externalRoot.getExecPath().getRelative(externalPath), + new LabelArtifactOwner(externalLabel)); assertThat( new ProtoCommandLineArgv( null /* protosInDirectoDependencies */, - ImmutableList.of(artifact("@bla//foo:bar", "external/bla/foo/bar.proto"))) + ImmutableList.of(externalArtifact)) .argv()) - .containsExactly("-Ifoo/bar.proto=external/bla/foo/bar.proto"); + .containsExactly("-Ifoo/bar.proto=../bla/foo/bar.proto"); } private Artifact artifact(String ownerLabel, String path) { |