Migrate to meson build system with PPL 1.2 - #38
Conversation
|
This should not bundle ppl unconditionally. ppl is relatively popular library and is available on many systems. While That is, to get the correct CXXFLAGS (important for C++ compatibility), one can just get them by calling |
Since the traditional wheel build also pack ppl and others into wheel. |
|
one does not need to build a dylib from source in order to pack it into a wheel. |
OK, Then I try to find ppl. If do not find then use subproject. but for wheel build. I think it is better to build everything static. |
|
I don't see how it's better. If you have a dylib on your system, you want to reuse it |
because it will let user just pip install pplpy, then the user can run this without install some system packages |
|
Now, if you install libppl-dev and ppl-dev. it can build from system's ppl. If not, it will run a subproject. |
there is a number of reasons why it's less preferable: @orlitzky has a good answer I am sure |
|
A good compromise is to try to detect ppl and if not available use it from a subproject. But pls don't include the source files directly, but use a wrap (eg https://github.com/dimpase/primecountpy/blob/master/subprojects/primecount.wrap): https://mesonbuild.com/Wrap-dependency-system-manual.html |
|
There is a good list at https://wiki.gentoo.org/wiki/Why_not_bundle_dependencies but even that is missing some things like needing to duplicate patches to fix the build with newer compilers, and the ways various licenses change when you are copy/pasting code rather than linking. And who wants to install pplpy if they don't have PPL first? |
yeah, vendoring the sources of ppl is totally unnecessary - I haven't looked at the implementation details yet. |
Well, from a user's perspective installing a binary wheel of pplpy that includes PPL is definitively more friendly than having to install PPL first manually, and then building pplpy from source. |
tobiasdiez
left a comment
There was a problem hiding this comment.
Thanks. This looks prettyy good to me. A few smaller suggestions/nit-picks from my side.
|
@dimpase @tobiasdiez can you review this again? |
tobiasdiez
left a comment
There was a problem hiding this comment.
Just a few minor suggestions
|
Thanks, I will try to apply this. |
c65430c to
150a1df
Compare
|
It is very hard to debug here |
I can not let cibuildwheel linux subproject ppl to find subproject gmp. but macos is ok. it seems a bug in meson build system |
|
I think you just forgot to specify them as dependencies of the subproject: https://github.com/sagemath/sage/blob/e37154cba140e8fc6ba3220c558cd3e8ada228ad/subprojects/packagefiles/maxima/meson.build#L31 |
still can not find gmp in cibuildwheel. I ran locally in Ubuntu. But in macos, it can be built. |
Replace the legacy distutils/setuptools build with Meson and meson-python: - Add top-level meson.build, ppl/meson.build, and tests/meson.build - Add PPL 1.2 wrap subproject with compiler-fixes patch - Move build config to pyproject.toml (meson-python backend, cibuildwheel settings) - Update CI workflows (dist, test, doc) for Meson-based builds - Remove setup.py, tests/setup.py, and tests/setup2.py - Remove distutils directives from Cython .pyx files - Update license identifier to GPL-3.0-or-later - Update environment.yml and environment.test.yml dependencies
|
Then we need to bump the version to 0.9.0 |
…lags for GMP and GLPK configuration
* Initial plan * Remove debug symbols from Linux wheels to reduce size from ~30MB Co-authored-by: cxzhong <14092175+cxzhong@users.noreply.github.com> * Remove --buildtype=release from meson setup args per review feedback Co-authored-by: cxzhong <14092175+cxzhong@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: cxzhong <14092175+cxzhong@users.noreply.github.com>
tobiasdiez
left a comment
There was a problem hiding this comment.
LGTM. Thanks again!
Follow-ups would be:
- Migrate to uv (instead of pip install)
- Figure out how to include gmp etc as subprojects instead of manually installing them from source
We may do this in follow-up pr |
|
This is ready to merge now @dimpase |
sagemathgh-41922: bump pplpy to 0.9.0 the latest pplpy on pypi now, switched biuld system to meson sagemath/pplpy#38 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [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 <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#41922 Reported by: Dima Pasechnik Reviewer(s): Chenxin Zhong
Replace the setuptools/distutils build with Meson:
Use Meson wrap to fetch PPL 1.2 source on demand instead of bundling:
std::auto_ptr, std::mem_fun_ref, memcpy casts, missing includes)
Update CI workflows: