Fix parallel build problem: Move protobuf header generation #69
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When building the agent, you currently have to run the build in parallel with something like
-j 4
. This PR fixes that.v1.pb-c.h
is generated when we compilev1.pb-c.h
. The problem is, it is last in the list.nr_span_encoding.c
needs it to be present for it to be able to build. The reason the-j
workaround works is that it launches enough threads to compilev1.pb-c.c
beforenr_span_encoding.c
.By forcing
v1.pb-c.c
to be compiled first, we ensure that, regardless of which files need it to be present, it will be guaranteed to be there.There are alternative fixes we could explore such as manually calling
protoc-c
earlier in the build process, tweaking the compile step for allc
files, or adding a new dependency for the files that need the header file to be there, but this solution feels simpler (and was the quickest to implement).