[
https://issues.apache.org/jira/browse/MESOS-7470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16001171#comment-16001171
]
Joseph Wu commented on MESOS-7470:
----------------------------------
Yeah, I see the subtle difference here.
Basically, the fix is to add a custom target between generating {{.proto}} ->
{{.pb.cc}} and from {{.pb.cc}} -> {{.o}}.
If the current dependency tree looks like this:
{code}
mesos-protobufs.lib
/ \
*.pb.cc *.pb.h
\ /
*.proto
{code}
The fixed dependency tree would be this:
{code}
mesos-protobufs.lib
|
mesos-generated-protobuf-sources
/ \
*.pb.cc *.pb.h
\ /
*.proto
{code}
> CMake build does not make sure proto outputs are generated before attempting
> to compile users
> ---------------------------------------------------------------------------------------------
>
> Key: MESOS-7470
> URL: https://issues.apache.org/jira/browse/MESOS-7470
> Project: Mesos
> Issue Type: Bug
> Components: cmake
> Reporter: Benjamin Bannier
>
> For each protobuf file, our cmake setup creates a dedicated target generating
> both the header and implementation file and adds these as dependencies
> directly to some other target (typically a library). At least for the Make
> generator, this under the covers introduces a dependency edge from the
> library to an object file generated from compiling the protobuf
> implementation file.
> If a protobuf file has an {{import}} for another protobuf file, the generated
> C++ will include the corresponding generated header file. We currently do not
> ensure all input files (e.g., headers) are generated from their sources
> before compiling users.
> This can lead to faulty builds where
> 1) a consuming protobuf file is compiled before its inputs are generated, or
> 2) in incremental builds, a consuming protobuf is compiled from an outdated
> generated protobuf header file.
> For an example of 1) a compile of
> {{18220a50d3033a4debffd7cc61f1514ede7e2c2b}} will fail at {{-j1}}.
> It seems we should ensure all protobuf files are created before allowing
> compilation of users.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)