[c++] avrogencpp: emit deterministic include guard#400
Merged
travisdowns merged 2 commits intoMay 15, 2026
Conversation
CodeGen::guard() in avrogencpp.cc was suffixing the generated header's include guard with the output of boost::mt19937 seeded from ::time(nullptr). That produced a different guard on every avrogen invocation, e.g.: #ifndef FOO_AVROGEN_H_3350718792_H #ifndef FOO_AVROGEN_H_2362587291_H Two consequences: 1. Generated headers were non-deterministic. Repeated runs on the same schema produced different bytes. 2. Build systems that key their cache on input-content digests (e.g. Bazel's remote cache, the Nix store) saw every consumer of the generated header miss the cache on every build, even when the schema was byte-identical. In a hermetic two-output-base Bazel build of Redpanda this surfaced as a chain of cascade rebuilds starting at manifest_file.avrogen.h and propagating through every .cc that included it. headerFile_ is already guaranteed-unique per output. The random suffix doesn't add uniqueness, only entropy. Mirrors the same change being proposed upstream at apache/avro.
Agent-Logs-Url: https://github.com/redpanda-data/avro/sessions/b62d1929-ada4-43d6-9a02-d5dc98f08aaf Co-authored-by: travisdowns <2403521+travisdowns@users.noreply.github.com>
Member
Author
|
RP crew any objection if we just delete |
dotnwat
approved these changes
May 15, 2026
Member
either delete it, or make our fork the default. either one works! |
Member
Author
I planned to do the latter regardless (will now). |
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.
#399 was accidentally opened against `master` — this is the same PR retargeted against `release-1.12.0-redpanda`.
Patch content is unchanged from #399.