Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parallel build problem: Move protobuf header generation #69

Merged
merged 1 commit into from
Dec 21, 2020

Conversation

joshuabenuck
Copy link
Contributor

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 compile v1.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 compile v1.pb-c.c before nr_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 all c 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).

@Fahmy-Mohammed Fahmy-Mohammed merged commit 53eb55f into newrelic:main Dec 21, 2020
kneitinger pushed a commit that referenced this pull request Jan 13, 2021
joshuabenuck pushed a commit that referenced this pull request Jan 13, 2021
joshuabenuck pushed a commit that referenced this pull request Jan 13, 2021
mfulb pushed a commit to mfulb/newrelic-php-agent that referenced this pull request Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants