close
Skip to content

Commit e8d4366

Browse files
committed
Automated rollback of commit 496d3de.
*** Reason for rollback *** Roll-forward. unknown commit fixed the internal protoc to also accept full paths, just as the external one does. Fixes bazelbuild#2265 *** Original change description *** Automated rollback of commit bcd2355. *** Reason for rollback *** RELNOTES: None PiperOrigin-RevId: 164324424
1 parent 0ace9b0 commit e8d4366

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

‎src/main/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilder.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ static CustomCommandLine createCommandLineFromToolchains(
596596
}
597597

598598
for (Artifact src : protosToCompile) {
599-
cmdLine.addPath(src.getRootRelativePath());
599+
cmdLine.addPath(src.getExecPath());
600600
}
601601

602602
if (!allowServices) {

‎src/test/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilderTest.java‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,30 @@ public void commandLine_basic() throws Exception {
106106
.inOrder();
107107
}
108108

109+
@Test
110+
public void commandline_derivedArtifact() {
111+
// Verify that the command line contains the correct path to a generated protocol buffers.
112+
SupportData supportData =
113+
SupportData.create(
114+
Predicates.<TransitiveInfoCollection>alwaysFalse(),
115+
ImmutableList.of(derivedArtifact("//:dont-care", "source_file.proto")),
116+
NestedSetBuilder.<Artifact>emptySet(STABLE_ORDER) /* protosInDirectDeps */,
117+
NestedSetBuilder.<Artifact>emptySet(STABLE_ORDER) /* transitiveImports */,
118+
true /* hasProtoSources */);
119+
120+
CustomCommandLine cmdLine =
121+
createCommandLineFromToolchains(
122+
ImmutableList.<ToolchainInvocation>of() /* toolchainInvocations */,
123+
supportData.getDirectProtoSources(),
124+
supportData.getTransitiveImports(),
125+
null /* protosInDirectDeps */,
126+
"//foo:bar",
127+
true /* allowServices */,
128+
ImmutableList.<String>of() /* protocOpts */);
129+
130+
assertThat(cmdLine.arguments()).containsExactly("out/source_file.proto");
131+
}
132+
109133
@Test
110134
public void commandLine_strictDeps() throws Exception {
111135
ProtoLangToolchainProvider toolchain =

0 commit comments

Comments
 (0)