fix: mathlib4 and cslib breakage from nightly-2026-09-04 - #48
Open
Kha wants to merge 2 commits into
Open
Conversation
`rwa` was split by `lean4#14937` into `rwa [rules]`, `rwa [rules] at h` and a deprecated legacy form taking a full location, so `Mathlib.TacticAnalysis.rwaSuggestion` could no longer quote `rwa $rws:rwRuleSeq $[$loc:location]?` and the module stopped parsing. Build the suggestion per case instead, and suggest nothing for the locations only the deprecated syntax can express (`at *`, `at ⊢`, several hypotheses). The location pattern matches `$h:ident` rather than `$h:term` so that `⊢` does not slip through into an unparseable `rwa [rules] at ⊢`. Behind that, `sum_nonneg'` and `one_le_prod''` need `+typeChanged` (`lean4#14600`): their replacements bound the hypothesis to `i ∈ s`, and `--wfail` turns the resulting warning into a failure. Verified: `lake build Mathlib Archive Counterexamples Wanted --wfail`, `lake test --iofail` and `lake lint` all pass.
`downstream: update repo mathlib4` brought in `Mathlib.TacticAnalysis.rwaSuggestion`, a tactic-analysis linter that is on by default and flags `rw … at h` followed by `assumption`. `cslib` builds and tests with `--iofail`, so its single `Try this:` info in `Cslib.Computability.Languages.MyhillNerode` failed the build. Applied the suggestion. Verified: `lake build`, `lake test` (both `--wfail --iofail`) and `lake lint` pass.
Contributor
Build report for fix: cslib breakage from the new mathlib
|
| Repo | Critical | Build | Test | Lint |
|---|---|---|---|---|
| mathlib4 | ✅ | ✅ in 1162s | ✅ in 46s | ✅ in 91s |
| cslib | ✅ in 35s | ✅ in 8s | ✅ in 3s | |
| repl | ✅ in 1s | ✅ in 56s | ⏭️ |
Stayed red
| Repo | Critical | Build | Test | Lint |
|---|---|---|---|---|
| reference-manual | ✅ | ⏭️ | ⏭️ | ⏭️ |
| verso | 🟥 in 60s | ⏭️ | ⏭️ | |
| verso-slides | ⏭️ | ⏭️ | ⏭️ | |
| verso-web-components | ⏭️ | ⏭️ | ⏭️ |
Stayed green
| Repo | Critical | Build | Test | Lint |
|---|---|---|---|---|
| aesop | ✅ | ✅ in 7s | ✅ in 5s | ⏭️ |
| batteries | ✅ | ✅ in 5s | ✅ in 4s | ✅ in 1s |
| import-graph | ✅ | ✅ in 2s | ✅ in 3s | ⏭️ |
| lean4-cli | ✅ | ✅ in 1s | ✅ in 0s | ⏭️ |
| plausible | ✅ | ✅ in 1s | ✅ in 2s | ⏭️ |
| ProofWidgets4 | ✅ | ✅ in 3s | ✅ in 1s | ⏭️ |
| quote4 | ✅ | ✅ in 2s | ✅ in 1s | ⏭️ |
| BibtexQuery | ✅ in 3s | ⏭️ | ⏭️ | |
| comparator | ✅ in 2s | ⏭️ | ⏭️ | |
| doc-gen4 | ✅ in 8s | ⏭️ | ⏭️ | |
| illuminate | ✅ in 3s | ✅ in 10s | ⏭️ | |
| lean4-unicode-basic | ✅ in 2s | ⏭️ | ⏭️ | |
| lean4export | ✅ in 0s | ✅ in 7s | ⏭️ | |
| LeanSearchClient | ✅ in 1s | ✅ in 0s | ⏭️ | |
| leansqlite | ✅ in 7s | ✅ in 15s | ⏭️ | |
| nerodia | ✅ in 2s | ✅ in 21s | ⏭️ | |
| subverso | ✅ in 6s | ⏭️ | ⏭️ |
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.
masteris red onnightly-2026-09-04(run 33939047804):
mathlib4fails to build,cslibandreplare red behind it, andversofailsindependently, taking
verso-slides,verso-web-componentsand the criticalreference-manualwith it. This PR fixes themathlib4half, so it will not by itself makethe run green.
mathlib4—rwano longer has one syntax with an optional locationlean4#14937 split
rwaintorwa [rules],rwa [rules] at hand a low-priorityrwa [rules] <location>that is deprecated on arrival. Nothing accepts an optional location anymore, so the quotation in the brand-new
Mathlib.TacticAnalysis.rwaSuggestion— which came inwith this same
downstream: update repo mathlib4— stopped parsing:The suggestion is now built per case: no location ⇒
rwa [rules], a single hypothesis ⇒rwa [rules] at h, anything else (at *,at ⊢, several hypotheses) ⇒ no suggestion, sinceonly the deprecated legacy syntax could express those. The two existing expectations in
MathlibTest/TacticAnalysis.lean(rwa [hab] at handrwa [h₁, ← h₂]) are unchanged; a casefor the third kind is added.
Two details worth recording. The location match has to be
$h:ident, not$h:term:locationHypalso admits⊢, which atermantiquotation happily captures and would turn intothe unparseable
rwa [rules] at ⊢. And it has to be a nestedmatchrather than| some \(location| …) =>— a quotation pattern underneath another constructor pattern is rejected withInvalid pattern`.mathlib4— two@[deprecated]aliases need+typeChangedUnmasked once the build got past the parse error, so it is nowhere in the run's log:
sum_nonneg'/one_le_prod''take∀ i, 0 ≤ f iwhere their replacements take∀ i ∈ s, 0 ≤ f i; the lean4#14600 check reports that and--wfailturns it into a failure.Marked
+typeChanged, the difference being intended. This keeps arriving in batches: mathlibmaster builds on a release toolchain, so a deprecation wave landing upstream is invisible to its
own CI and only surfaces here.
cslib— the new linter is on by default, andcslibbuilds with--iofailrwaSuggestiondefaults totrueandcslibenableslinter.mathlibStandardSet, so its onerw … at h/assumptionpair inCslib.Computability.Languages.MyhillNerodeproduces aTry this:info — which--iofailturns into a build and test failure. Applied thesuggestion. Expect more of these as the linter reaches other downstream repos.
Verified
mathlib4:lake build Mathlib Archive Counterexamples Wanted --wfail,lake test --iofail,lake lint.cslib:lake buildandlake test(both--wfail --iofail),lake lint.repl:lake buildandlake testpass unchanged — its failure was only thetest/Mathlibbuild hitting the parse error.
Not fixed here
versois red for the reason already set out in #41 and unchanged since:downstream: fixup repo versowrites the in-treesubversointo the.lake/package-overrides.jsonof verso's nestedtest projects, which pin
leanprover/lean4:v4.31.0themselves, so building them rewritessubverso/.lake/buildand every verso module importing subverso then fails onSubVerso/Highlighting/Highlighted.olean. The fix is a guard inUpdater.fixup_subrepo_dependencies, which is outside this PR.Nothing else is wrong with them on this nightly: with those four override entries emptied
locally,
verso,verso-web-components,verso-slidesandreference-manualall build clean.(The
Verso/Parser.leanconstructor-ambiguity andConditionals.leanunused-variable messagesin the run are warnings, and
versodoes not build with--wfail.)🤖 Generated with Claude Code