Repository navigation
Use the configured PARI installation when building cypari2 - #42902
Merged
Merged
Conversation
Member
Author
|
darwin-27 CI uses an incompatible with cypari 2.2.4 pari 2.19 from Homebrew. No wonder it failed |
|
Documentation preview for this PR (built with commit 603c93d; changes) is ready! 🎉 |
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
Oct 4, 2026
sagemathgh-42902: Use the configured PARI installation when building cypari2 When Sage builds its own PARI on macOS while Homebrew PARI is installed, cypari2's Meson search can select Homebrew's headers, library, and function list instead. Its generator then uses Sage's `gphelp` with a different PARI function list. With Sage's PARI 2.17.1 and Homebrew's 2.19.0, this reproduces the failure `no help found for 'algbasistoquat'` reported in sagemath#42900. Pass Sage's configured PARI prefix to cypari2 so the installation selected by configure is also used for the Python extension. This covers both Sage-built PARI and external installations outside Homebrew on macOS. - Record the external PARI prefix from the validated `gp` executable, using the same prefix inference as the existing gp2c check, including the `/bin` to `/usr/bin` case. Configure already checks that GP and libpari have matching versions and data directories. - Pass that prefix through meson-python's `setup-args` in the cypari installer. - Backport cypari2's `pari_prefix` Meson option from sagemath/cypari2#233 to Sage's current cypari2 2.2.4. Skip Homebrew discovery when an explicit prefix is supplied. - Bump the SPKG patch level to `2.2.4.p1` so existing installations rebuild. The lcalc update discussed in sagemath#42900 is separate in sagemath#42881. This PR does not upgrade cypari2 or address its separate PARI 2.19 API compatibility changes. Validation on macOS 27 / arm64 / Python 3.14.7: - Built Sage's exact PARI 2.17.1 source, with its Sage patch, using the PARI SPKG installation script in a temporary prefix. - Reproduced the issue with cypari2 commit `3357ea155053c964b6e2212292b377024814c664`: without the prefix option, Meson selects Homebrew 2.19.0 while `gphelp` comes from 2.17.1, and generation fails on `algbasistoquat`; supplying the prefix makes configuration succeed. - Built and installed patched cypari2 2.2.4 using Sage's installer against the Sage-built PARI. Verified the linked library, version, and data directory; all 2,477 cypari2 doctests passed. - Ran a full Sage configure with `--with-system-pari=force --with- system-cypari=no`, selecting the temporary PARI 2.17.1 as an external installation while Homebrew 2.19.0 remained installed. Used the resulting build environment configuration with the cypari installer. The extension links to the selected external library and all 2,477 doctests passed. - A full configure with Homebrew PARI records `/opt/homebrew` as its prefix. Also verified the Sage-built prefix fallback and `/bin` to `/usr` handling with an Autoconf harness using the actual PARI post- check macro. - Patched cypari2 2.2.4 also builds against a separate external PARI 2.17.4 without a prefix option; all 2,477 doctests passed. The newer cypari2 source from the issue builds and passes smoke checks with Homebrew 2.19.0. Both unpatched and patched cypari2 2.2.4 fail identically against 2.19.0's changed `initprimetable` API, confirming that incompatibility is unrelated to this patch. - Shell syntax checks and `git diff --check` passed. ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] 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. URL: sagemath#42902 Reported by: Dima Pasechnik Reviewer(s):
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
Oct 6, 2026
sagemathgh-42902: Use the configured PARI installation when building cypari2 When Sage builds its own PARI on macOS while Homebrew PARI is installed, cypari2's Meson search can select Homebrew's headers, library, and function list instead. Its generator then uses Sage's `gphelp` with a different PARI function list. With Sage's PARI 2.17.1 and Homebrew's 2.19.0, this reproduces the failure `no help found for 'algbasistoquat'` reported in sagemath#42900. Pass Sage's configured PARI prefix to cypari2 so the installation selected by configure is also used for the Python extension. This covers both Sage-built PARI and external installations outside Homebrew on macOS. - Record the external PARI prefix from the validated `gp` executable, using the same prefix inference as the existing gp2c check, including the `/bin` to `/usr/bin` case. Configure already checks that GP and libpari have matching versions and data directories. - Pass that prefix through meson-python's `setup-args` in the cypari installer. - Backport cypari2's `pari_prefix` Meson option from sagemath/cypari2#233 to Sage's current cypari2 2.2.4. Skip Homebrew discovery when an explicit prefix is supplied. - Bump the SPKG patch level to `2.2.4.p1` so existing installations rebuild. The lcalc update discussed in sagemath#42900 is separate in sagemath#42881. This PR does not upgrade cypari2 or address its separate PARI 2.19 API compatibility changes. Validation on macOS 27 / arm64 / Python 3.14.7: - Built Sage's exact PARI 2.17.1 source, with its Sage patch, using the PARI SPKG installation script in a temporary prefix. - Reproduced the issue with cypari2 commit `3357ea155053c964b6e2212292b377024814c664`: without the prefix option, Meson selects Homebrew 2.19.0 while `gphelp` comes from 2.17.1, and generation fails on `algbasistoquat`; supplying the prefix makes configuration succeed. - Built and installed patched cypari2 2.2.4 using Sage's installer against the Sage-built PARI. Verified the linked library, version, and data directory; all 2,477 cypari2 doctests passed. - Ran a full Sage configure with `--with-system-pari=force --with- system-cypari=no`, selecting the temporary PARI 2.17.1 as an external installation while Homebrew 2.19.0 remained installed. Used the resulting build environment configuration with the cypari installer. The extension links to the selected external library and all 2,477 doctests passed. - A full configure with Homebrew PARI records `/opt/homebrew` as its prefix. Also verified the Sage-built prefix fallback and `/bin` to `/usr` handling with an Autoconf harness using the actual PARI post- check macro. - Patched cypari2 2.2.4 also builds against a separate external PARI 2.17.4 without a prefix option; all 2,477 doctests passed. The newer cypari2 source from the issue builds and passes smoke checks with Homebrew 2.19.0. Both unpatched and patched cypari2 2.2.4 fail identically against 2.19.0's changed `initprimetable` API, confirming that incompatibility is unrelated to this patch. - Shell syntax checks and `git diff --check` passed. ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] 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. URL: sagemath#42902 Reported by: Dima Pasechnik Reviewer(s):
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
Oct 8, 2026
sagemathgh-42902: Use the configured PARI installation when building cypari2 When Sage builds its own PARI on macOS while Homebrew PARI is installed, cypari2's Meson search can select Homebrew's headers, library, and function list instead. Its generator then uses Sage's `gphelp` with a different PARI function list. With Sage's PARI 2.17.1 and Homebrew's 2.19.0, this reproduces the failure `no help found for 'algbasistoquat'` reported in sagemath#42900. Pass Sage's configured PARI prefix to cypari2 so the installation selected by configure is also used for the Python extension. This covers both Sage-built PARI and external installations outside Homebrew on macOS. - Record the external PARI prefix from the validated `gp` executable, using the same prefix inference as the existing gp2c check, including the `/bin` to `/usr/bin` case. Configure already checks that GP and libpari have matching versions and data directories. - Pass that prefix through meson-python's `setup-args` in the cypari installer. - Backport cypari2's `pari_prefix` Meson option from sagemath/cypari2#233 to Sage's current cypari2 2.2.4. Skip Homebrew discovery when an explicit prefix is supplied. - Bump the SPKG patch level to `2.2.4.p1` so existing installations rebuild. The lcalc update discussed in sagemath#42900 is separate in sagemath#42881. This PR does not upgrade cypari2 or address its separate PARI 2.19 API compatibility changes. Validation on macOS 27 / arm64 / Python 3.14.7: - Built Sage's exact PARI 2.17.1 source, with its Sage patch, using the PARI SPKG installation script in a temporary prefix. - Reproduced the issue with cypari2 commit `3357ea155053c964b6e2212292b377024814c664`: without the prefix option, Meson selects Homebrew 2.19.0 while `gphelp` comes from 2.17.1, and generation fails on `algbasistoquat`; supplying the prefix makes configuration succeed. - Built and installed patched cypari2 2.2.4 using Sage's installer against the Sage-built PARI. Verified the linked library, version, and data directory; all 2,477 cypari2 doctests passed. - Ran a full Sage configure with `--with-system-pari=force --with- system-cypari=no`, selecting the temporary PARI 2.17.1 as an external installation while Homebrew 2.19.0 remained installed. Used the resulting build environment configuration with the cypari installer. The extension links to the selected external library and all 2,477 doctests passed. - A full configure with Homebrew PARI records `/opt/homebrew` as its prefix. Also verified the Sage-built prefix fallback and `/bin` to `/usr` handling with an Autoconf harness using the actual PARI post- check macro. - Patched cypari2 2.2.4 also builds against a separate external PARI 2.17.4 without a prefix option; all 2,477 doctests passed. The newer cypari2 source from the issue builds and passes smoke checks with Homebrew 2.19.0. Both unpatched and patched cypari2 2.2.4 fail identically against 2.19.0's changed `initprimetable` API, confirming that incompatibility is unrelated to this patch. - Shell syntax checks and `git diff --check` passed. ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] 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. URL: sagemath#42902 Reported by: Dima Pasechnik Reviewer(s):
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When Sage builds its own PARI on macOS while Homebrew PARI is installed, cypari2's Meson search can select Homebrew's headers, library, and function list instead. Its generator then uses Sage's
gphelpwith a different PARI function list. With Sage's PARI 2.17.1 and Homebrew's 2.19.0, this reproduces the failureno help found for 'algbasistoquat'reported in #42900.Pass Sage's configured PARI prefix to cypari2 so the installation selected by configure is also used for the Python extension. This covers both Sage-built PARI and external installations outside Homebrew on macOS.
gpexecutable, using the same prefix inference as the existing gp2c check, including the/binto/usr/bincase. Configure already checks that GP and libpari have matching versions and data directories.setup-argsin the cypari installer.pari_prefixMeson option from Fix PARI 2.19 precision handling for L-functions and eigenvectors cypari2#233 to Sage's current cypari2 2.2.4. Skip Homebrew discovery when an explicit prefix is supplied.2.2.4.p1so existing installations rebuild.The lcalc update discussed in #42900 is separate in #42881. This PR does not upgrade cypari2 or address its separate PARI 2.19 API compatibility changes.
Validation on macOS 27 / arm64 / Python 3.14.7:
3357ea155053c964b6e2212292b377024814c664: without the prefix option, Meson selects Homebrew 2.19.0 whilegphelpcomes from 2.17.1, and generation fails onalgbasistoquat; supplying the prefix makes configuration succeed.--with-system-pari=force --with-system-cypari=no, selecting the temporary PARI 2.17.1 as an external installation while Homebrew 2.19.0 remained installed. Used the resulting build environment configuration with the cypari installer. The extension links to the selected external library and all 2,477 doctests passed./opt/homebrewas its prefix. Also verified the Sage-built prefix fallback and/binto/usrhandling with an Autoconf harness using the actual PARI post-check macro.initprimetableAPI, confirming that incompatibility is unrelated to this patch.git diff --checkpassed.📝 Checklist
⌛ Dependencies
None.