fluffos/cmake
Yucong Sun 897821731f
build: stop autogen churn -- pin generator versions, gate copy-back on input hash (#1263)
Every local build regenerated grammar.autogen.cc/.h and lexer.autogen.cc
and copied them back into the source tree, churning git whenever the
host's bison/flex emitted cosmetically different output than whatever
produced the committed copy. The existing normalization only tokenized
paths and header guards; it could not help when two generators that even
REPORT the same version (3.8.2) differ in emitted code (the committed
grammar had a distro-patched bison's "int yynerrs YY_ATTRIBUTE_UNUSED;"
that vanilla 3.8.2 downgrades on every rebuild).

Two-layer fix:
- Version pin: the committed generated files record the generator that
  produced them ("made by GNU Bison X.Y.Z", YY_FLEX_*_VERSION). A host
  with an OLDER generator no longer regenerates at all -- it builds from
  the committed copy via the existing pre-generated path. Hosts at/above
  the pin still regenerate, so CI keeps validating grammar.y/lexer.l
  against a real toolchain.
- Input-hash gate: the post-build copy-back stamps the committed file
  with the sha256 of its INPUT (grammar.y / lexer.l) and is skipped
  entirely while that hash is unchanged. Generator differences alone can
  no longer touch the committed files; editing the .y/.l still updates
  them exactly as before.

Also: the copy-back now skips writing byte-identical content, so it no
longer bumps mtimes and cascades pointless relinks on every build.

The three committed autogen files are re-stamped in this commit (one-time
churn) as the new pinned baseline: bison 3.8.2 / flex 2.6.4, matching
every CI image.


Claude-Session: https://claude.ai/code/session_01PCUi8QKaFxeTyLXMeVkqn4

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-13 19:18:26 -05:00
..
Findjemalloc.cmake Update Findjemalloc.cmake 2020-11-17 19:47:51 -08:00
FindLibevent.cmake Fix issues detecting libevent2.0 2019-11-16 22:02:10 -08:00
FindMySQL.cmake Add Windows dev environment, agent guide, and doc overhaul (#1208) 2026-06-21 22:17:37 -07:00
FindPCRE.cmake Migrate buildsystem to CMake (#431) 2019-01-07 20:29:34 -08:00
FindPostgreSQL.cmake Adding postgresql support 2021-02-26 00:15:25 -08:00
FindSQLite3.cmake Adding sqlite3 support and db_* efun tests 2020-03-31 20:11:35 -07:00
helper.cmake Support and require USE_JEMALLOC in non debug build 2019-01-17 17:27:41 -08:00
util.cmake build: stop autogen churn -- pin generator versions, gate copy-back on input hash (#1263) 2026-07-13 19:18:26 -05:00