GNU bug report logs - #54412
[PATCH] python: use the posix_prefix sysconfig scheme on Debian

Previous Next

Package: automake-patches;

Reported by: Stefano Rivera <stefanor <at> debian.org>

Date: Tue, 15 Mar 2022 23:43:02 UTC

Severity: normal

Tags: patch

Done: Karl Berry <karl <at> freefriends.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Karl Berry <karl <at> freefriends.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#54412: closed ([PATCH] python: use the posix_prefix sysconfig
 scheme on Debian)
Date: Tue, 23 Jan 2024 21:51:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 23 Jan 2024 14:49:50 -0700
with message-id <202401232149.40NLnoNO028377 <at> freefriends.org>
and subject line Re: [bug#54412] [PATCH] python: use the posix_prefix sysconfig scheme on Debian
has caused the debbugs.gnu.org bug report #54412,
regarding [PATCH] python: use the posix_prefix sysconfig scheme on Debian
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
54412: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54412
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Stefano Rivera <stefanor <at> debian.org>
To: automake-patches <at> gnu.org
Cc: Gianfranco Costamagna <locutusofborg <at> debian.org>,
 Stefano Rivera <stefanor <at> debian.org>
Subject: [PATCH] python: use the posix_prefix sysconfig scheme on Debian
Date: Tue, 15 Mar 2022 19:30:56 -0400
Fixes Debian's bug: https://bugs.debian.org/1006784

Debian adds a custom sysconfig scheme to system python installs,
"posix_local". This is the default scheme, and it redirects local users'
Python module installs to /usr/local even though Python is installed
with a /usr prefix. Both are on Debian's python's sys.path module search
path.

Automake and its users understand prefixes, and are likely to select
/usr/local, explicitly. Select the "posix_prefix" scheme, with the
user-supplied prefix.

Previously this custom sysconfig scheme was specified in
distutils.sysconfig, but not sysconfig itself. As distutils is being
deprecated, the custom scheme is now specified in sysconfig, since
Debian's Python 3.10 (3.10.2-4).

Thank you, Gianfranco Costamagna <locutusofborg <at> debian.org>, for porting
the patch to automake.

* m4/python.m4: use the posix_prefix sysconfig scheme on Debian

Copyright-paperwork-exempt: yes
---
 m4/python.m4 | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/m4/python.m4 b/m4/python.m4
index 6653e4d89..51e050c19 100644
--- a/m4/python.m4
+++ b/m4/python.m4
@@ -255,7 +255,11 @@ except ImportError:
    am_cv_python_pythondir=`$PYTHON -c "
 $am_python_setup_sysconfig
 if can_use_sysconfig:
-  sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
+  scheme = sysconfig.get_default_scheme()
+  if scheme == 'posix_local':
+    # Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/
+    scheme = 'posix_prefix'
+  sitedir = sysconfig.get_path('purelib', scheme, vars={'base':'$am_py_prefix'})
 else:
   from distutils import sysconfig
   sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
@@ -297,7 +301,11 @@ sys.stdout.write(sitedir)"`
    am_cv_python_pyexecdir=`$PYTHON -c "
 $am_python_setup_sysconfig
 if can_use_sysconfig:
-  sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'})
+  scheme = sysconfig.get_default_scheme()
+  if scheme == 'posix_local':
+    # Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/
+    scheme = 'posix_prefix'
+  sitedir = sysconfig.get_path('platlib', scheme, vars={'platbase':'$am_py_exec_prefix'})
 else:
   from distutils import sysconfig
   sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix')
-- 
2.35.1



[Message part 3 (message/rfc822, inline)]
From: Karl Berry <karl <at> freefriends.org>
To: stefanor <at> debian.org, 54412 <at> debbugs.gnu.org
Subject: Re: [bug#54412] [PATCH] python: use the posix_prefix sysconfig
 scheme on Debian
Date: Tue, 23 Jan 2024 14:49:50 -0700
Guess it's time to close this one about the Python scheme to use with
Debian. We'll see how it turns out with the next pretest ... --thanks, karl.


This bug report was last modified 1 year and 121 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.