diff options
author | buchgr <buchgr@google.com> | 2017-08-05 01:17:59 +0200 |
---|---|---|
committer | Jakob Buchgraber <buchgr@google.com> | 2017-08-07 11:22:22 +0200 |
commit | e8d4366cd374fba92f1425de0d475411c8defda4 (patch) | |
tree | ce269661bbe4fb062e901a458dad01440fbbe7be | |
parent | 0ace9b00e85ae9fc21a8a49e1918772545c4be8b (diff) |
Automated rollback of commit 496d3ded0bce12b7371a93e1183ba30e6aa88032.
*** Reason for rollback ***
Roll-forward.
unknown commit fixed the internal protoc to also accept full paths, just as the external one does. Fixes #2265
*** Original change description ***
Automated rollback of commit bcd23553f38f54fd4846aa507c827a4ee40cfab4.
*** Reason for rollback ***
RELNOTES: None
PiperOrigin-RevId: 164324424
2 files changed, 25 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilder.java index d4a3878784..a7a9b89722 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilder.java @@ -596,7 +596,7 @@ public class ProtoCompileActionBuilder { } for (Artifact src : protosToCompile) { - cmdLine.addPath(src.getRootRelativePath()); + cmdLine.addPath(src.getExecPath()); } if (!allowServices) { 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 b9b9862b31..cf5d86a9e0 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 @@ -107,6 +107,30 @@ public class ProtoCompileActionBuilderTest { } @Test + public void commandline_derivedArtifact() { + // Verify that the command line contains the correct path to a generated protocol buffers. + SupportData supportData = + SupportData.create( + Predicates.<TransitiveInfoCollection>alwaysFalse(), + ImmutableList.of(derivedArtifact("//:dont-care", "source_file.proto")), + NestedSetBuilder.<Artifact>emptySet(STABLE_ORDER) /* protosInDirectDeps */, + NestedSetBuilder.<Artifact>emptySet(STABLE_ORDER) /* transitiveImports */, + true /* hasProtoSources */); + + CustomCommandLine cmdLine = + createCommandLineFromToolchains( + ImmutableList.<ToolchainInvocation>of() /* toolchainInvocations */, + supportData.getDirectProtoSources(), + supportData.getTransitiveImports(), + null /* protosInDirectDeps */, + "//foo:bar", + true /* allowServices */, + ImmutableList.<String>of() /* protocOpts */); + + assertThat(cmdLine.arguments()).containsExactly("out/source_file.proto"); + } + + @Test public void commandLine_strictDeps() throws Exception { ProtoLangToolchainProvider toolchain = ProtoLangToolchainProvider.create( |