From 42c19744a2789360770d0152817bd71321cb9f2a Mon Sep 17 00:00:00 2001 From: Chenxin Zhong Date: Thu, 4 Dec 2025 23:21:08 +0800 Subject: [PATCH 1/2] Fix --with-python option not being honored when cache exists When running ./configure with --with-python=pythonX.Y, if a previous configure run had cached a different Python path in ac_cv_path_PYTHON3, the cached value would be used instead of re-checking the specified Python. This fix clears the cache variable when --with-python is explicitly specified, forcing configure to always check the specified Python. Fixes #41258 --- build/pkgs/python3/spkg-configure.m4 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/pkgs/python3/spkg-configure.m4 b/build/pkgs/python3/spkg-configure.m4 index 448429fcfd2..6099a520fbc 100644 --- a/build/pkgs/python3/spkg-configure.m4 +++ b/build/pkgs/python3/spkg-configure.m4 @@ -15,6 +15,12 @@ SAGE_SPKG_CONFIGURE([python3], [ [AC_MSG_ERROR([building Sage --without-python is not supported])]) ac_path_PYTHON3="$with_python" + dnl If --with-python was explicitly specified, clear the cache to force re-checking + dnl This fixes issue #41258 where changing --with-python would use stale cached values + AS_IF([test x"$ac_path_PYTHON3" != x], [ + AS_UNSET([ac_cv_path_PYTHON3]) + ]) + dnl Issue #30559: Removed the DEPCHECK for sqlite. We never use libsqlite3 from SPKG for anything dnl other than building the python3 SPKG; so our libsqlite3 cannot create shared library conflicts. dnl From e5c3df578dd90cb07b13254d8297828853040762 Mon Sep 17 00:00:00 2001 From: Chenxin Zhong Date: Fri, 5 Dec 2025 16:41:15 +0800 Subject: [PATCH 2/2] Clarify cache clearing logic for --with-python option in spkg-configure.m4 --- build/pkgs/python3/spkg-configure.m4 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/pkgs/python3/spkg-configure.m4 b/build/pkgs/python3/spkg-configure.m4 index 6099a520fbc..a48ead798b9 100644 --- a/build/pkgs/python3/spkg-configure.m4 +++ b/build/pkgs/python3/spkg-configure.m4 @@ -15,9 +15,10 @@ SAGE_SPKG_CONFIGURE([python3], [ [AC_MSG_ERROR([building Sage --without-python is not supported])]) ac_path_PYTHON3="$with_python" - dnl If --with-python was explicitly specified, clear the cache to force re-checking + dnl If --with-python was explicitly specified and differs from the cached value, + dnl clear the cache to force re-checking. dnl This fixes issue #41258 where changing --with-python would use stale cached values - AS_IF([test x"$ac_path_PYTHON3" != x], [ + AS_IF([test x"$ac_path_PYTHON3" != x && test x"$ac_path_PYTHON3" != x"$ac_cv_path_PYTHON3"], [ AS_UNSET([ac_cv_path_PYTHON3]) ])