Message ID | m1sf3djmjg.fsf@fastmail.net |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4EBE727BBEA; Thu, 4 Jan 2024 12:45:14 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 719A827BBE2 for <patchwork@mira.cbaines.net>; Thu, 4 Jan 2024 12:45:13 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces@gnu.org>) id 1rLN5p-0003j0-FG; Thu, 04 Jan 2024 07:45:01 -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 <Debian-debbugs@debbugs.gnu.org>) id 1rLN5n-0003gr-4f for guix-patches@gnu.org; Thu, 04 Jan 2024 07:44:59 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1rLN5m-0007io-No for guix-patches@gnu.org; Thu, 04 Jan 2024 07:44:58 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1rLN5q-0004z5-A9 for guix-patches@gnu.org; Thu, 04 Jan 2024 07:45:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68241] [PATCH] gnu: python: Fix sitecustomize.py Resent-From: Konrad Hinsen <konrad.hinsen@fastmail.net> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 04 Jan 2024 12:45:02 +0000 Resent-Message-ID: <handler.68241.B.170437228219114@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68241 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68241@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170437228219114 (code B ref -1); Thu, 04 Jan 2024 12:45:02 +0000 Received: (at submit) by debbugs.gnu.org; 4 Jan 2024 12:44:42 +0000 Received: from localhost ([127.0.0.1]:53854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1rLN5V-0004yE-PO for submit@debbugs.gnu.org; Thu, 04 Jan 2024 07:44:42 -0500 Received: from lists.gnu.org ([2001:470:142::17]:46964) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <konrad.hinsen@fastmail.net>) id 1rLN5S-0004xw-Ad for submit@debbugs.gnu.org; Thu, 04 Jan 2024 07:44:40 -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 <konrad.hinsen@fastmail.net>) id 1rLN5I-0003Z9-Sh for guix-patches@gnu.org; Thu, 04 Jan 2024 07:44:28 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <konrad.hinsen@fastmail.net>) id 1rLN5F-0007cz-Do for guix-patches@gnu.org; Thu, 04 Jan 2024 07:44:27 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 1D1CB5C0148; Thu, 4 Jan 2024 07:44:22 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 04 Jan 2024 07:44:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.net; h= cc:content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm2; t=1704372262; x=1704458662; bh=rNaw0PSg01SRAFMdD6Q2m0OGRM+YMeud et/W+HRQeAU=; b=U63BvlMRzdfoLGjP/usgSxHri0CyUq0hgcsQlJE+FnjDUbqV d/Gad910pea88XIXke3wPlQvpNhQ1lXoTPvMa95v0xKJuSaGODvthrTcD7i/OlQu ESYJuxivVFDxToicCYGujP8Um8NojLF4kXBXns1G4Yl4m+Ny4596aSVh6qLgC05Z tCtErvsqE5x/fL8Ee8JSMX56CvYcWiSXIYzYxXxXg9P3BQv23M/QciViHlGH7/H1 vxfyp4ax9JQrikeOR8l2tQrmTI+FPLmDiSS8VYlK0IV+ZvnCD+hVS8D/AJRsKCVl ea/D/8+nbVmSeg+tb1HFd7gF557eifl1O+0Ukg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1704372262; x=1704458662; bh=rNaw0PSg01SRAFMdD6Q2m0OGRM+YMeudet/ W+HRQeAU=; b=5UPMzB+TIuMApbKIVhfbU0SDuB9ZpsmKqjGCh1MvAc3dNHPGGOD 5w4i1w4x6ETvrFeyA4XgJMUHI/6pfiVH8UX2ApNWQ4p+SYIazEQOjPPem1dEABk3 AD7ma1osqwopBHdfutc7VHaXYmetntzQPBrx3L297vUVxM/055Gw6uEOPVjq/+lk v3b8zzM89TYE1PYdmpkMd5Ly+4AksMsK8EPa3UrCLD0KlztItzLR94GtwltNz+D+ jy6rJQVyLo7oEEjrqmQl0JcxDXByo/TqJ2RJ4ThXsTRuv9Eck7/E7lv4BFaRNvM6 w/Jt7feG9VNiQf8ZiiVCLs71hBQDf+zyedg== X-ME-Sender: <xms:JaiWZctSXFXSFT4CDqL2nvJ70-l4zp97QZQFecADkisZ9XUtqlTmog> <xme:JaiWZZe-y-_vte7eTHP1OpIgPKqQOo-SJmUv1ppUvvoDX_gvrytOZLO72E8yEEGPf rn9MzghJv6ntYTo> X-ME-Received: <xmr:JaiWZXwokMO42yCM5is3JhxlNI5B7cIQLCuGHBObYodjNaqAmhP8NnuXsqUluQk3zUxUxD4ICjFhpP-nP3p6qa2GOLOMBQ> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdegjedggeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkgggtsehttdertddttd dtnecuhfhrohhmpefmohhnrhgrugcujfhinhhsvghnuceokhhonhhrrggurdhhihhnshgv nhesfhgrshhtmhgrihhlrdhnvghtqeenucggtffrrghtthgvrhhnpeegveetieefgeefhe efvdfgkeejuedtgfeugfefvdfhueetieefvdehteeftdefheenucffohhmrghinhepghhn uhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehkohhnrhgrugdrhhhinhhsvghnsehfrghsthhmrghilhdrnhgvth X-ME-Proxy: <xmx:JaiWZfMQ9Od_PFA5ewVAN5mkmfYLi2CLNDfgUOKnbR-sA-Ea8D4IPA> <xmx:JaiWZc9NbaD33HWboDLyC5o_38PNBjmNmaHFJ8OmbchIjnGMshpSXA> <xmx:JaiWZXW3LEC_xQYon9ULaKw5H1trGYa55DPrEmzdBFz24EfKeZSOOQ> <xmx:JqiWZRFZ88TLoXBWuxEGfHhylYtF1wit-QH4MkoM_d5nSOstTFtDPA> Feedback-ID: i184641e2:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 Jan 2024 07:44:21 -0500 (EST) From: Konrad Hinsen <konrad.hinsen@fastmail.net> Date: Thu, 04 Jan 2024 13:44:19 +0100 Message-ID: <m1sf3djmjg.fsf@fastmail.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=66.111.4.27; envelope-from=konrad.hinsen@fastmail.net; helo=out3-smtp.messagingengine.com 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches |
Series |
[bug#68241] gnu: python: Fix sitecustomize.py
|
|
Commit Message
Konrad Hinsen
Jan. 4, 2024, 12:44 p.m. UTC
* gnu/packages/aux-files/python/sitecustomize.py: normalize sys.prefix to deal with situations where it contains "../" This happens in particular when running Python from a Singularity image created by Guix. See https://issues.guix.gnu.org/53258. Change-Id: Ibfe13d7c2a14beaa199f599e64bc0b7bfb500fe8 --- gnu/packages/aux-files/python/sitecustomize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: 7b0863f07a113caef26fea13909bd97d250b629e
Comments
Konrad Hinsen <konrad.hinsen@fastmail.net> writes: > * gnu/packages/aux-files/python/sitecustomize.py: normalize sys.prefix > to deal with situations where it contains "../" This patch leads to massive rebuilds for non-trivial environments. I will submit an alternative that patches Python via a graft. Cheers, Konrad.
Hi Konrad! Konrad Hinsen <konrad.hinsen@fastmail.net> skribis: > * gnu/packages/aux-files/python/sitecustomize.py: normalize sys.prefix > to deal with situations where it contains "../" > > This happens in particular when running Python from a Singularity image > created by Guix. See https://issues.guix.gnu.org/53258. > > Change-Id: Ibfe13d7c2a14beaa199f599e64bc0b7bfb500fe8 > --- > gnu/packages/aux-files/python/sitecustomize.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gnu/packages/aux-files/python/sitecustomize.py b/gnu/packages/aux-files/python/sitecustomize.py > index e2348e0356..82ea91104d 100644 > --- a/gnu/packages/aux-files/python/sitecustomize.py > +++ b/gnu/packages/aux-files/python/sitecustomize.py > @@ -37,7 +37,7 @@ import sys > major_minor = '{}.{}'.format(*sys.version_info) > site_packages_prefix = os.path.join( > 'lib', 'python' + major_minor, 'site-packages') > -python_site = os.path.join(sys.prefix, site_packages_prefix) > +python_site = os.path.normpath(os.path.join(sys.prefix, site_packages_prefix)) IIRC Josselin had a patch for <https://issues.guix.gnu.org/53258>, but I can’t find it. Josselin? Also, do I get it right that the patch you sent fixes more than #53258? Thanks! Ludo’.
Hi Ludo,
> Also, do I get it right that the patch you sent fixes more than #53258?
#53258 is two things: a weird error message, and a failure to run valid
Python code, the two being possibly related.
My patch fixes the error message. The Python example that Marek gave
already works fine in today's Guix, so it was probably fixed by
something else as a side effect.
Could the bug that causes the error message also mess up valid Python
code? In theory, yes, but I don't have an example at hand.
Cheers,
Konrad.
Hi Konrad, Konrad Hinsen <konrad.hinsen@fastmail.net> writes: > Hi Ludo, > >> Also, do I get it right that the patch you sent fixes more than #53258? > > #53258 is two things: a weird error message, and a failure to run valid > Python code, the two being possibly related. > > My patch fixes the error message. The Python example that Marek gave > already works fine in today's Guix, so it was probably fixed by > something else as a side effect. Oh? And you tested using the exact same reproducer, using a relocatable pack?
Maxim Cournoyer <maxim.cournoyer@gmail.com> writes: >> My patch fixes the error message. The Python example that Marek gave >> already works fine in today's Guix, so it was probably fixed by >> something else as a side effect. > > Oh? And you tested using the exact same reproducer, using a relocatable > pack? Yes, I tested it in a Singularity container. Cheers, konrad.
Hi Konrad, Konrad Hinsen <konrad.hinsen@fastmail.net> writes: > Maxim Cournoyer <maxim.cournoyer@gmail.com> writes: > >>> My patch fixes the error message. The Python example that Marek gave >>> already works fine in today's Guix, so it was probably fixed by >>> something else as a side effect. >> >> Oh? And you tested using the exact same reproducer, using a relocatable >> pack? > > Yes, I tested it in a Singularity container. Great, it's now on core-updates.
Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
> Great, it's now on core-updates.
Thanks!
Konrad.
diff --git a/gnu/packages/aux-files/python/sitecustomize.py b/gnu/packages/aux-files/python/sitecustomize.py index e2348e0356..82ea91104d 100644 --- a/gnu/packages/aux-files/python/sitecustomize.py +++ b/gnu/packages/aux-files/python/sitecustomize.py @@ -37,7 +37,7 @@ import sys major_minor = '{}.{}'.format(*sys.version_info) site_packages_prefix = os.path.join( 'lib', 'python' + major_minor, 'site-packages') -python_site = os.path.join(sys.prefix, site_packages_prefix) +python_site = os.path.normpath(os.path.join(sys.prefix, site_packages_prefix)) try: all_sites_raw = os.environ['GUIX_PYTHONPATH'].split(os.path.pathsep)