Skip to content

fix: verso breakage from the verso main merge (supersedes #142) - #145

Closed
downstream-lean4[bot] wants to merge 1 commit into
masterfrom
push-yrrvqwqyotkx
Closed

downstream-lean4[bot] wants to merge 1 commit into
masterfrom
push-yrrvqwqyotkx

Conversation

@downstream-lean4

Copy link
Copy Markdown
Contributor

master is red at verso since run 37777397573, which takes the critical reference-manual down with it through the skip chain, along with verso-slides and verso-web-components.

verso

Root cause. downstream: update repo verso (eff5981) merged verso main into the in-tree copy, and so brought in upstream's own verso#1015: the %example mechanism and the leanExampleProject command are gone. {leanExampleModule exampleMod …} runs subverso-extract-mod, which only imports the example module's .olean — the deleted leanExampleProject call had been building it as a side effect through SubVerso's examples facet. Upstream compensates with a lake build step in verso's own CI ("Build the website examples subproject"), and build.py runs only lake build/lake test/lake lint at the subrepo root, so nothing builds Examples.olean here:

error finding highlighted code: unknown module prefix 'Examples'
No directory 'Examples' or file 'Examples.olean' in the search path entries: …
error: test-projects/website/DemoSite/Blog/Subprojects.lean:121:15: Subproject 'exampleMod' not loaded

Fix. Build the module in loadModuleContent before running the extractor, exactly as Verso.Code.External already does for anchor-based examples. That makes the leanExampleModule path self-contained rather than dependent on a CI step, and is worth having upstream too.

This supersedes #142, which carried the same hunk plus a hand port of verso#1015, made back when the in-tree verso still lagged its main-tracked consumers. The bot merge has now brought upstream's own version of every ported hunk, so #142 is CONFLICTING and this one hunk is all that is left of it; closing it in favour of this PR.

Verified on nightly-2026-10-07, with verso/test-projects/website-examples/.lake/build removed first — a warm nested build directory hides the failure:

repo phases
verso lake build (1294 jobs, incl. DemoSite.Blog.Subprojects), lake test (768 passed, 0 failed)
verso-web-components lake build (475 jobs) — build-only
verso-slides lake build (755 jobs), lake test -- --no-playwright (51 + 24 + 36 tests, 17 validation cases)
reference-manual lake build (1583 jobs) — build-only

Note that lake test in verso runs lake update verso in two of the nested test projects, which rewrites test-projects/literate-{config,multi-root}/lake-manifest.json in the working copy; those changes are test output and are not part of this PR.

Left unfinished

mathlib4 (critical), and behind it repl's test phase and cslib: grind throws the internal error ring term has not been internalized at 7 sites in 4 modules — Mathlib.RingTheory.ZMod.UnitsCyclic, Mathlib.NumberTheory.SumTwoSquares, Mathlib.RingTheory.Polynomial.Eisenstein.IsIntegral and Archive.Imo.Imo2025Q3. This is the second regression from lean4#15506, reported on 2026-10-07 with a core-only repro. Mathlib's nightly-testing has meanwhile adapted the one site that was reported then (Int.sq_emod_four_eq_one_of_odd, now an #adaptation_note + rw), which unblocked the 4728 modules behind it and uncovered these four; everything else in Mathlib builds. The grind bug itself cannot be fixed downstream.

So master does not go green on this nightly; this PR takes verso and the three repos skipped behind it out of the red set.

`downstream: update repo verso` (eff5981) merged verso `main` into the in-tree
copy, bringing in [verso#1015](leanprover/verso#1015):
the `%example`-based `leanExampleProject` command is gone, and with it the
SubVerso `examples` facet that used to build the nested example project's
module as a side effect. `{leanExampleModule exampleMod …}` runs
`subverso-extract-mod`, which only *imports* the module's `.olean`, so
`DemoSite.Blog.Subprojects` failed with

    error finding highlighted code: unknown module prefix `Examples`
    error: test-projects/website/DemoSite/Blog/Subprojects.lean:121:15: Subproject 'exampleMod' not loaded

Upstream compensates with a `lake build` step in verso's own CI, which
`build.py` never runs here. Build the module in `loadModuleContent` before
running the extractor, exactly as `Verso.Code.External` already does for
anchor-based examples.

This is the surviving hunk of the now superseded #142: everything else in that
PR was its port of verso#1015, which the bot merge has since brought in from
upstream.
@downstream-lean4

Copy link
Copy Markdown
Contributor Author

Build report for fix: verso breakage from the verso main merge

Turned green:

Repo Critical Build Test Lint
reference-manual ✅ ✅ in 1m 45s ⏭️ ⏭️
verso ✅ in 1m 21s ✅ in 3m 23s ⏭️
verso-slides ✅ in 19s ✅ in 8s ⏭️
verso-web-components ✅ in 7s ⏭️ ⏭️
Stayed red
Repo Critical Build Test Lint
mathlib4 ✅ 🟥 in 1m 1s ⏭️ ⏭️
cslib 🛑 by mathlib4 ⏭️ ⏭️
repl ✅ in 0s 🟥 in 25s ⏭️
Stayed green
Repo Critical Build Test Lint
aesop ✅ ✅ in 0s ✅ in 4s ⏭️
batteries ✅ ✅ in 0s ✅ in 3s ✅ in 2s
import-graph ✅ ✅ in 2s ✅ in 4s ⏭️
lean4-cli ✅ ✅ in 0s ✅ in 0s ⏭️
plausible ✅ ✅ in 0s ✅ in 2s ⏭️
ProofWidgets4 ✅ ✅ in 1s ✅ in 1s ⏭️
quote4 ✅ ✅ in 0s ✅ in 1s ⏭️
BibtexQuery ✅ in 3s ⏭️ ⏭️
comparator ✅ in 2s ⏭️ ⏭️
doc-gen4 ✅ in 7s ⏭️ ⏭️
illuminate ✅ in 1s ✅ in 10s ⏭️
lean4-unicode-basic ✅ in 0s ⏭️ ⏭️
lean4export ✅ in 0s ✅ in 7s ⏭️
LeanSearchClient ✅ in 0s ✅ in 0s ⏭️
leansqlite ✅ in 7s ✅ in 20s ⏭️
nerodia ✅ in 1s ✅ in 21s ⏭️

View run

Kha pushed a commit that referenced this pull request Oct 10, 2026
`master` is red on `nightly-2026-10-08` ([run
37811116340](https://github.com/leanprover/downstream-lean4/actions/runs/37811116340)):
`verso` fails to build and `reference-manual`, `verso-slides` and
`verso-web-components` are skipped behind it.

The `verso` failure is unchanged from the last four rounds and is fixed
by the still-open #145. Building the skipped repos locally on top of
that PR's hunk uncovers one more failure, which CI has never reached —
hence this PR.

## reference-manual

lean4#15533 (`refactor: implement String.toList in Lean`) reimplements
`String.toList` in Lean and, since the deprecation was nearly a year
old, removes every trace of `String.data`. The `Palindrome` example in
`Manual/Language/InductiveTypes/Structures.lean`, which illustrates a
non-default structure constructor name, still phrased its invariant with
`text.data`:

```
error: Manual/Language/InductiveTypes/Structures.lean:192:23: Invalid field `data`: The environment
does not contain `String.data`, so it is not possible to project the field `data` from an expression
error: Manual/Language/InductiveTypes/Structures.lean:189:0: No error expected in code block, one occurred
```

Use `text.toList` instead. `String.toList` is `noncomputable` now, which
does not matter here: the field is a `Prop`.

## Verified

All on `nightly-2026-10-08`, in a checkout carrying #145's hunk:

| repo | result |
| --- | --- |
| `reference-manual` | `lake build` green, 1583 jobs (no test or lint
driver) |
| `verso` | `lake build` green, 1294 jobs; `lake test` 768 passed, 0
failed |
| `verso-web-components` | `lake build` green, 475 jobs |
| `verso-slides` | `lake build` green, 755 jobs; `lake test --
--no-playwright` green |

`verso`'s `DemoSite.Blog.Subprojects` was re-elaborated with
`test-projects/website-examples/.lake/build` removed, so #145's hunk was
genuinely exercised rather than replayed from the artifact cache.

## Not covered

This PR alone does not make `master` green: `verso` still needs #145,
which has been open since 2026-10-07. Its own CI run here will show
`verso` red and `reference-manual` skipped for exactly that reason.

<!-- downstream-watch: unattended -->

Co-authored-by: downstream-lean4[bot] <downstream-lean4[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <[email protected]>
robsimmons added a commit that referenced this pull request Oct 12, 2026
#145 proposes a fix and I'm likely to make something similar on
lean4-nightly, but silences the problem in the meantime.
@robsimmons

Copy link
Copy Markdown
Contributor

closed (for downstream-lean's purposes) in favor of the unprincipled fix, #157

Garmelon pushed a commit that referenced this pull request Oct 13, 2026
#145 proposes a fix and I'm likely to make something similar on
lean4-nightly, but silences the problem in the meantime.
@robsimmons robsimmons closed this Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant