Skip to content

Try every jixia patch instead of hardcoding one Lean release - #25

Merged
Gabrielebattimelli merged 1 commit into
mainfrom
fix/jixia-4.33
Aug 18, 2026
Merged

Try every jixia patch instead of hardcoding one Lean release#25
Gabrielebattimelli merged 1 commit into
mainfrom
fix/jixia-4.33

Conversation

@Gabrielebattimelli

Copy link
Copy Markdown
Member

Why

PhysLib moved to Lean v4.33.0, so the v4.32.0 patch stopped producing a compiling jixia and indexing halted again:

Warning: jixia failed to build against PhysLib's Lean toolchain (leanprover/lean4:v4.33.0)
Error: Process completed with exit code 1

That is the third Lean bump since July, while upstream jixia has been on v4.29.0 since April. Pinning the workflow to one patch guarantees this recurs every time.

(The gate correctly failed the run rather than reporting green over a no-op — the fail-loudly behaviour working as intended. The site was never affected.)

What

  • patches/jixia-lean-4.33.patch — taken verbatim from jarfo/jixia@v4.33.0-rc2, which targets this release directly. Verified with a clean-tree build against v4.33.0: 40/40 jobs.
  • Generic patch loop. Build jixia now tries upstream unpatched first, then every patches/jixia-lean-*.patch in turn, reverting any that applies but fails to build.
  • patches/README.md documenting how to produce the next one.

Why a loop rather than picking by version

Both patches apply cleanly to the same code regions — they differ only in whether docString? takes one constructor field (4.33) or two (4.32). So git apply succeeding proves nothing; only a successful build does.

Verified by simulating exactly what CI will do:

4.32 patch on Lean 4.33  -> error: Invalid ⟨...⟩ notation ... build failed
revert, apply 4.33 patch -> Build completed successfully (40 jobs)

Effect

Supporting a new Lean release is now one new patch file, no workflow change. Upstream is still tried first, so the day jixia catches up we return to stock automatically and the whole patches/ directory can be deleted.

PhysLib moved to Lean v4.33.0, so the v4.32.0 patch no longer produced a
compiling jixia and indexing stopped again. That is the third Lean bump since
July while upstream jixia has sat on v4.29.0 since April, so pinning the
workflow to a single patch guarantees this recurs.

Add patches/jixia-lean-4.33.patch, taken verbatim from jarfo/jixia@v4.33.0-rc2,
which targets this release directly. Verified with a clean-tree build: 40/40.

Make the build step try upstream first, then every patches/jixia-lean-*.patch
in turn, reverting any that applies but fails to build. Both patches apply
cleanly to the same regions -- they differ only in whether docString? takes one
field or two -- so applying successfully proves nothing and only a build does.
Verified by applying the v4.32.0 patch under v4.33.0, watching it fail, and
confirming the loop reverts and recovers with the v4.33.0 patch.

Supporting a new Lean release is now a matter of dropping in another patch file,
with no workflow change. patches/README.md documents how to produce one,
including the clean-build requirement -- a cached build previously hid a failure
in Analyzer/Process.lean that only surfaced in CI.
Copilot AI lite review requested due to automatic review settings August 18, 2026 15:18
@Gabrielebattimelli
Gabrielebattimelli merged commit 914dbe1 into main Aug 18, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the weekly indexing workflow so jixia is rebuilt against PhysLib’s current Lean toolchain by attempting upstream first and then iterating through versioned compatibility patches, reducing breakage on frequent Lean bumps.

Changes:

  • Add a new jixia compatibility patch for Lean v4.33.0.
  • Update the Build jixia workflow step to try upstream unpatched, then try each patches/jixia-lean-*.patch until one successfully builds (reverting failed patches).
  • Add patches/README.md documenting how the patch mechanism works and how to produce new patches.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/weekly-index.yml Build jixia now loops through all compatibility patches after upstream build fails.
patches/jixia-lean-4.33.patch Introduces a patch to make jixia compile against Lean v4.33.0.
patches/README.md Documents the rationale and workflow behavior for jixia compatibility patches.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +179 to +186
git apply "$PATCH"
if lake build; then
echo "jixia built with $NAME."
exit 0
fi
echo " $NAME: applied but did not build, reverting"
git apply -R "$PATCH"
lake clean || true
Comment on lines +175 to +178
if ! git apply --check "$PATCH" 2>/dev/null; then
echo " $NAME: does not apply, skipping"
continue
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants