Files
lean4/script
Kim Morrison f3752861c9 fix: validate stage0 version matches release version (#12700)
This PR fixes a CMake scoping bug that made `-DLEAN_VERSION_*` overrides
ineffective.

The version variables (`LEAN_VERSION_MAJOR`, `MINOR`, `PATCH`,
`IS_RELEASE`) were declared with plain `set()`, which creates normal
variables that shadow cache variables set by `-D` on the command line.
The fix changes them to `CACHE STRING ""` to match the existing
`LEAN_SPECIAL_VERSION_DESC` pattern.

However, `CACHE STRING ""` alone isn't sufficient because `project(LEAN
CXX C)` implicitly creates empty `LEAN_VERSION_{MAJOR,MINOR,PATCH}`
normal variables (CMake sets `<PROJECT>_VERSION_*` for the project
name). These shadow the cache values, so we `unset()` them after the
cache declarations to let `${VAR}` fall through to the cache.

Closes https://github.com/leanprover/lean4/issues/12681

🤖 Prepared with Claude Code

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 01:31:29 +00:00
..
2019-08-09 08:52:49 -07:00
2022-11-28 15:47:17 +01:00