Repository navigation
fix: mathlib4 breakage from the import-graph main merge - #149
Closed
downstream-lean4[bot] wants to merge 1 commit into
Closed
downstream-lean4[bot] wants to merge 1 commit into
downstream-lean4[bot] wants to merge 1 commit into
Conversation
`downstream: update repo import-graph` (494de84) brought in [import-graph#173](leanprover-community/import-graph#173), which cuts `Lake.Config.Workspace` and `Lake.Load.Workspace` out of the import closure of `ImportGraph` and `ImportGraph.Tools` by splitting the workspace loading and cache-validation halves of `WorkspaceModel.Summary.Lake` apart. That is exactly what the `assert_not_exists Lake.Workspace` in `ImportGraph/WorkspaceModel/Summary.lean` was guarding against — and having succeeded, the guard became unsatisfiable: `assert_not_exists` registers a global entry that `#check_assertions` expects to be *satisfied* once the whole library is available, and nothing in the closure provides `Lake.Workspace` any more. `mathlib4`'s `MathlibTest.AssertImported` (`import Mathlib` plus `#check_assertions!`) therefore warns warning: MathlibTest/AssertImported.lean:9:0: ❌️ 'Lake.Workspace' (declaration) asserted in 'ImportGraph.WorkspaceModel.Summary'. and the `test` phase, which runs with `--iofail`, fails on it. There is no `✖` anywhere: the one warning is the whole failure. The same upstream PR added `ImportGraphTest.NoLakeAxioms`, which checks the property directly and strictly more thoroughly — the workspace and build modules absent from the imports of `ImportGraph` and `ImportGraph.Tools`, no `Lake.*` axioms in the environment, no leaked `ImportGraph.Lake.IO.getWorkspace` — so drop the stale assertion and point the module docstring at that test instead. Fixing it in `import-graph` rather than in the Mathlib test is deliberate: the alternative, making the assertion satisfiable again, means importing `Lake.Config.Workspace` into `MathlibTest/AssertImported.lean`, i.e. putting back into Mathlib's test environment the dependency import-graph#173 just removed. Upstream `main` still carries the stale line, so this wants to go to import-graph as well. Verified on `nightly-2026-10-08`: `import-graph` `lake build` (122 jobs) and `lake test` (143 jobs, `NoLakeAxioms` among them) pass; `mathlib4` `lake build Mathlib Archive Counterexamples Wanted cache --wfail` (18386 jobs, 8723 modules compiled from scratch), `lake test --iofail` (18908 jobs) and `lake lint` all pass. Note the edit invalidates the artifact cache for `import-graph` and everything downstream of it, so the next CI run rebuilds that subtree once. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Author
Build report for fix: mathlib4 breakage from the import-graph main mergeTurned green:
Stayed red
Stayed green
|
Contributor
Author
|
Superseded: mathlib4 fixed this upstream the other way round. |
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.
Run 37905266313 on
nightly-2026-10-08:mathlib4went red in itstestphase, having been green in the previous run. The only new commit isdownstream: update repo import-graph(494de84).mathlib4 — fixed in
import-graphThat merge brought in import-graph#173 (
80a81552, merged 08:25Z, eleven minutes before the run), which cutsLake.Config.WorkspaceandLake.Load.Workspaceout of the import closure ofImportGraphandImportGraph.Toolsby splitting the workspace-loading and cache-validation halves ofWorkspaceModel.Summary.Lakeapart. That is exactly what theassert_not_exists Lake.Workspace -- ensure we do not import deep lake internalsat the bottom of
ImportGraph/WorkspaceModel/Summary.leanwas guarding against — and having succeeded, the guard became unsatisfiable.assert_not_existsregisters a global entry that#check_assertionslater expects to be satisfied once the whole library is available, and nothing in the closure providesLake.Workspaceany more.MathlibTest/AssertImported.leanisimport Mathlibplus#check_assertions!, so it warnsand
lake test --iofailfails on it. There is no✖anywhere in the run: the single warning is the whole failure, andbuildandlintwere green.The same upstream PR added
ImportGraphTest/NoLakeAxioms.lean, which checks the property directly and strictly more thoroughly — the workspace and build modules absent from the imports ofImportGraphandImportGraph.Tools, noLake.*axioms in the environment, no leakedImportGraph.Lake.IO.getWorkspace— so this drops the stale assertion and points the module docstring at that test instead.Fixing it in
import-graphrather than in the Mathlib test is deliberate. The alternative — making the assertion satisfiable again — means importingLake.Config.WorkspaceintoMathlibTest/AssertImported.lean, i.e. putting back into Mathlib's test environment the dependency import-graph#173 just removed. Upstreammainstill carries the stale line, so this wants to go to import-graph as well;import-graphbuilds on a release toolchain and never builds Mathlib, so its own CI cannot see this.Verified on
nightly-2026-10-08import-graphlake buildimport-graphlake testImportGraphTest.NoLakeAxioms)mathlib4lake build Mathlib Archive Counterexamples Wanted cache --wfailmathlib4lake test --iofail#check_assertions!now silentmathlib4lake lintLinting passed for Mathlib)import-graphdefines no lint driver;reference-manualand theversorepos are untouched by this PR.Not in this PR
The rest of the red set is unchanged from the previous rounds and still covered by two open PRs:
versoby #145 andreference-manual(skipped behindverso, together withverso-slidesandverso-web-components) by #148. 494de84 touchesimport-graph/only, which is outside that red set's dependency closure, so their verification on this nightly carries over.masterneeds all three merged to go green.Note this edit invalidates the artifact cache for
import-graphand everything downstream of it —mathlib4,repl,cslib,doc-gen4and the rest — so the next CI run rebuilds that subtree once. The change is inert for every consumer other thanMathlibTest.AssertImported: anassert_not_existsentry is read by nothing but#check_assertions, and the only other use of that command in the tree,MathlibTest/AssertExists.lean, does not importMathliborimport-graph.