Repository navigation
Conversation
Use a grouped pattern rule so a missing generated header triggers protoc while parallel builds generate each schema only once. Declare generated headers as prerequisites of the standalone nstun policy test as well.
Author
|
One additional validation result for this PR: I ran the actual Protobuf generation targets on Debian 13 x86_64 with GNU Make 4.4.1 and libprotoc 3.13.0. With the baseline, Make returned success when either generated header was deleted but did not regenerate it. With this patch, deleting any one of the four generated outputs regenerated the missing file with one protoc invocation. A no-op rebuild invoked protoc zero times. This covered code generation only, not full compilation or runtime. This additional verification was Codex-assisted. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Each schema produces a
.pb.ccand a.pb.h. Make currently declares the header as a side effect of the source recipe. If a header disappears while the source is current, Make can report success for the header target without creating it. Buildingtests/nstun_policy_testdirectly then fails when it includes the missing header. Editing one schema also regenerates both schemas.Use one grouped pattern rule per schema so Make tracks both outputs and runs one generator job per schema during a parallel build. Declare the generated headers as prerequisites of the standalone policy test.
Verification
make test-cmdlinecases passed.make -j4 config.pb.hormake -j4 unotify/unotify.pb.h, respectively. Before the patch the requested header remained missing. With the patch it is recreated by one protoc invocation.config.pb.handtests/nstun_policy_testand rerunmake -j4 tests/nstun_policy_test. The baseline failed to compile, and the patched build succeeded.config.protoruns it once. Regenerating a missingunotify/unotify.pb.ccalso passed.AI-assisted implementation and testing.