From unknown Sun Jun 22 11:32:53 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#54412 <54412@debbugs.gnu.org> To: bug#54412 <54412@debbugs.gnu.org> Subject: Status: [PATCH] python: use the posix_prefix sysconfig scheme on Debian Reply-To: bug#54412 <54412@debbugs.gnu.org> Date: Sun, 22 Jun 2025 18:32:53 +0000 retitle 54412 [PATCH] python: use the posix_prefix sysconfig scheme on Debi= an reassign 54412 automake-patches submitter 54412 Stefano Rivera severity 54412 normal tag 54412 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 15 19:42:26 2022 Received: (at submit) by debbugs.gnu.org; 15 Mar 2022 23:42:26 +0000 Received: from localhost ([127.0.0.1]:49848 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUGo5-00071s-Vb for submit@debbugs.gnu.org; Tue, 15 Mar 2022 19:42:26 -0400 Received: from lists.gnu.org ([209.51.188.17]:59808) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUGdH-0006kz-DP for submit@debbugs.gnu.org; Tue, 15 Mar 2022 19:31:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nUGdG-0004xI-Lr for automake-patches@gnu.org; Tue, 15 Mar 2022 19:31:15 -0400 Received: from smtp.tumbleweed.org.za ([212.47.253.1]:54854) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nUGdD-00007V-2H for automake-patches@gnu.org; Tue, 15 Mar 2022 19:31:14 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=debian.org; i=@debian.org; q=dns/txt; s=smtp-ed25519.stefanor.user; t=1647387063; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : from; bh=PYqbSBnXhkjT+blEt9SufKguZdpMmem3ktkrjyC8xRM=; b=ZHfvAWN4e2PKoeDI2GFDOB0F7f5TYDDtO/tTknf/E/z4nzhLPVnP0dqc+3Rfcm2B1ccJC 9E5zJXlKYo5gZ9sAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=debian.org; i=@debian.org; q=dns/txt; s=smtp-rsa.stefanor.user; t=1647387063; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : from; bh=PYqbSBnXhkjT+blEt9SufKguZdpMmem3ktkrjyC8xRM=; b=ZND51hcw04n3fkNLcsVwe7sM2LernlHDVBx/u1VCrfv7cxGrPQASQ+GBgR2F5VEnxrX5v EpAvbC8IrqnLNebaX9tupkwYAMxzO72TTB5IfQ0l+18IImOuKu3rhJ0PgW7tnX9CjnRw3Ef pxrAggXUgtf1UrPYQQmhyTXgR6215GT5i9M5s6QmHseGe3fx9yxwRG0vLKHvC0PtFL/BO/k k2OCea5JP9uG/yYx53q8CF015QNJOz7TzFSKxUxyrp7QeqNtFEnziEO6+L4wMxy4X6CQuEo d1I72ytuWXtILRl0btIt2InSG1GaLcMWa/kx2kSlHrkQ+ZAMbF0UbmFkIJAQ== Received: from haydn.kardiogramm.net (unknown [94.198.176.210]) by smtp.tumbleweed.org.za (Postfix) with ESMTPSA id E00F3401E5; Tue, 15 Mar 2022 23:31:02 +0000 (UTC) Received: from haydn.aweh.lan (localhost [IPv6:::1]) by haydn.kardiogramm.net (Postfix) with ESMTP id 8685625DF5B3; Tue, 15 Mar 2022 19:31:00 -0400 (AST) From: Stefano Rivera To: automake-patches@gnu.org Subject: [PATCH] python: use the posix_prefix sysconfig scheme on Debian Date: Tue, 15 Mar 2022 19:30:56 -0400 Message-Id: <20220315233056.2610021-1-stefanor@debian.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: none client-ip=212.47.253.1; envelope-from=stefanor@debian.org; helo=smtp.tumbleweed.org.za X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 15 Mar 2022 19:42:24 -0400 Cc: Gianfranco Costamagna , Stefano Rivera X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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 , 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 From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 16 17:25:53 2022 Received: (at 54412) by debbugs.gnu.org; 16 Mar 2022 21:25:53 +0000 Received: from localhost ([127.0.0.1]:52460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUb9S-0007tC-4j for submit@debbugs.gnu.org; Wed, 16 Mar 2022 17:25:53 -0400 Received: from freefriends.org ([96.88.95.60]:59830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUb9P-0007t2-F0 for 54412@debbugs.gnu.org; Wed, 16 Mar 2022 17:25:48 -0400 X-Envelope-From: karl@freefriends.org Received: from freefriends.org (freefriends.org [96.88.95.60]) by freefriends.org (8.14.7/8.14.7) with ESMTP id 22GLPjaa016629 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Mar 2022 15:25:46 -0600 Received: (from apache@localhost) by freefriends.org (8.14.7/8.14.7/Submit) id 22GLPjjw016628; Wed, 16 Mar 2022 15:25:45 -0600 Date: Wed, 16 Mar 2022 15:25:45 -0600 Message-Id: <202203162125.22GLPjjw016628@freefriends.org> From: Karl Berry To: stefanor@debian.org Subject: Re: [bug#54412] [PATCH] python: use the posix_prefix sysconfig scheme on Debian In-Reply-To: <20220315233056.2610021-1-stefanor@debian.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54412 Cc: locutusofborg@debian.org, 54412@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefano, Gianfranco - thanks for this. Forgive my ignorance, but I don't use Debian, or Python, and have never the term "sysconfig scheme" before. Does your patch change the default behavior of Automake? I gather not, but ... Also, it feels like there should be some documentation about this. Can you write something brief? --thanks, karl. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 16 19:12:38 2022 Received: (at 54412) by debbugs.gnu.org; 16 Mar 2022 23:12:38 +0000 Received: from localhost ([127.0.0.1]:52509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUcon-0002IZ-Sx for submit@debbugs.gnu.org; Wed, 16 Mar 2022 19:12:38 -0400 Received: from satie.tumbleweed.org.za ([94.130.89.142]:56852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUcok-0002IM-VW for 54412@debbugs.gnu.org; Wed, 16 Mar 2022 19:12:37 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=debian.org; i=@debian.org; q=dns/txt; s=satie-ed25519.stefanor.user; t=1647472352; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=hi69YbrNlq3X8t6kj1G+c2PpzP0dOESLPBMJNt9Kyj8=; b=d/+ii8yr3o8psYM+UuswrbESuvIgLMxmsE4isTx5diM/Me41PusNYIFbC48vbr7gXqiWR L7NdOlTj2QVLC2IAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=debian.org; i=@debian.org; q=dns/txt; s=satie-rsa.stefanor.user; t=1647472352; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=hi69YbrNlq3X8t6kj1G+c2PpzP0dOESLPBMJNt9Kyj8=; b=tEIaF00uciUMI1hyTLSWGtJxJjnX6Qb2CDfrcBP7CHzM5Al67wIcZUD8TeJGB4yAbUeJz QgHoE9FsUmd11aFknmNNMJ6kpJjFCo5BjpnFTnoXpiFdXRdGAaYtPV7CxtKmquCxrAjs0f6 0vBJ0nqVlcOm7s8MYBI70I0zqhLekbm9ZEQs+l2S10CoYgh5jIg/ruirKsT17sjv4ajxdj5 bXcKso9/SxYyradtggT3px3pU32T4pKBfj2hVHTNqr24LYKZiiX2jjJCKPVOm3JImfRLgeL 0FrX4njO8TumG4udAT9oKfOskNw+C4QZpLIXr7MPu9ohAjAUGmWddMcCbTSA== Received: by satie.tumbleweed.org.za (Postfix, from userid 1000) id 9B15879220A; Wed, 16 Mar 2022 23:12:32 +0000 (UTC) Date: Wed, 16 Mar 2022 23:12:32 +0000 From: stefanor@debian.org To: Karl Berry Subject: Re: [bug#54412] [PATCH] python: use the posix_prefix sysconfig scheme on Debian Message-ID: <20220316231232.famqtmn3wj4zkmv4@satie.tumbleweed.org.za> X-GPG-Public-Key: http://www.rivera.za.net/stefano.gpg References: <20220315233056.2610021-1-stefanor@debian.org> <202203162125.22GLPjjw016628@freefriends.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <202203162125.22GLPjjw016628@freefriends.org> User-Agent: NeoMutt/20201127 X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 54412 Cc: locutusofborg@debian.org, 54412@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Hi Karl (2022.03.16_21:25:45_+0000) > Stefano, Gianfranco - thanks for this. Forgive my ignorance, but I don't > use Debian, or Python, and have never the term "sysconfig scheme" before. Compare these: $ python3.9 -m sysconfig Current installation scheme: "posix_prefix" Paths: data = "/usr" include = "/usr/include/python3.9" platinclude = "/usr/include/python3.9" platlib = "/usr/lib/python3.9/site-packages" platstdlib = "/usr/lib/python3.9" purelib = "/usr/lib/python3.9/site-packages" scripts = "/usr/bin" stdlib = "/usr/lib/python3.9" ... prefix = "/usr" ... To this: $ python3.10 -m sysconfig Current installation scheme: "posix_local" Paths: data = "/usr/local" include = "/usr/local/include/python3.10" platinclude = "/usr/local/include/python3.10" platlib = "/usr/local/lib/python3.10/dist-packages" platstdlib = "/usr/lib/python3.10" purelib = "/usr/local/lib/python3.10/dist-packages" scripts = "/usr/local/bin" stdlib = "/usr/lib/python3.10" ... prefix = "/usr" ... The "posix_local" scheme uses {prefix}/local/lib/... That's the issue. > Does your patch change the default behavior of Automake? I gather not, > but ... This patch restores the previous (pre 3.10) behaviour. If you use --prefix /usr, it installs modules to /usr, with --prefix /usr/local, it installs to /usr/local. > Also, it feels like there should be some documentation about this. > Can you write something brief? --thanks, karl. I think it shouldn't affect users. If anything needs to be documented, it's: Automake will select the posix_prefix scheme instead of posix_local, on Debian Python 3.10+. To install modules into /usr/local, instead of /usr, use --prefix /usr/local. SR -- Stefano Rivera http://tumbleweed.org.za/ +1 415 683 3272 From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 18 09:29:01 2022 Received: (at 54412) by debbugs.gnu.org; 18 Mar 2022 13:29:01 +0000 Received: from localhost ([127.0.0.1]:56534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVCf7-0002c7-2O for submit@debbugs.gnu.org; Fri, 18 Mar 2022 09:29:01 -0400 Received: from satie.tumbleweed.org.za ([94.130.89.142]:34406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVCf4-0002bw-Cj for 54412@debbugs.gnu.org; Fri, 18 Mar 2022 09:28:59 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=debian.org; i=@debian.org; q=dns/txt; s=satie-ed25519.stefanor.user; t=1647610136; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=0ypPOEe/+6sElELDAtJTudtKCuPGXo22MAEHNy9yZtQ=; b=dzwKu33Hsfbiab6OOaitTj2mp0loVgJB5h8XwTiTJ3bVY6GQXMLjvedsiue+WbfZyRlmq KVv1cLbflYzvLhpAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=debian.org; i=@debian.org; q=dns/txt; s=satie-rsa.stefanor.user; t=1647610136; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=0ypPOEe/+6sElELDAtJTudtKCuPGXo22MAEHNy9yZtQ=; b=5wJu25ghSkubl7eQZdcTwXYQfhNFu3L+Ok+qNWAoIqBeKBEORAv9vZLarD/pJc5JF0UE8 gaetU5zk+Ej4FmmYM0y2AwxmkpcJJqU4FQtm05ZpQPCBFQmP3CYl+vK/naAZN2XVGe91B/V eQmA5IAG2G+7gUcMMQGcPJNALDw+F2djA5u8lATveHiM31ioVN+nEDdoayX7hBiC4ZyEO48 Qwx6RELQVQQCmP2Ayc9y3ZUt15aDbfXxstg+4wv8AhUEoEvP/gI5Hoa5Nynr5NiEbV0mRhY 6Q2mxzlgoJEKyC6qSmg8F3U5BvWAc5W6bCUlZ4o87zxznFbW4JVJz06SB5Yg== Received: by satie.tumbleweed.org.za (Postfix, from userid 1000) id 3FD8A79451A; Fri, 18 Mar 2022 13:28:56 +0000 (UTC) Date: Fri, 18 Mar 2022 13:28:56 +0000 From: stefanor@debian.org To: Karl Berry Subject: Re: [bug#54412] [PATCH] python: use the posix_prefix sysconfig scheme on Debian Message-ID: <20220318132856.uswlc5omdfvg25ho@satie.tumbleweed.org.za> X-GPG-Public-Key: http://www.rivera.za.net/stefano.gpg References: <20220315233056.2610021-1-stefanor@debian.org> <202203162125.22GLPjjw016628@freefriends.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="7nz57me75teohz24" Content-Disposition: inline In-Reply-To: <202203162125.22GLPjjw016628@freefriends.org> User-Agent: NeoMutt/20201127 X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 54412 Cc: locutusofborg@debian.org, 54412@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --7nz57me75teohz24 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Hi Karl (2022.03.16_21:25:45_+0000) Oops, somehow I missed that this patch failed on older versions of cPython. This version is compatible back to 2.7.4. SR -- Stefano Rivera http://tumbleweed.org.za/ +1 415 683 3272 --7nz57me75teohz24 Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0001-python-use-the-posix_prefix-sysconfig-scheme-on-Debi.patch" Content-Transfer-Encoding: quoted-printable =46rom b07451795dc4626ca348cd1fd743d41a87daca61 Mon Sep 17 00:00:00 2001 =46rom: Stefano Rivera Date: Tue, 15 Mar 2022 19:08:55 -0400 Subject: [PATCH] python: use the posix_prefix sysconfig scheme on Debian 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 , for porting the patch to automake. * m4/python.m4: use the posix_prefix sysconfig scheme on Debian Copyright-paperwork-exempt: yes --- m4/python.m4 | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/m4/python.m4 b/m4/python.m4 index 6653e4d89..b44d8ba55 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -255,7 +255,14 @@ except ImportError: am_cv_python_pythondir=3D`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir =3D sysconfig.get_path('purelib', vars=3D{'base':'$am_py_prefix'= }) + if hasattr(sysconfig, 'get_default_scheme'): + scheme =3D sysconfig.get_default_scheme() + else: + scheme =3D sysconfig._get_default_scheme() + if scheme =3D=3D 'posix_local': + # Debian's default scheme installs to /usr/local/ but we want to find = headers in /usr/ + scheme =3D 'posix_prefix' + sitedir =3D sysconfig.get_path('purelib', scheme, vars=3D{'base':'$am_py= _prefix'}) else: from distutils import sysconfig sitedir =3D sysconfig.get_python_lib(0, 0, prefix=3D'$am_py_prefix') @@ -297,7 +304,14 @@ sys.stdout.write(sitedir)"` am_cv_python_pyexecdir=3D`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir =3D sysconfig.get_path('platlib', vars=3D{'platbase':'$am_py_exe= c_prefix'}) + if hasattr(sysconfig, 'get_default_scheme'): + scheme =3D sysconfig.get_default_scheme() + else: + scheme =3D sysconfig._get_default_scheme() + if scheme =3D=3D 'posix_local': + # Debian's default scheme installs to /usr/local/ but we want to find = headers in /usr/ + scheme =3D 'posix_prefix' + sitedir =3D sysconfig.get_path('platlib', scheme, vars=3D{'platbase':'$a= m_py_exec_prefix'}) else: from distutils import sysconfig sitedir =3D sysconfig.get_python_lib(1, 0, prefix=3D'$am_py_exec_prefix') --=20 2.35.1 --7nz57me75teohz24-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 09 16:47:23 2024 Received: (at submit) by debbugs.gnu.org; 9 Jan 2024 21:47:23 +0000 Received: from localhost ([127.0.0.1]:41162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNJwQ-0007wI-MJ for submit@debbugs.gnu.org; Tue, 09 Jan 2024 16:47:23 -0500 Received: from lists.gnu.org ([2001:470:142::17]:44168) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNJwO-0007w3-0H for submit@debbugs.gnu.org; Tue, 09 Jan 2024 16:47:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNJwA-0005qf-Op for automake-patches@gnu.org; Tue, 09 Jan 2024 16:47:06 -0500 Received: from mout.gmx.net ([212.227.17.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNJw8-0002RD-L9 for automake-patches@gnu.org; Tue, 09 Jan 2024 16:47:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.us; s=s31663417; t=1704836812; x=1705441612; i=bogdro_rep@gmx.us; bh=htmSHZ6qVIbcD5Loe3DYtI5JzJMHO03V2M/2BQluGkg=; h=X-UI-Sender-Class:Date:To:From:Subject; b=B40bV2cn/u1ce+roXy1kuZ0TytBeiS9K5knKUwjh5HS6VK6fs5vBlJEKAsWG6L3J J7Ii5Y10T2DlM9kPk/8XDxNrgr2otCo1Jdb1T2+AlNmsLRw6zHjY82UBgaDZwdYFr VHVRuL//e4ZR1rQm+6GMthSXuAH8syTDfHCl/ORd7RYAFd8q43nfQBJxnNDgzfsFG YkyJ9hVgruexTabneE3fa2bP9b+Vt1at2V0BUZL5VtoAY5r8gZkELPvtkyHE91dmK gVndu+uzAONb+wvzCSn341kKi4V1cq6GLCurhqGO3jgecrVbho3/OYNSLRmYFQoIb HF8pmnQiZGxOEJtaAA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.0.4] ([83.255.207.180]) by mail.gmx.net (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MwQXN-1r4H2v1D2T-00sM34; Tue, 09 Jan 2024 22:46:52 +0100 Content-Type: multipart/mixed; boundary="------------C2mkojiDBNGRkevM7Zni09ci" Message-ID: <1a1b20f6-c216-46f1-8db0-2123e773c1a7@gmx.us> Date: Tue, 9 Jan 2024 22:46:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: automake-patches@gnu.org, 54412@debbugs.gnu.org, 64837@debbugs.gnu.org Content-Language: en-GB From: Bogdan Subject: [bug#54412] [bug#64837] Fix Python on Debian X-Provags-ID: V03:K1:GND/2JnbGZHq15cgMg07O8nreMJkY8+2vpZ0qfLk8k42Xyc+P+P OPAmeAPN8xY6wjZ3mEVilGUzH33psz5DRHSL331v4DYOb5T3TXPm6sPole4HLwlO4jzmImB HklwQ0erNLpyNkXX957ZCu3SPaxNObh8OEEWNe+bZcYWYuvMb7BlECcbYspeCQ3D1ovkg3F VlJotHW3NHCNbTSPKlMOg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:semJL2/iJbo=;CphBHNl9wamV95fueW2uO9EYolN dHTT5GeyvS68IZ48EHftWjO0ovyWgWrAPV46FfoNJSCwp3Nklhp4AWN/0IB35HLMQEym7Qh6U II/i5a3ybhe/GYlkpJXAaETbqsuyDcQirTj3pV6DQDhswmOqZ0Gfkvt0eIVbzumCcJNfUAi2R Jrg8989Sd1ObKIb5UDpjti5F6L1CnpyXxhbJ3nDM6MY/ugoAqAxD4FU7rs1x4T5htk/q//v37 6LI0AKUYo5rHRqIBWqDh+0CVvsfeUv61IXFjJz3rM2Vs5LZZeky4goMoNN0BtaCbCmC89PgD/ fro7vwEokOkcgUh4vCGSOHzktnyYysk7maNJ0oLgXG1dldnWNq6pvVBi/Z9uL/rFBKuVdOqGE vnY8HNd1FOo5yAY1Sp+Xs3xT2kKQzSvz9Atd+/moY0utxxdbmxSG/JIcoPhnz7g3wJptQtSbe s1tpSuGGoTDvr+I0m+wjWDuJ3e6dQqk7hfrNRZ+2dz9KtJqEAnmPl1ZcgwtW6dqN6wjiB4ELx AXWZK+ezk/0ho046B7PuK0xPP5uDfNxaLysuyC+QRVqfCMBKEDi/iY/a4YdWjrllVlJkklHb4 pcCOBq+fiZ4ESB5qzRBBkzcVOy/RxchUXaC/S27Ru7udZZcOaYmeZrVxsJmsd2NHdgDltHVd5 +mN92zqONNWPctXfNa4Z+UqFZ33Pc4oD02gfn5eH6mYZqDltvK+XKFvUMHCoKS66JY4MMkdsK iyIC6TDSlefD+gpbdhByhH0h62SHgkP6kW8K91vRrEcXQ/XcGaJaQSUbCCVdVmersib7KyXM0 AQ0LZUG0mEf5htdU3mi90Qj6XhrcHHatwEm9/tvDwZYVswlscaXpw0CLuT7jSMH+B5JtzG9q3 G6QcQFOOf9zVXBymNcNenpCqVen6CZAWTZVido8c2UZLsBjczOOPj09YwiWIobFe+Db2qpwMN GyKbMO28/cQQpswFt6M2GuqmL0Y= Received-SPF: pass client-ip=212.227.17.22; envelope-from=bogdro_rep@gmx.us; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) This is a multi-part message in MIME format. --------------C2mkojiDBNGRkevM7Zni09ci Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Hello. Referring to the discussion related to the upcoming release, I confirm defect #64837 on Debian GNU/Linux 12 (bookworm) and I confirm that the last patch in #54412 (the one attached in the defect in Message#14 - https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D54412#14, not the one inlined) fixes the issue. I'm also attaching a "double-safe" version, with a simple try-except added, falling back to the old default, just in case. Also tested, also fixes the issue. You can apply whichever you choose. =2D- Regards - Bogdan ('bogdro') D. (GNU/Linux & FreeDOS) X86 assembly (DOS, GNU/Linux): http://bogdro.evai.pl/index-en.php Soft(EN): http://bogdro.evai.pl/soft http://bogdro.evai.pl/soft4asm www.Xiph.org www.TorProject.org www.LibreOffice.org www.GnuPG.org --------------C2mkojiDBNGRkevM7Zni09ci Content-Type: text/x-patch; charset=UTF-8; name="automake-python310-fix-mail.diff" Content-Disposition: attachment; filename="automake-python310-fix-mail.diff" Content-Transfer-Encoding: base64 RnJvbSA5ZWI5ZjkyY2Q0NWYyZjg1ZTUwZmYxMzY3MzE5YjNhZjhlNTEwNmI5IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBCb2dkYW4gRHJvemRvd3NraSA8PgpEYXRlOiBUdWUs IDkgSmFuIDIwMjQgMjI6MzE6NTcgKzAxMDAKU3ViamVjdDogW1BBVENIXSBEb3VibGUtc2Fm ZSBwYXRjaCBmb3IgUHl0aG9uIDMuMTAKCi0tLQogbTQvcHl0aG9uLm00IHwgMjQgKysrKysr KysrKysrKysrKysrKysrKy0tCiAxIGZpbGUgY2hhbmdlZCwgMjIgaW5zZXJ0aW9ucygrKSwg MiBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9tNC9weXRob24ubTQgYi9tNC9weXRob24u bTQKaW5kZXggOGQ0ZTRkMjE1Li5jOTdmZmQyMDMgMTAwNjQ0Ci0tLSBhL200L3B5dGhvbi5t NAorKysgYi9tNC9weXRob24ubTQKQEAgLTI1Niw3ICsyNTYsMTcgQEAgZXhjZXB0IEltcG9y dEVycm9yOgogICAgYW1fY3ZfcHl0aG9uX3B5dGhvbmRpcj1gJFBZVEhPTiAtYyAiCiAkYW1f cHl0aG9uX3NldHVwX3N5c2NvbmZpZwogaWYgY2FuX3VzZV9zeXNjb25maWc6Ci0gIHNpdGVk aXIgPSBzeXNjb25maWcuZ2V0X3BhdGgoJ3B1cmVsaWInLCB2YXJzPXsnYmFzZSc6JyRhbV9w eV9wcmVmaXgnfSkKKyAgdHJ5OgorICAgIGlmIGhhc2F0dHIoc3lzY29uZmlnLCAnZ2V0X2Rl ZmF1bHRfc2NoZW1lJyk6CisgICAgICBzY2hlbWUgPSBzeXNjb25maWcuZ2V0X2RlZmF1bHRf c2NoZW1lKCkKKyAgICBlbHNlOgorICAgICAgc2NoZW1lID0gc3lzY29uZmlnLl9nZXRfZGVm YXVsdF9zY2hlbWUoKQorICAgIGlmIHNjaGVtZSA9PSAncG9zaXhfbG9jYWwnOgorICAgICAg IyBEZWJpYW4ncyBkZWZhdWx0IHNjaGVtZSBpbnN0YWxscyB0byAvdXNyL2xvY2FsLyBidXQg d2Ugd2FudCB0byBmaW5kIGhlYWRlcnMgaW4gL3Vzci8KKyAgICAgIHNjaGVtZSA9ICdwb3Np eF9wcmVmaXgnCisgICAgc2l0ZWRpciA9IHN5c2NvbmZpZy5nZXRfcGF0aCgncHVyZWxpYics IHNjaGVtZSwgdmFycz17J2Jhc2UnOickYW1fcHlfcHJlZml4J30pCisgIGV4Y2VwdDoKKyAg ICBzaXRlZGlyID0gc3lzY29uZmlnLmdldF9wYXRoKCdwdXJlbGliJywgdmFycz17J2Jhc2Un OickYW1fcHlfcHJlZml4J30pCiBlbHNlOgogICBmcm9tIGRpc3R1dGlscyBpbXBvcnQgc3lz Y29uZmlnCiAgIHNpdGVkaXIgPSBzeXNjb25maWcuZ2V0X3B5dGhvbl9saWIoMCwgMCwgcHJl Zml4PSckYW1fcHlfcHJlZml4JykKQEAgLTI5OCw3ICszMDgsMTcgQEAgc3lzLnN0ZG91dC53 cml0ZShzaXRlZGlyKSJgCiAgICBhbV9jdl9weXRob25fcHlleGVjZGlyPWAkUFlUSE9OIC1j ICIKICRhbV9weXRob25fc2V0dXBfc3lzY29uZmlnCiBpZiBjYW5fdXNlX3N5c2NvbmZpZzoK LSAgc2l0ZWRpciA9IHN5c2NvbmZpZy5nZXRfcGF0aCgncGxhdGxpYicsIHZhcnM9eydwbGF0 YmFzZSc6JyRhbV9weV9leGVjX3ByZWZpeCd9KQorICB0cnk6CisgICAgaWYgaGFzYXR0cihz eXNjb25maWcsICdnZXRfZGVmYXVsdF9zY2hlbWUnKToKKyAgICAgIHNjaGVtZSA9IHN5c2Nv bmZpZy5nZXRfZGVmYXVsdF9zY2hlbWUoKQorICAgIGVsc2U6CisgICAgICBzY2hlbWUgPSBz eXNjb25maWcuX2dldF9kZWZhdWx0X3NjaGVtZSgpCisgICAgaWYgc2NoZW1lID09ICdwb3Np eF9sb2NhbCc6CisgICAgICAjIERlYmlhbidzIGRlZmF1bHQgc2NoZW1lIGluc3RhbGxzIHRv IC91c3IvbG9jYWwvIGJ1dCB3ZSB3YW50IHRvIGZpbmQgaGVhZGVycyBpbiAvdXNyLworICAg ICAgc2NoZW1lID0gJ3Bvc2l4X3ByZWZpeCcKKyAgICBzaXRlZGlyID0gc3lzY29uZmlnLmdl dF9wYXRoKCdwbGF0bGliJywgc2NoZW1lLCB2YXJzPXsncGxhdGJhc2UnOickYW1fcHlfZXhl Y19wcmVmaXgnfSkKKyAgZXhjZXB0OgorICAgIHNpdGVkaXIgPSBzeXNjb25maWcuZ2V0X3Bh dGgoJ3BsYXRsaWInLCB2YXJzPXsncGxhdGJhc2UnOickYW1fcHlfZXhlY19wcmVmaXgnfSkK IGVsc2U6CiAgIGZyb20gZGlzdHV0aWxzIGltcG9ydCBzeXNjb25maWcKICAgc2l0ZWRpciA9 IHN5c2NvbmZpZy5nZXRfcHl0aG9uX2xpYigxLCAwLCBwcmVmaXg9JyRhbV9weV9leGVjX3By ZWZpeCcpCi0tIAoyLjM1LjEKCg== --------------C2mkojiDBNGRkevM7Zni09ci-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 17 17:48:36 2024 Received: (at 54412) by debbugs.gnu.org; 17 Jan 2024 22:48:36 +0000 Received: from localhost ([127.0.0.1]:53802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQEi3-00057S-Fj for submit@debbugs.gnu.org; Wed, 17 Jan 2024 17:48:36 -0500 Received: from frenzy.freefriends.org ([198.99.81.75]:54732 helo=freefriends.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQEi1-000579-Lo for 54412@debbugs.gnu.org; Wed, 17 Jan 2024 17:48:34 -0500 X-Envelope-From: karl@freefriends.org Received: from freefriends.org (localhost [127.0.0.1]) by freefriends.org (8.14.7/8.14.7) with ESMTP id 40HMmVMG032234 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jan 2024 15:48:31 -0700 Received: (from apache@localhost) by freefriends.org (8.14.7/8.14.7/Submit) id 40HMmUiO032233; Wed, 17 Jan 2024 15:48:30 -0700 Date: Wed, 17 Jan 2024 15:48:30 -0700 Message-Id: <202401172248.40HMmUiO032233@freefriends.org> From: Karl Berry To: stefanor@debian.org, locutusofborg@debian.org Subject: Re: [bug#54412] [PATCH] python: use the posix_prefix sysconfig scheme on Debian In-Reply-To: <20220315233056.2610021-1-stefanor@debian.org> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 54412 Cc: 54412@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gianfranoc, Stefano - thanks much for the patch wrt Automake and Debian Python posix_local vs. posix_prefix. Below is what I installed -- the code change is substantively the same as what you wrote; I just took the extra try..catch that Bogdan added. I changed the paragraph in the manual about pythondir. If you could look at it, that would be great. Is it correct that the basic idea is that, with this change, Automake again follows --prefix (and related) + using site-packages instead of Debian's defaults of /usr/local and dist-packages? --thanks, karl. ------------------------------------------------------------------------------- python: use posix_prefix instead of posix_local on Debian. >From https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54412#17. (Patch slightly adapted by Bogdan from original by Gianfranco, as posted by Stefano Rivera in message#14.) * m4/python.m4 (AM_PATH_PYTHON): replace Debian's posix_local scheme with posix_prefix. * doc/automake.texi (Python) : say a bit more. * NEWS: mention this. diff --git a/NEWS b/NEWS index c53573a0a..2b2da0908 100644 --- a/NEWS +++ b/NEWS + - The installation directory for Python files again defaults to + "site-packages" under the usual installation prefix, even on systems + (generally Debian-based) that would normally use the "dist-packages" + subdirectory under /usr/local. (bug#54412, bug#64837) + - When compiling Emacs Lisp files, emacs is run with --no-site-file to disable user config files that might hang or access the terminal; and -Q is not used, since its support and behavior varies. (bug#58102) diff --git a/doc/automake.texi b/doc/automake.texi index c63279a9e..ecefe2dc6 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -7987,8 +7987,18 @@ building Python extensions. @item pythondir @cindex @file{site-packages} Python directory -The directory name for the @file{site-packages} subdirectory of the -standard Python install tree. +@cindex @file{dist-packages} Python directory +The subdirectory of the Python install tree in which to install Python +scripts. By default this is, on all systems, +@file{$PYTHON_PREFIX/lib/python@var{version}/site-packages}, where +@code{$PYTHON_PREFIX} is described above, and @var{version} is the +Python version. (For those knowledgeable about Python installation +details: systems generally have their own Python installation scheme, +such as @code{posix_local} on Debian and related (as of +Python@tie{}3.10), which ends up using a directory named +@file{dist-packages}; Automake uses the @code{posix_prefix} scheme and +@file{site-packages}.) +@c https://bugs.gnu.org/54412 et al. @item pkgpythondir This is the directory under @code{pythondir} that is named after the diff --git a/m4/python.m4 b/m4/python.m4 index 2de57c52a..f90c73d93 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -243,9 +243,9 @@ except ImportError: dnl 1. pythondir: where to install python scripts. This is the dnl site-packages directory, not the python standard library - dnl directory like in previous automake betas. This behavior + dnl directory as in early automake betas. This behavior dnl is more consistent with lispdir.m4 for example. - dnl Query distutils for this directory. + dnl Query sysconfig or distutils (per above) for this directory. dnl AC_CACHE_CHECK([for $am_display_PYTHON script directory (pythondir)], [am_cv_python_pythondir], @@ -257,7 +257,19 @@ 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'}) + try: + if hasattr(sysconfig, 'get_default_scheme'): + scheme = sysconfig.get_default_scheme() + else: + scheme = sysconfig._get_default_scheme() + if scheme == 'posix_local': + # Debian's default scheme installs to /usr/local/ but we want to + # follow the prefix, as we always have. + # See bugs#54412, #64837, et al. + scheme = 'posix_prefix' + sitedir = sysconfig.get_path('purelib', scheme, vars={'base':'$am_py_prefix'}) + except: + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) else: from distutils import sysconfig sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') @@ -287,7 +299,7 @@ sys.stdout.write(sitedir)"` dnl 3. pyexecdir: directory for installing python extension modules dnl (shared libraries). - dnl Query distutils for this directory. + dnl Query sysconfig or distutils for this directory. dnl AC_CACHE_CHECK([for $am_display_PYTHON extension module directory (pyexecdir)], [am_cv_python_pyexecdir], @@ -299,7 +311,17 @@ 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'}) + try: + if hasattr(sysconfig, 'get_default_scheme'): + scheme = sysconfig.get_default_scheme() + else: + scheme = sysconfig._get_default_scheme() + if scheme == 'posix_local': + # See scheme comments above. + scheme = 'posix_prefix' + sitedir = sysconfig.get_path('platlib', scheme, vars={'platbase':'$am_py_exec_prefix'}) + except: + sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) else: from distutils import sysconfig sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix') compile finished at Wed Jan 17 14:46:23 2024 From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 17 19:27:30 2024 Received: (at 54412) by debbugs.gnu.org; 18 Jan 2024 00:27:30 +0000 Received: from localhost ([127.0.0.1]:53995 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQGFm-0007Q7-Cl for submit@debbugs.gnu.org; Wed, 17 Jan 2024 19:27:30 -0500 Received: from satie.tumbleweed.org.za ([2a01:4f8:10b:3721::2]:60714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQGFg-0007Pn-1D for 54412@debbugs.gnu.org; Wed, 17 Jan 2024 19:27:29 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=debian.org; i=@debian.org; q=dns/txt; s=satie-ed25519.stefanor.user; t=1705537639; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : content-transfer-encoding : in-reply-to : from; bh=i/Ilylao/2jWdVO+FH9xyOi+SYPm5gEfH5sgxijfPxA=; b=6G5dE6RjA99ZBiDjed1sHCd4Oa4/d4BIAJlhI8c8x+jqbH3sCptmyjm7lV/rlTqGHo3I0 Z8NN8Rnm59/CFwtAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=debian.org; i=@debian.org; q=dns/txt; s=satie-rsa.stefanor.user; t=1705537639; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : content-transfer-encoding : in-reply-to : from; bh=i/Ilylao/2jWdVO+FH9xyOi+SYPm5gEfH5sgxijfPxA=; b=2CLyfco/ShUhUgcNrNcR+E30bjp92IEz1DKDWHa/jFZKQb+UF2ra9+hGkfBRTqzOsUTXT KpPTfuBm1ZqFc+v3YC/KmUBJ/48tHoSuI2FcyIAOiNxHITMT3apHNsCdm4zO2CXagvibT9F wPytGQiPG2EWz0pzsgwbo9RtDOeNnaSw7bNXZfV2iHKItdFFt9r5s85rqfbPMVOXa2bxTLn 24bm5WdxGqJ/NG5KxYZ/mbhotgi5zpEBIitqbXQlJKOAu2efEhCaLOJcg3e1ox4kIrzf5Cd rd7QFR7YQR5o+ooPXCX86mlCmqU6lFyf0tYHCLYTfobQbK60ci0FbB0gG7mw== Received: by satie.tumbleweed.org.za (Postfix, from userid 1000) id B2AC0DCDF37; Thu, 18 Jan 2024 00:27:19 +0000 (UTC) Date: Thu, 18 Jan 2024 00:27:19 +0000 From: stefanor@debian.org To: Karl Berry Subject: Re: [bug#54412] [PATCH] python: use the posix_prefix sysconfig scheme on Debian Message-ID: <20240118002719.wjrjnqdyadsb6l53@satie.tumbleweed.org.za> X-GPG-Public-Key: https://www.rivera.za.net/stefano.gpg References: <20220315233056.2610021-1-stefanor@debian.org> <202401172248.40HMmUiO032233@freefriends.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <202401172248.40HMmUiO032233@freefriends.org> User-Agent: NeoMutt/20220429 X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 54412 Cc: locutusofborg@debian.org, 54412@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Hi Karl (2024.01.17_22:48:30_+0000) > Gianfranoc, Stefano - thanks much for the patch wrt Automake and Debian > Python posix_local vs. posix_prefix. Below is what I installed -- the > code change is substantively the same as what you wrote; I just took the > extra try..catch that Bogdan added. >=20 > I changed the paragraph in the manual about pythondir. If you could look > at it, that would be great. Is it correct that the basic idea is that, > with this change, Automake again follows --prefix (and related) + using > site-packages instead of Debian's defaults of /usr/local and > dist-packages? --thanks, karl. Thanks for the review. You're right about that being a part of this patch. I didn't put much thought into that bit, because in the context of Debian package builds, it's inconsequential. (Our Python package tooling will find things that got installed into site-packages and move them into dist-packages.) This patch does have the effect of moving the installation destination =66rom dist-packages to site-packages. But previously (before this patch was needed) Debian's sysconfig module wasn't patched to know about dist-packages. So, if we are comparing to that point in time, this is returning automake behaviour back to what it used to be. Improving on that gets tricky. Installs into /usr/local should go into /usr/local/lib/pythonX.Y/dist-packages. This is what the posix_local scheme will provide, no matter what prefix it is specified. Installs into /usr/ shouldn't happen on a Debian system, outside a Debian package build. But there, they should go into /usr/lib/python3/dist-packages. This is what the deb_system scheme will provide, no matter what prefix is specified. Using the posix_prefix scheme was a lazy way to use the prefix, and restore the old behaviour. We could special-case both the '/usr' and '/usr/local' prefixes and select 'posix_local' and 'deb_system' schemes, as appropriate. The logic would boil down to: if default_scheme =3D=3D 'posix_local': # Debian if prefix =3D=3D '/usr': scheme =3D 'deb_system' # Should only happen during Debian package = builds elif prefix !=3D '/usr/local': scheme =3D 'posix_prefix' How does that sound? Stefano --=20 Stefano Rivera http://tumbleweed.org.za/ +1 415 683 3272 From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 18 17:58:34 2024 Received: (at 54412) by debbugs.gnu.org; 18 Jan 2024 22:58:34 +0000 Received: from localhost ([127.0.0.1]:56927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQbLG-0000je-AH for submit@debbugs.gnu.org; Thu, 18 Jan 2024 17:58:34 -0500 Received: from frenzy.freefriends.org ([198.99.81.75]:45906 helo=freefriends.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQbLF-0000jV-3T for 54412@debbugs.gnu.org; Thu, 18 Jan 2024 17:58:33 -0500 X-Envelope-From: karl@freefriends.org Received: from freefriends.org (localhost [127.0.0.1]) by freefriends.org (8.14.7/8.14.7) with ESMTP id 40IMwUIH030810 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Jan 2024 15:58:30 -0700 Received: (from apache@localhost) by freefriends.org (8.14.7/8.14.7/Submit) id 40IMwUBb030809; Thu, 18 Jan 2024 15:58:30 -0700 Date: Thu, 18 Jan 2024 15:58:30 -0700 Message-Id: <202401182258.40IMwUBb030809@freefriends.org> From: Karl Berry To: stefanor@debian.org Subject: Re: [bug#54412] [PATCH] python: use the posix_prefix sysconfig scheme on Debian In-Reply-To: <20240118002719.wjrjnqdyadsb6l53@satie.tumbleweed.org.za> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 54412 Cc: locutusofborg@debian.org, 54412@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Stefano, returning automake behaviour back to what it used to be. That seems like a good outcome to me. I wasn't actually looking to improve on that result :). if default_scheme == 'posix_local': # Debian posix_local only exists on Debian, not any other system? The name is generic. In any case, I guess it would be safe if it's possible to check if the deb_system scheme exists, and only do the special casing if both posix_local and deb_system are present. Wdyt? --thanks, karl. From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 18 18:29:35 2024 Received: (at 54412) by debbugs.gnu.org; 18 Jan 2024 23:29:35 +0000 Received: from localhost ([127.0.0.1]:56979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQbpH-0006rN-2N for submit@debbugs.gnu.org; Thu, 18 Jan 2024 18:29:35 -0500 Received: from satie.tumbleweed.org.za ([94.130.89.142]:48038) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQbpE-0006rD-LU for 54412@debbugs.gnu.org; Thu, 18 Jan 2024 18:29:34 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=debian.org; i=@debian.org; q=dns/txt; s=satie-ed25519.stefanor.user; t=1705620568; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=UB3IV7oODO5ysbLSLQ8wjj707Q4M6HCSMkOW6j9J/10=; b=3iRo9I17PrjO46NlA8M3r7Ac8kbyOpTU2Gng3fzBSTbRsCABrtjf1TwUTQes8Myt6AKSA 5autHjD56SojA6GDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=debian.org; i=@debian.org; q=dns/txt; s=satie-rsa.stefanor.user; t=1705620568; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=UB3IV7oODO5ysbLSLQ8wjj707Q4M6HCSMkOW6j9J/10=; b=pltAx/w1MvEGmUPaXCTp7+AAOOQVCrAuFBw10uM3U8YJUJlihm0IH2y1vkISzlKw9E9yu lBiaPOFWa+gAgc1+LLWv6FGlWfvCY+9N/H4yYEAv/BXdkbOuoZvVzJ8OCrnyn6SvLRK2//g eaECtLgFF0b71QI7hH0Q/jVt+GHyMyM6BybiUCP6tzA19JI3mqBZXFBQw7TZUWEk8N56ypS R2tQc+ix8VApEgYTAVDH6/uCBPq3EyNUDXas6JvZ9x5lHvJ5xrQvxkh2lTSgTh0MpOpfgk/ 9un9ZxasTXkmJy1wFN+IA7dI49fq254Lnyh789QO/02XtwntphdoebNPOj/g== Received: by satie.tumbleweed.org.za (Postfix, from userid 1000) id 60D03DCE884; Thu, 18 Jan 2024 23:29:28 +0000 (UTC) Date: Thu, 18 Jan 2024 23:29:28 +0000 From: stefanor@debian.org To: Karl Berry Subject: Re: [bug#54412] [PATCH] python: use the posix_prefix sysconfig scheme on Debian Message-ID: <20240118232928.tuq2a5qhchrz56ox@satie.tumbleweed.org.za> X-GPG-Public-Key: https://www.rivera.za.net/stefano.gpg References: <20240118002719.wjrjnqdyadsb6l53@satie.tumbleweed.org.za> <202401182258.40IMwUBb030809@freefriends.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <202401182258.40IMwUBb030809@freefriends.org> User-Agent: NeoMutt/20220429 X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 54412 Cc: locutusofborg@debian.org, 54412@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Hi Karl (2024.01.18_22:58:30_+0000) > if default_scheme == 'posix_local': # Debian > > posix_local only exists on Debian, not any other system? > The name is generic. Yes, it's a Debianism. It was the best way to get "setup.py install" to direct to /usr/local by default, on Debian systems, at the time. And we've had to carry that API since. > In any case, I guess it would be safe if it's possible to check if the > deb_system scheme exists, and only do the special casing if both > posix_local and deb_system are present. Yeah that sounds nice and safe. But I'm not aware of anyone else using posix_local. Stefano -- Stefano Rivera http://tumbleweed.org.za/ +1 415 683 3272 From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 20 17:40:45 2024 Received: (at 54412) by debbugs.gnu.org; 20 Jan 2024 22:40:45 +0000 Received: from localhost ([127.0.0.1]:36082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRK17-0004qQ-4s for submit@debbugs.gnu.org; Sat, 20 Jan 2024 17:40:45 -0500 Received: from frenzy.freefriends.org ([198.99.81.75]:49392 helo=freefriends.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRK15-0004qA-5h for 54412@debbugs.gnu.org; Sat, 20 Jan 2024 17:40:44 -0500 X-Envelope-From: karl@freefriends.org Received: from freefriends.org (localhost [127.0.0.1]) by freefriends.org (8.14.7/8.14.7) with ESMTP id 40KMedrZ030051 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 20 Jan 2024 15:40:39 -0700 Received: (from apache@localhost) by freefriends.org (8.14.7/8.14.7/Submit) id 40KMeckq030050; Sat, 20 Jan 2024 15:40:38 -0700 Date: Sat, 20 Jan 2024 15:40:38 -0700 Message-Id: <202401202240.40KMeckq030050@freefriends.org> From: Karl Berry To: stefanor@debian.org Subject: Re: [bug#54412] [PATCH] python: use the posix_prefix sysconfig scheme on Debian In-Reply-To: <20240118232928.tuq2a5qhchrz56ox@satie.tumbleweed.org.za> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 54412 Cc: locutusofborg@debian.org, 54412@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Stefano, I'm not aware of anyone else using posix_local. Well, I don't know how to check for the deb_system scheme being present, so I made the assumption. How does this change look? Are the descriptions correct? I also pulled out the common "scheme-setting" code into a variable. Thanks, Karl ----------------------------------------------------------------------------- python: use deb_system instead of posix_local if prefix = /usr. Continuing with https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54412. * m4/python.m4 (AM_PATH_PYTHON) : factor out common scheme-related code to this new variable. If the scheme is posix_local and the prefix is /usr, use deb_system (for Debian package builds). * NEWS: more explanations (and unrelated references, en passant). diff --git a/NEWS b/NEWS index 2b2da0908..153cb7733 100644 @@ -67,10 +70,15 @@ New in 1.17: - Compiling Python modules with Python 3.5+ uses multiple optimization levels. (bug#38043) - - The installation directory for Python files again defaults to - "site-packages" under the usual installation prefix, even on systems - (generally Debian-based) that would normally use the "dist-packages" - subdirectory under /usr/local. (bug#54412, bug#64837) + - If the Python installation "scheme" is set to posix_local (Debian), + it is reset to either deb_system (if the prefix = /usr), or + posix_prefix (otherwise). (bug#54412, bug#64837) + + - As a result of the Python scheme change, the installation directory + for Python files again defaults to "site-packages" under the usual + installation prefix, even on systems (generally Debian-based) that + would normally use the "dist-packages" subdirectory under + /usr/local. - When compiling Emacs Lisp files, emacs is run with --no-site-file to disable user config files that might hang or access the terminal; diff --git a/m4/python.m4 b/m4/python.m4 index f90c73d93..0b1db2689 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -237,7 +237,21 @@ try: if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7': can_use_sysconfig = 0 except ImportError: - pass" + pass" # end of am_python_setup_sysconfig + + # More repeated code, for figuring out the installation scheme to use. + am_python_setup_scheme="if hasattr(sysconfig, 'get_default_scheme'): + scheme = sysconfig.get_default_scheme() + else: + scheme = sysconfig._get_default_scheme() + if scheme == 'posix_local': + if '$am_py_prefix' == '/usr': + scheme = 'deb_system' # should only happen during Debian package builds + else: + # Debian's default scheme installs to /usr/local/ but we want to + # follow the prefix, as we always have. + # See bugs#54412, #64837, et al. + scheme = 'posix_prefix'" # end of am_python_setup_scheme dnl emacs-page Set up 4 directories: @@ -258,15 +272,7 @@ except ImportError: $am_python_setup_sysconfig if can_use_sysconfig: try: - if hasattr(sysconfig, 'get_default_scheme'): - scheme = sysconfig.get_default_scheme() - else: - scheme = sysconfig._get_default_scheme() - if scheme == 'posix_local': - # Debian's default scheme installs to /usr/local/ but we want to - # follow the prefix, as we always have. - # See bugs#54412, #64837, et al. - scheme = 'posix_prefix' + $am_python_setup_scheme sitedir = sysconfig.get_path('purelib', scheme, vars={'base':'$am_py_prefix'}) except: sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) @@ -300,6 +306,7 @@ sys.stdout.write(sitedir)"` dnl 3. pyexecdir: directory for installing python extension modules dnl (shared libraries). dnl Query sysconfig or distutils for this directory. + dnl Much of this is the same as for prefix setup above. dnl AC_CACHE_CHECK([for $am_display_PYTHON extension module directory (pyexecdir)], [am_cv_python_pyexecdir], @@ -312,13 +319,7 @@ sys.stdout.write(sitedir)"` $am_python_setup_sysconfig if can_use_sysconfig: try: - if hasattr(sysconfig, 'get_default_scheme'): - scheme = sysconfig.get_default_scheme() - else: - scheme = sysconfig._get_default_scheme() - if scheme == 'posix_local': - # See scheme comments above. - scheme = 'posix_prefix' + $am_python_setup_scheme sitedir = sysconfig.get_path('platlib', scheme, vars={'platbase':'$am_py_exec_prefix'}) except: sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) compile finished at Sat Jan 20 14:31:01 2024 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 23 16:50:04 2024 Received: (at 54412) by debbugs.gnu.org; 23 Jan 2024 21:50:04 +0000 Received: from localhost ([127.0.0.1]:44077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSOei-0003wG-Ei for submit@debbugs.gnu.org; Tue, 23 Jan 2024 16:50:04 -0500 Received: from frenzy.freefriends.org ([198.99.81.75]:33694 helo=freefriends.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSOea-0003uj-IY; Tue, 23 Jan 2024 16:49:56 -0500 X-Envelope-From: karl@freefriends.org Received: from freefriends.org (localhost [127.0.0.1]) by freefriends.org (8.14.7/8.14.7) with ESMTP id 40NLno8D028383 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Jan 2024 14:49:51 -0700 Received: (from apache@localhost) by freefriends.org (8.14.7/8.14.7/Submit) id 40NLnoNO028377; Tue, 23 Jan 2024 14:49:50 -0700 Date: Tue, 23 Jan 2024 14:49:50 -0700 Message-Id: <202401232149.40NLnoNO028377@freefriends.org> From: Karl Berry To: stefanor@debian.org, 54412@debbugs.gnu.org Subject: Re: [bug#54412] [PATCH] python: use the posix_prefix sysconfig scheme on Debian X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 54412 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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. From unknown Sun Jun 22 11:32:53 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 21 Feb 2024 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator