Skip to content

fix: verso breakage from the verso-web-components subverso bump - #142

Closed
downstream-lean4[bot] wants to merge 2 commits into
masterfrom
push-kqyroxnsrxmp
Closed

downstream-lean4[bot] wants to merge 2 commits into
masterfrom
push-kqyroxnsrxmp

Conversation

@downstream-lean4

@downstream-lean4 downstream-lean4 Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

master is red at verso-web-components since run 37511223048, which takes the critical reference-manual with it through the skip chain.

verso

Root cause. downstream: update repo verso-web-components (8b98517) moved that repo's subverso pin from d047cb48 to 892d6dc5, i.e. past subverso#243 ("remove old examples mechanism"), which deleted SubVerso.Examples.loadExamples, the Example type and SubVerso.Examples.Env.

subverso is not a subrepo, so every consumer resolves it from its own lake-manifest.json. The in-tree verso is tracked on nightly-testing, which has not merged main since 2026-10-01 and still used all three. So verso's own sources failed, but only when built from verso-web-components:

error: src/verso-blog/VersoBlog.lean:42:24: Unknown constant `SubVerso.Examples.loadExamples`
error: src/verso-blog/VersoBlog.lean:213:26: Application type mismatch: …
error: src/verso-blog/VersoBlog.lean:241:25: Unknown identifier `loadExamples`

Fix. Port verso#1015, which made this adaptation on verso main:

  • src/verso-blog/VersoBlog.lean — the blog genre's leanExampleProject and leanCommand commands and its leanTerm role now throw an error that names the anchor-based replacements and links to the migration instructions; LeanExampleData loses its subproject constructor, ExampleMessages.messages loses the List (MessageSeverity × String) summand, and leanOutput collapses to the single remaining case. The html%{…} and Html.element adaptations the monorepo carries on top of nightly-testing are preserved.
  • src/verso-literate/VersoLiterateMain.lean — drop the SubVerso.Examples.Env import, which no longer exists at the new pin.
  • test-projects/website/DemoSite/Blog/Subprojects.lean, test-projects/website-examples/{Examples.lean,Examples/Basic.lean} and the release note taken from upstream verbatim: all three sources were byte-identical to nightly-testing, so there was nothing to merge.

Second commit: the port was incomplete

The first commit's CI run (37522088747) traded one failure for another: verso-web-components was fixed, but verso itself went red at DemoSite.Blog.Subprojects, and verso-slides, verso-web-components and reference-manual were all skipped behind it.

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

{leanExampleModule exampleMod …} runs lake exe subverso-extract-mod Examples in the nested
example project, and that extractor only imports the module's .olean — it does not build it.
Until verso#1015 the preceding {leanExampleProject examples …} had built it as a side effect, via
SubVerso's examples facet (let modJob ← mod.olean.fetch). verso#1015 removed that command and
compensated in verso's own CI, which gained nothing here — it dropped a line:

 pushd test-projects/website-examples
 lake build
-lake build :examples
 popd

The monorepo's build.py runs only lake build in each subrepo, so there is no such step and
nothing built Examples.olean any more. Rather than reach for repos.toml, build the module in
loadModuleContent before running the extractor, exactly as Verso.Code.External already does for
anchor-based examples (lake build subverso-extract-mod, lake build +<mod>:highlighted). That
makes the leanExampleModule path self-contained and is worth having upstream too.

The second commit also takes verso#1015's remaining hunks, which the first one missed: the
subverso pins in verso's own manifest and in the six nested test projects, at upstream's exact
revisions — b15c6a08 (subverso main at #243) for the three on the monorepo toolchain,
1f548ab5 (the matching auto-generated release commit) for the four pinned to v4.31.0. These are
upstream's own generated values rather than hand-picked pins; lake update was not an option for
the nested projects, which pin v4.31.0 and would get an incompatible main HEAD.

Note that bumping verso's own subverso pin invalidates the artifact cache for verso and
everything downstream of it, so the next run rebuilds that subtree once.

Verified locally on nightly-2026-10-06, with verso/test-projects/website-examples/.lake/build
removed first — the first commit's local run passed only because that directory was still warm from
an earlier build, which is exactly what CI does not have:

repo phases
verso lake build (1267 jobs, incl. DemoSite.Blog.Subprojects), lake test (720 passed, 0 failed)
verso-web-components lake build (469 jobs) — the originally failing repo, build-only
verso-slides lake build (749 jobs), lake test -- --no-playwright
reference-manual lake build (1577 jobs), with #140 applied on top — build-only

This will recur. David Thrane Christiansen noted on 2026-10-03 that verso main cannot be merged into nightly-testing until a nightly ships the rewritten parser or verso's new parser tests are turned off, so the in-tree verso will keep lagging its main-tracked consumers and further main hunks will have to be ported the same way.

Left unfinished

  • mathlib4 (critical) and behind it repl's test phase and cslib: grind throws the internal error unknown free variable on List.pairwise_iff_forall_infix, from lean4#15506. Nothing downstream can adapt to that; lean4#15524 fixes it upstream and lands with the next nightly. Already reported.
  • reference-manual's own two stale expectation blocks are in fix: reference-manual breakage from nightly-2026-10-06 #140, still open — that is why it was applied locally above rather than here.

So master does not go green on this nightly; this PR takes verso-web-components and the reference-manual skip out of the red set.

`downstream: update repo verso-web-components` (8b98517) moved
`verso-web-components`'s `subverso` pin from `d047cb48` to `892d6dc5`, which
is past subverso#243 ("remove old examples mechanism"). `subverso` is not a
subrepo, so each consumer resolves it from its own `lake-manifest.json` — and
the in-tree `verso` (tracked on `nightly-testing`, which has not merged `main`
since 2026-10-01) still used `SubVerso.Examples.loadExamples`, the `Example`
type and `SubVerso.Examples.Env`. Hence `verso`'s own sources failed, but only
when built from `verso-web-components`: `Unknown constant
SubVerso.Examples.loadExamples` in `src/verso-blog/VersoBlog.lean`.

Ports verso#1015, which did this adaptation on verso `main`: the blog genre's
`leanExampleProject`/`leanCommand`/`leanTerm` now throw an error pointing at
the anchor-based replacements, `ExampleMessages` loses the subproject summand,
and `test-projects/website{,-examples}` plus the release note come over from
upstream verbatim (those three files were identical to `nightly-testing`). The
`html%{…}`/`Html.element` adaptations the monorepo carries on top of
`nightly-testing` are kept.

Verified: `verso-web-components` `lake build`; `verso` `lake build` +
`lake test` (720 passed); `verso-slides` `lake build` +
`lake test -- --no-playwright`.
Completes the port of verso#1015 in the parent commit. Upstream dropped
`{leanExampleProject ...}`, whose SubVerso `examples` facet used to build the
example project as a side effect, and compensated in verso's own CI with an
explicit `lake build` in `test-projects/website-examples`. The monorepo runs
only `lake build` in each subrepo, so nothing built `Examples.olean` any more
and `DemoSite.Blog.Subprojects` failed with

    error finding highlighted code: unknown module prefix 'Examples'

Build the module in `loadModuleContent` before running `subverso-extract-mod`,
the way `Verso.Code.External` already does for anchor-based examples, so the
`leanExampleModule` path is self-contained.

Also takes verso#1015's remaining hunks: the `subverso` pins in verso's own
manifest and in the six nested test projects (upstream's exact revisions —
`b15c6a08` for the ones on the monorepo toolchain, `1f548ab5` for the four
pinned to v4.31.0).

Co-Authored-By: Claude Opus 5 <[email protected]>
@downstream-lean4

Copy link
Copy Markdown
Contributor Author

Build report for fix: verso example-module loader must build the module it extracts

Turned green:

Repo Critical Build Test Lint
verso-web-components ✅ in 7s ⏭️ ⏭️
Stayed red
Repo Critical Build Test Lint
mathlib4 ✅ 🟥 in 12s ⏭️ ⏭️
reference-manual ✅ 🟥 in 8m 20s ⏭️ ⏭️
cslib 🛑 by mathlib4 ⏭️ ⏭️
repl ✅ in 0s 🟥 in 23s ⏭️
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 ⏭️
verso ✅ in 1m 30s ✅ in 2m 54s ⏭️
verso-slides ✅ in 16s ✅ in 9s ⏭️

View run

@downstream-lean4

Copy link
Copy Markdown
Contributor Author

Superseded by #145. downstream: update repo verso (eff5981) merged verso main into the in-tree copy, so upstream's own version of every hunk this PR ported from verso#1015 is now on master and this branch is CONFLICTING. The one hunk upstream never needed — building the example module in loadModuleContent, since verso compensates for that in its own CI and build.py does not run it — is what still fixes the current breakage, and #145 carries it alone, re-verified on nightly-2026-10-07.

@downstream-lean4 downstream-lean4 Bot closed this Oct 8, 2026
@downstream-lean4
downstream-lean4 Bot deleted the push-kqyroxnsrxmp branch October 8, 2026 13:20
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.

0 participants