Skip to content

Meson: reject incompatible eclib and fall back to 20250627 - #42982

Merged
vbraun merged 1 commit into
sagemath:developfrom
dimpase:fix/eclib-meson-fallback
Oct 18, 2026
Merged

vbraun merged 1 commit into
sagemath:developfrom
dimpase:fix/eclib-meson-fallback

Conversation

@dimpase

@dimpase dimpase commented Oct 15, 2026

Copy link
Copy Markdown
Member

Meson currently accepts any eclib version >=20231211. With Debian forky's eclib 20260707-3, it selects an API that Sage's bindings do not support: scalar is now an INT class, modular-symbol constructors and methods changed, and the newer headers also expose PARI namespace/signal-header errors. This caused the Debian job failure on #42960.

Limit system eclib to the API supported through 20250627 and add a Meson fallback to that version, using the same upstream release archive and SHA-256 as Sage's SPKG. The existing lower bound is retained for compatible conda packages that report an older pkg-config version. Enable fallback for the default auto feature so an incompatible or missing system library does not simply remove eclib functionality; preserve explicit feature disabling and Meson's fallback controls. Automatic fallback stays off on Windows, where PARI is unavailable.

The overlay builds the upstream library's 78 compilation units with FLINT and NTL multiprecision, without Boost threading, matching the SPKG configuration. A shared library keeps eclib's state common to Sage's four extension modules. This PR changes dependency selection, without adapting the bindings to the newer API.

Validation:

  • macOS arm64, compatible system eclib 20250627: selected the system library; compiled and ran checks for modular-symbol dimensions, Hecke matrices, scalar arithmetic, and elliptic-curve conductor.
  • macOS arm64, forced fallback: built eclib and all four Sage eclib extension modules; 579 existing doctests passed across homspace.pyx, mat.pyx, mwrank.pyx, newforms.pyx, and interface.py, with import paths verified to use the newly built modules.
  • Debian forky arm64, GCC 16.2, system eclib 20260707-3 installed: automatically rejected the system version and built 20250627. The arithmetic checks passed; all four generated Sage eclib bindings compiled and linked successfully, including the headers implicated in the original signal errors. Runtime linkage was verified to use the fallback library rather than libec16.
  • python3 build/test/test_eclib_meson.py -v: seven regression tests covering compatible/incompatible/missing system metadata, feature disabling/enabling, forced/forbidden fallback, and the Windows selection policy. These selection tests use fixtures and do not download or compile eclib.
  • Ruff checks in both CI modes, Meson formatting, and git diff --check passed.

The local checks cover the dependency and bindings; they are not a complete Sage rebuild.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

None. Based directly on develop; independent of #42960.

@github-actions

Copy link
Copy Markdown

Documentation preview for this PR (built with commit bdbfc73; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@dimpase

dimpase commented Oct 17, 2026

Copy link
Copy Markdown
Member Author

@tobiasdiez - look at the wrap for eclib written here. Looks like we can do all the potentially needed deps this way now...

@vbraun
vbraun merged commit 0af09ea into sagemath:develop Oct 18, 2026
28 of 33 checks passed
@tobiasdiez

tobiasdiez commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

@tobiasdiez - look at the wrap for eclib written here. Looks like we can do all the potentially needed deps this way now...

Awesome! I had the hope that something along those lines indeed works for most deps, but its good to have the confirmation! In my opinion, it is definitely the cleaner approach than what is currently in sage-the-distro.

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.

3 participants