Opened 2 years ago

Closed 2 years ago

Last modified 18 months ago

#29033 closed enhancement (fixed)

Support minimal system Python version 3.6 (for venv)

Reported by: embray Owned by:
Priority: major Milestone: sage-9.2
Component: python3 Keywords:
Cc: jhpalmieri, dimpase, fbissey, mjo Merged in:
Authors: Erik Bray, Matthias Koeppe Reviewers: Matthias Koeppe, Michael Orlitzky
Report Upstream: N/A Work issues:
Branch: abb5607 (Commits, GitHub, GitLab) Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by mkoeppe)

With #27824 it is possible to create a venv over an existing Python 3.7 instead of building the python3 spkg.

This is designed to work with Python 3.7 (and < 3.8) since that's what's currently used by sage-the-distribution and is best-tested.

However, it turns out an existing Python 3.6 can work just fine as the minimum Python version with a few small fixes (sage-the-distribution used Python 3.6 until last year, so the degree to which we diverged from supporting it was minimal).

This would be a nice-to-have, as it would speed up the build on various distributions that we still support:

but not (because python3 is too old):

  • debian-stretch (oldstable) (3.5.3),
  • ubuntu-xenial (3.5.2)

and not (because a dependency of python3 is too old):

(All this is according to https://repology.org/project/python/versions as of 2020-06-05, not verified.)

Maybe since Sage is less tested with 3.6, there could be a warning against using it.

See also: #27754 (Upgrade: Python 3.8.x)

Change History (28)

comment:1 Changed 2 years ago by embray

  • Status changed from new to needs_review

comment:2 Changed 2 years ago by mkoeppe

Related to the question of what Python versions are good is #26457 - "Do not depend on a patched Python"

comment:3 Changed 2 years ago by mkoeppe

  • Milestone changed from sage-9.1 to sage-9.2

Batch modifying tickets that will likely not be ready for 9.1, based on a review of the ticket title, branch/review status, and last modification date.

comment:4 Changed 2 years ago by mkoeppe

  • Dependencies #29032 deleted
  • Description modified (diff)
  • Status changed from needs_review to needs_work

This would need rebasing

comment:5 Changed 2 years ago by mkoeppe

  • Description modified (diff)
  • Summary changed from Support minimal system Python version 3.6 to Support minimal system Python version 3.6 (for venv)

Edited description to clarify that this is about the venv python3, not sage-system-python.

comment:6 Changed 2 years ago by mkoeppe

  • Cc jhpalmieri dimpase fbissey added
  • Description modified (diff)

comment:7 Changed 2 years ago by mkoeppe

  • Description modified (diff)

comment:8 Changed 2 years ago by mkoeppe

  • Branch changed from u/embray/build/configure/python3.6 to u/mkoeppe/build/configure/python3.6

comment:9 Changed 2 years ago by mkoeppe

  • Commit changed from b4a777ec60bee2fecdbeb0396afcfde30d4e5e62 to abb5607710a2a5cc5415423489fa452965cbef68

Tests at https://github.com/mkoeppe/sage/pull/37/checks


New commits:

abb5607Allow Sage to work with a system Python 3.6.

comment:10 Changed 2 years ago by mkoeppe

  • Status changed from needs_work to needs_review

comment:11 Changed 2 years ago by mkoeppe

  • Description modified (diff)

comment:12 Changed 2 years ago by mkoeppe

  • Description modified (diff)

comment:13 Changed 2 years ago by mkoeppe

  • Cc mjo added
  • Description modified (diff)

comment:14 Changed 2 years ago by mkoeppe

TODO: Check fedora-28 and centos-8 in https://github.com/mkoeppe/sage/actions/runs/126407840

comment:15 Changed 2 years ago by mjo

LGTM if those tests pass.

comment:17 Changed 2 years ago by mjo

  • Reviewers set to Michael Orlitzky
  • Status changed from needs_review to positive_review

comment:18 Changed 2 years ago by mkoeppe

Thank you!

comment:19 Changed 2 years ago by mkoeppe

  • Authors changed from Erik Bray to Erik Bray, Matthias Koeppe
  • Reviewers changed from Michael Orlitzky to Matthias Koeppe, Michael Orlitzky

comment:20 Changed 2 years ago by vbraun

  • Branch changed from u/mkoeppe/build/configure/python3.6 to abb5607710a2a5cc5415423489fa452965cbef68
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:21 follow-up: Changed 23 months ago by arojas

  • Commit abb5607710a2a5cc5415423489fa452965cbef68 deleted

C.UTF-8 locale is a Debian-specific thing (and maybe Fedora). Please don't assume that it is available. On Arch, this causes lots (as in, one every other line in the compilation output) of warnings

/bin/sh: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8)

comment:22 Changed 23 months ago by dimpase

on another ticket, fixing docbuild on non-EN locales, someone using Arch complained that LANG=C causes a lot of warnings.

comment:23 in reply to: ↑ 21 Changed 23 months ago by mjo

Replying to arojas:

C.UTF-8 locale is a Debian-specific thing (and maybe Fedora). Please don't assume that it is available.

Sorry about that, I didn't realize that Gentoo's glibc was patched (the patches are in an unusual place). It looks like discussion is still ongoing for glibc:

https://sourceware.org/pipermail/libc-alpha/2020-June/115224.html

Musl, on the other hand, already supports it I think?

https://wiki.musl-libc.org/functional-differences-from-glibc.html

In any case, we should probably revert to C in the meantime.

comment:24 Changed 23 months ago by dimpase

the locale issue is being dealt with on #30053

comment:25 follow-up: Changed 21 months ago by dimpase

This has introduced an unfortunate bug related to a weird search order in AC_PATH_PROGS_FEATURE_CHECK(), which has the outer loop over PATH entries. Thus, a python on the list [python.foo python.baz ....] of pythons that comes first in PATH and has all the features will be picked, not the first python on the list.

As modifying PATH to put the best python 1st might be error-prone (think about Conda, Homebrew, etc), this should be fixed.

This is of course an autoconf bug, too, as AC_PATH_PROGS() has a sane order, ie. its outer loop is over the list entries.

comment:26 in reply to: ↑ 25 Changed 21 months ago by dimpase

Replying to dimpase:

This has introduced an unfortunate bug related to a weird search order in AC_PATH_PROGS_FEATURE_CHECK(), which has the outer loop over PATH entries. Thus, a python on the list [python.foo python.baz ....] of pythons that comes first in PATH and has all the features will be picked, not the first python on the list.

As modifying PATH to put the best python 1st might be error-prone (think about Conda, Homebrew, etc), this should be fixed.

This is of course an autoconf bug, too, as AC_PATH_PROGS() has a sane order, ie. its outer loop is over the list entries.

see #30546 for a fix

comment:27 in reply to: ↑ description Changed 18 months ago by mkoeppe

Follow up regarding centos-7:

(because a dependency of python3 is too old):

After #30559, sqlite is no longer the problem, but python3 is still not accepted on this system because of zlib -> libpng:

Checking whether SageMath should install SPKG zlib...
checking for inflateEnd in -lz... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for LIBPNG... no
checking for inflateValidate in -lz... no
configure: no suitable system package found for SPKG zlib
-----------------------------------------------------------------------------
Checking whether SageMath should install SPKG libpng...
checking installing zlib? ... yes; install libpng as well
configure: no suitable system package found for SPKG libpng

comment:28 Changed 18 months ago by mkoeppe

#31009 is taking care of this.

Note: See TracTickets for help on using tickets.