From e5f6663372fab14c6a386004a925de59be216f31 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Sun, 5 Jul 2020 13:11:20 +0100 Subject: [PATCH 1/4] only use locale C.UTF-8 if available, else C --- build/bin/sage-spkg | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index 5a6810e8e28..2353fd3b06e 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -70,7 +70,11 @@ # Avoid surprises with character ranges [a-z] in regular expressions # See Trac #15791; some locales can produce different results for # character ranges (use C.UTF-8 to ensure UTF-8 default encoding in Python) -export LC_ALL=C.UTF-8 +if test x`locale -a | grep C\.UTF-8` != x; then + export LC_ALL=C.UTF-8; +else + export LC_ALL=C; +fi usage() { From ff6f4a68d4f396cb5f10e9918e5942113f739aa1 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Wed, 16 Sep 2020 16:06:28 +0100 Subject: [PATCH 2/4] assume Python 3.7 or better --- build/bin/sage-spkg | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index 2353fd3b06e..94ad35f7dab 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -69,12 +69,10 @@ # Avoid surprises with character ranges [a-z] in regular expressions # See Trac #15791; some locales can produce different results for -# character ranges (use C.UTF-8 to ensure UTF-8 default encoding in Python) -if test x`locale -a | grep C\.UTF-8` != x; then - export LC_ALL=C.UTF-8; -else - export LC_ALL=C; -fi +# character ranges; using C.UTF-8 to ensure UTF-8 default encoding in Python +# introduces extra complications, see #30053, so we don't do it, but +# assume we are on Python3.x, for x at least 7. +export LC_ALL=C usage() { From 64c3a8a6c99e916b68dfec6a2cd1346b023916e9 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Wed, 16 Sep 2020 17:45:12 +0100 Subject: [PATCH 3/4] only test python3, to be 3.7 or 3.8 --- build/pkgs/python3/spkg-configure.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/pkgs/python3/spkg-configure.m4 b/build/pkgs/python3/spkg-configure.m4 index 725e43345b2..3dc3b7ea419 100644 --- a/build/pkgs/python3/spkg-configure.m4 +++ b/build/pkgs/python3/spkg-configure.m4 @@ -10,14 +10,14 @@ SAGE_SPKG_CONFIGURE([python3], [ dnl Using Python 3 for Sage. Check if we can do venv with a system python3 dnl instead of building our own copy. check_modules="sqlite3, ctypes, math, hashlib, crypt, readline, socket, zlib, distutils.core" - AC_CACHE_CHECK([for python3 >= 3.6, < 3.9 with modules $check_modules], [ac_cv_path_PYTHON3], [ + AC_CACHE_CHECK([for python3 > 3.6, < 3.9 with modules $check_modules], [ac_cv_path_PYTHON3], [ AC_MSG_RESULT([]) - AC_PATH_PROGS_FEATURE_CHECK([PYTHON3], [python3.8 python3.7 python3.6 python3], [ + AC_PATH_PROGS_FEATURE_CHECK([PYTHON3], [python3], [ AC_MSG_CHECKING([... whether $ac_path_PYTHON3 is good]) python3_version=`"$ac_path_PYTHON3" --version 2>&1 \ | $SED -n -e 's/\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\).*/\1/p'` AS_IF([test -n "$python3_version"], [ - AX_COMPARE_VERSION([$python3_version], [ge], [3.6.0], [ + AX_COMPARE_VERSION([$python3_version], [ge], [3.7.0], [ AX_COMPARE_VERSION([$python3_version], [lt], [3.9.0], [ dnl Because the system python is not used directly but rather in a venv without site-packages, dnl we test whether the module will be available in a venv. From be47518c1019d37e11bbac9a3268d69b196691c8 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 16 Sep 2020 10:11:13 -0700 Subject: [PATCH 4/4] build/pkgs/python3/spkg-configure.m4: Use 'python >= 3.7'; keep checking for 'python3.8, python3.7' --- build/pkgs/python3/spkg-configure.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/pkgs/python3/spkg-configure.m4 b/build/pkgs/python3/spkg-configure.m4 index 3dc3b7ea419..78b4d8bda85 100644 --- a/build/pkgs/python3/spkg-configure.m4 +++ b/build/pkgs/python3/spkg-configure.m4 @@ -10,9 +10,9 @@ SAGE_SPKG_CONFIGURE([python3], [ dnl Using Python 3 for Sage. Check if we can do venv with a system python3 dnl instead of building our own copy. check_modules="sqlite3, ctypes, math, hashlib, crypt, readline, socket, zlib, distutils.core" - AC_CACHE_CHECK([for python3 > 3.6, < 3.9 with modules $check_modules], [ac_cv_path_PYTHON3], [ + AC_CACHE_CHECK([for python3 >= 3.7, < 3.9 with modules $check_modules], [ac_cv_path_PYTHON3], [ AC_MSG_RESULT([]) - AC_PATH_PROGS_FEATURE_CHECK([PYTHON3], [python3], [ + AC_PATH_PROGS_FEATURE_CHECK([PYTHON3], [python3.8 python3.7 python3], [ AC_MSG_CHECKING([... whether $ac_path_PYTHON3 is good]) python3_version=`"$ac_path_PYTHON3" --version 2>&1 \ | $SED -n -e 's/\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\).*/\1/p'`