Remove Python3 and some dependencies#41120
Remove Python3 and some dependencies#41120cxzhong wants to merge 38 commits intosagemath:developfrom
Conversation
…es, openssl, python3, readline, sqlite, and xz
|
Documentation preview for this PR (built with commit ab7c4d7; changes) is ready! 🎉 |
Add explicit linking to ncurses for readline on Linux.
|
I am officially retiring from supporting the things in build/pkgs, sorry :) The changes look OK to me, only the |
|
the best way here is to remove Python package from the distro. It has about 1 user, who easily can do without it, too. |
It will break minimal linux CI. for minimal building, it needs python package. How to deal with this problem. and we can not test the building of such basic packages like readline ncurses and so on |
… improve directory management
Since Sage now requires system Python 3.12+, remove: - ubuntu-jammy (Python 3.10) - debian-bullseye (Python 3.9) - debian-bookworm (Python 3.11) - centos-stream-9 (Python 3.9) Keep only: - ubuntu-noble (Python 3.12) - fedora-40 (Python 3.12) - fedora-41 (Python 3.12/3.13) - opensuse-tumbleweed (rolling, has Python 3.12+)
Since Python 3.12 removed distutils from the standard library, setuptools is now required for the configure-time extension compilation tests. - debian.txt: Add python3-setuptools and python3-venv - opensuse.txt: Add python3-setuptools - fedora.txt: Add python3-setuptools
The configure-time extension compilation tests need Python.h header. - debian.txt: Add python3-dev - opensuse.txt: Add python3-devel - fedora.txt: Add python3-devel
CentOS Stream 10 has Python 3.12+ available, so it's compatible with the new system Python requirement. - docker.yml: Add centos-stream-10 to tox_system_factors - tox.ini: Add centos-stream-10 with BASE_TAG=stream10 CentOS uses SYSTEM=fedora, so fedora.txt prereqs apply which already have python3-devel and python3-setuptools.
|
please see cxzhong#15 |
|
I'll stop for the day (it's 22:20 local time). We still need to sort out PYTHON in makefiles, there is some spaghetti code with it, as it's meant to be rebuilding And there is also |
OK, thank you very much |
|
@tobiasdiez - do you know if here we could simply rename |
I don't know for sure, but would assume yes. If you now require a recent-enough python, |
|
removing $(PYTHON) was not a good idea. It broke creation of the venv |
|
I have fixed cxzhong#15 - can you merge it here? |
* fix typo * correct mistakenly linked deps file, typo fixes * get rid of $(PYTHON) in dependencies, etc * correct link * remove build/bin/sage-bootstrap-python, more cleanup * Revert "get rid of $(PYTHON) in dependencies, etc" This reverts commit 33df1fb.
|
|
Ubuntu package of libprimecount-dev has no version in pc file |
|
This is because Ubuntu/Debian package is broken. I have report to Debian |
there was a bug in recent primecount and primesieve versions that resulted in this meanwhile the (primecount/sieve) upstream has released new versions with a fix |
|
we need a blurb about installing python3 and xz/liblzma from source, to be put into build/pkgs/_bootstrap/SPKG.rst, akin to what we have for Boost etc in build/pkgs/_prereq/SPKG.rst |
…Utils and Python 3.12
dimpase
left a comment
There was a problem hiding this comment.
I think it's also possible to build sage-distro using a uv-installed Python, in a venv.
build/pkgs/_bootstrap/SPKG.rst
Outdated
| $ ./configure --prefix=/usr/local && make && make install | ||
|
|
||
| will install XZ Utils in ``/usr/local``. Instead of ``/usr/local`` one may choose | ||
| another location, say ``/opt/foo``, which then might have to be passed to Sage |
There was a problem hiding this comment.
no, this is incorrect. A modern xz/liblzma installs liblzma.pc file, and ./configure checks for then using a pkg-config macro. Thus, to detect xz/liblzma at a non-standard location, add
it to PKG_CONFIG_PATH, i.e. export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:<prefix used>/lib/pkgconfig
|
with an external python, I am getting Easy to patch --- a/build/pkgs/sagelib/spkg-install.in
+++ b/build/pkgs/sagelib/spkg-install.in
@@ -86,4 +86,4 @@ python3 -c 'import pathlib; from sage.misc.lazy_import_cache import get_cache_fi
rm -rf build/temp.*
# indicate that we are done - is needed to allow ./sage to start
-touch $SAGE_VENV/bin/sage
+touch $SAGE_VENV/bin/sage || trueand tests pass, @tobiasdiez - do you have an idea why there is no I took a standalone Python install from https://github.com/astral-sh/python-build-standalone Should we pass |
Sorry, no idea. Did you create a venv manually, or is then handled by sage-the-distro? Maybe something went wrong there.
I kind of remember that we (you?) added this line already as a kind-of-hack in #39030. Maybe this is just no longer necessary when you use an external python? |
|
I am trying to come up with a reasonable advice for a manual installation of an external python. For reasons I don't understand, an external python as above doesn't behave in the same way as a system python - for the latter |
|
with the official CPython Python on X86_64 (and maybe on arm64 too) macOS doesn't quite fly, as it's multiarch, and setuptools/cython gets confused as hell |
|
here I'm still looking for a good easy way to install an external Python which works well with Sage. (the 1st two are probably a bug. The rest might be due to some weird switch in CFLAGS they use) The python.org python is multiarch, which in such a case is just broken: #41120 (comment) |
|
@cxzhong - could you rebase? |
Honestly, if you recommend people to install the python builds from astral, you can also just tell them to run (or do it for them): |
|
we are still dealing with the non-Python dependencies needed somehow, and this is not what's available externally, save for relatively rare Linux distros, and Conda. |
|
Sure, you need to provide exactly the external dependencies of sagelib. Restricting the scope of sage-the-distro to those 20 packages or so would make a lot of sense to me. Sorry for the tangential, back to the actual issue. What package still needs to build with setuptools, i.e where exactly do you get those issues with the astral python? |
packages all build, it's tests related to the |
|
Ah okay. Could you not filter out these (unimportant) warnings during the call of |
📝 Checklist
⌛ Dependencies