fix: validate stage0 version matches release version#12700
fix: validate stage0 version matches release version#12700
Conversation
This PR adds a check to both `release_checklist.py` and CI to verify that `stage0/src/CMakeLists.txt` has the same LEAN_VERSION_MAJOR and LEAN_VERSION_MINOR as the release tag. The stage0 pre-built compiler stamps .olean headers with its baked-in version, so a mismatch causes the release tarball to contain .olean files with the wrong version. This happened in v4.29.0-rc2 (#12681) because the 'begin development cycle for v4.30.0' commit bumped stage0 to 4.30.0 before the release was cut. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Mathlib CI status (docs):
|
|
Reference manual CI status:
|
|
I don't think this is the right fix. We already set |
@Kha, the problem was that I unwittingly pulled in a stage0 update from master (which was using MINOR=30) to the releases/v4.29.0 branch. Our existing validation doesn't guard against this. |
|
I understand the repo state that led to this but I don't understand why the logic I described above did not lead to the stage0/ content being irrelevant here |
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` flags on the command line. This made the `-DLEAN_VERSION_*` flags passed by CI (and forwarded to stage0 via STAGE0_ARGS) completely ineffective — the `set()` always won. Change them to `set(... CACHE STRING "")` to match the existing pattern used by LEAN_SPECIAL_VERSION_DESC. With CACHE STRING (no FORCE), the value in CMakeLists.txt is the default, but `-D` flags take precedence. Also update release_checklist.py parsing to handle the new format. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
You're right — the Contrast with I've pushed a fix that changes the version |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This PR fixes a CMake scoping bug that made the
-DLEAN_VERSION_*flags passed by CI (and forwarded to stage0 viaSTAGE0_ARGS) completely ineffective, and adds belt-and-suspenders CI validation.The version variables (
LEAN_VERSION_MAJOR,MINOR,PATCH,IS_RELEASE) were declared with plainset(), which creates CMake normal variables that shadow cache variables set by-Don the command line. This meant the version override mechanism was dead code. In contrast,LEAN_SPECIAL_VERSION_DESCusedCACHE STRING, which is why the-rc2suffix worked correctly while the version numbers didn't — producing.oleanfiles stamped4.30.0-rc2in the v4.29.0-rc2 release tarball.The fix changes the version
set()calls to useCACHE STRING ""to match the existingLEAN_SPECIAL_VERSION_DESCpattern. Additionally, CI andrelease_checklist.pynow validate thatstage0/src/CMakeLists.txthas matching version numbers.Closes #12681
🤖 Prepared with Claude Code