fix: gate flatbuffers regeneration behind REGEN_FLATBUFFERS - #84
Open
netsirius wants to merge 1 commit into
Open
fix: gate flatbuffers regeneration behind REGEN_FLATBUFFERS#84netsirius wants to merge 1 commit into
netsirius wants to merge 1 commit into
Conversation
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.
Problem
rust/build.rsranflatc --rust -o src/generated ...on every build, rewriting the checked-in generated files with whatever flatc is installed locally. A mismatched flatc turned a plaincargo checkinto ~4k dirty tracked lines, which twice got swept into commits (#72, reverted by #73; the initial commit of #83).Solution
Regeneration is now opt-in (option 2 from the issue):
src/generated/and don't require flatc — the checked-in files are the source of truth.REGEN_FLATBUFFERS=1 cargo buildand commit the.fbsand regenerated.rstogether (documented in CONTRIBUTING.md).REGEN_FLATBUFFERS=0or empty counts as unset.Testing
cargo check(no env var)src/generated/untouched, flatc not requiredREGEN_FLATBUFFERS=0 cargo buildREGEN_FLATBUFFERS=1 cargo buildREGEN_FLATBUFFERS=1without flatcPossible follow-up: a CI job regenerating with a pinned flatc that fails on diff.
Fixes
Closes freenet/freenet-core#4747