Skip to content

bump to Lean v4.32.0 & fix bugs - #195

Merged
Peiyang-Song merged 7 commits into
mainfrom
stable
Aug 18, 2026
Merged

bump to Lean v4.32.0 & fix bugs#195
Peiyang-Song merged 7 commits into
mainfrom
stable

Conversation

@Peiyang-Song

Copy link
Copy Markdown
Member

latest stable version.

@Peiyang-Song Peiyang-Song self-assigned this Jul 16, 2026
@Peiyang-Song

Copy link
Copy Markdown
Member Author

Merging after all tests pass.

Peiyang-Song and others added 4 commits August 17, 2026 23:15
…deps

- OpenBLAS: build with DYNAMIC_ARCH=1 so the shipped release artifact
  runtime-dispatches on CPU features instead of hardcoding whatever ISA
  extensions (e.g. AVX-512/cooperlake) happen to be on the CI build
  machine, which SIGILLs on older CPUs (#137).

- libleanffi: on Linux, fold a small glibc-version-compat shim and (when
  available) the system's static libstdc++ directly into ct2.o before
  archiving, so a downstream `lean_exe` -- which Lean links against its
  own bundled libc++, never libstdc++ -- no longer hits undefined-symbol
  link errors for libstdc++/glibc entry points pulled in via
  CTranslate2's headers. `lean_lib` dynlib targets never hit this since
  undefined symbols in a `-shared` object are tolerated and resolved at
  load time (#196).

- Pin the OpenBLAS and CTranslate2 git clones to known-good
  commits/tags instead of tracking their default branches unpinned. An
  unpinned OpenBLAS clone is exactly what broke PR #195's CI: a
  transient upstream regression (fixed in
  OpenMathLib/OpenBLAS@52f0572564, after our clone) made common.h fail
  to compile as C++.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
LeanCopilotTests was always a lean_lib, so CI never actually built a
lean_exe depending on Lean Copilot -- exactly the target class that
tripped the libstdc++ link failure in #196. Add a trivial
leanffi_exe_smoke_test lean_exe and build it in CI right after the main
build, before the (slower) model download/test steps.

Also document the fix and its one remaining edge case (building from
source without a static libstdc++.a available) in the README Caveats
section.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CI caught a real bug in the previous approach: folding libstdc++.a into
libleanffi.a via `ld -r` caused "duplicate symbol" link errors against
Lean's own statically-linked libc++.a. libstdc++ and libc++ both define
the same Itanium-ABI-mangled symbols for standard types with out-of-line
definitions (std::logic_error, the __cxa_* exception runtime, etc. --
that mangling carries no implementation-specific tag), so statically
linking both into one executable is a hard conflict, not just messy.

Keep the part that's actually safe and sufficient: bundling the tiny
glibc-compat shim as a plain extra archive member (no ABI surface
overlap with libc++, so no collision risk). For the libstdc++ symbols
themselves, downstream still needs a `moreLinkArgs` entry that links
libstdc++ *dynamically* (a .so, not a duplicated static copy) -- Lean's
own toolchain gives no way to inject that into a downstream lean_exe's
link line automatically. Document the complete, correct recipe in the
README instead of overclaiming a fully automatic fix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The smoke test was still failing in CI exactly as #196 describes,
because -- correctly -- libleanffi.a alone can't supply libstdc++ (see
the previous commit). Give the smoke test the same moreLinkArgs a
downstream project needs to add per the README, computed dynamically
(via `c++ -print-file-name=libstdc++.so`) instead of hardcoding a
distro-specific path, so CI validates the actual documented recipe end
to end rather than just asserting the gap exists.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Peiyang-Song

Copy link
Copy Markdown
Member Author

The bumps Lean Copilot to stable version Lean v4.32.0, fixes #137, fixes #196, and supercedes #197. Closing all three as a result. Merging this into main and releasing soon as a latest version.

@Peiyang-Song
Peiyang-Song merged commit 2a5cd0e into main Aug 18, 2026
4 checks passed
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.

1 participant