From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id iKacFnzt/GZ7SwAAqHPOHw:P1 (envelope-from ) for ; Wed, 02 Oct 2024 06:51:40 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id iKacFnzt/GZ7SwAAqHPOHw (envelope-from ) for ; Wed, 02 Oct 2024 08:51:40 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=VlFfeUmw; dkim=fail ("headers rsa verify failed") header.d=fastmail.net header.s=fm2 header.b=jhxd6DuM; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b="M h8suPx"; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=fastmail.net (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1727851900; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=tIUgxYt3Jg1qTzoRsdLL+2hnHLXGOeTOVd/VdRDk/Oc=; b=QiPvxt6L5XyW2Otz7rQ8AOfLf2OG7+psBFvWNpt6kIw/C/UOGaQZ3ocqKBWaKs7v7/V/3Z 7j3RE03aJN3/asMgVhNivlg+R31kJL4ZXzPpjYqij5aXHh/PVmEVOzRk/ORbkAWfSyVXS8 sRPHSItXfdbPKOkI4Y2bI3jJ5LzwUCCLvUd9TNlE2BMIBvT/s9oW5qhJapi/QEiTNtQvIQ CeCdhvCsXdy7Y2akuYpKJa/TdV56v1zPnu1XISpa8kyUWnG0Fpo9HrgaMWL1Qy7+MY8bsU O2cNG1QtEkwFLaA5ralBaVfh20T+zJ1BEpiDBVLHAYBRi80Iy96LtS2sWVecpg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=VlFfeUmw; dkim=fail ("headers rsa verify failed") header.d=fastmail.net header.s=fm2 header.b=jhxd6DuM; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b="M h8suPx"; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=fastmail.net (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1727851900; a=rsa-sha256; cv=none; b=f0V9zN4sIXlE45mlHBM+FdOtZTaN8CRA7E+fxiKXxGZ5oTsYyOhRM4BziCrtQwDtElXXQ3 npi750S3CWZprb1Ct5il68pxPL5S3oTYQ4S76Lnu+iSuF+PNhz8vhx1cvVOFc6m0nA2LjK CqbBtyi8Jnd6+cAqDDZ0LgkDdoGVzkonhzmL2aTiNepnYpa76WCuRgvBIXWx+QeWGXS/1L 6RCaJNIFXgadFfCXeWizIQXypsoZsmq03s9QGqR4Ms8N0cpmSPiwwJawqKYG+vXWUIWPEr Fs0R7nxU/hJwv89nZ/mYIKoCJdfj2EVbradeoLKqFqr2XBO7RHLkP6fRpmqb4A== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 802568E156 for ; Wed, 02 Oct 2024 08:51:39 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1svskR-0007lb-6X; Wed, 02 Oct 2024 02:22:07 -0400 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 1svskM-0007l2-KX for bug-guix@gnu.org; Wed, 02 Oct 2024 02:22:02 -0400 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 ) id 1svskM-0008RH-Bn for bug-guix@gnu.org; Wed, 02 Oct 2024 02:22:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=tIUgxYt3Jg1qTzoRsdLL+2hnHLXGOeTOVd/VdRDk/Oc=; b=VlFfeUmwgxTHxidG7r5f4DFJaYUmy7zAM7N4rH4iBuf0IURQqhoW+z8tgl0HkreUjHOR2JDfY3tb4l3qk5HYAD+Gp8tcuhzpyDNICJkHuAKw6UeUEYFLkOOntmYVGPKnGjzdmy4iF1MIi1yoGtUEmgN9DBLzlGAl+BfiXkUafdAIliKiWDamJUEBrYDlS2vUyjMK/L2mnIQluiVeoEQeI7SM+HfzGgK4/CWRwKlugHYao5+SEIPlTJhH9F8u6UL1UUdyzH/X1wcyZXKLPgzSWtoGUAiFn95GKUeNlA+iaMhAE8dcHZH7mnG7UjTxz4NzQKytcoX+oH9tbyBdngkV/Q==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1svskM-0002UD-CO for bug-guix@gnu.org; Wed, 02 Oct 2024 02:22:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#73304: Python in relocatable guix pack leads to wrong sys.path Resent-From: Konrad Hinsen Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 02 Oct 2024 06:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73304 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Rutherther Cc: 73304@debbugs.gnu.org, Josselin Poiret , Maxim Cournoyer Received: via spool by 73304-submit@debbugs.gnu.org id=B73304.17278500629456 (code B ref 73304); Wed, 02 Oct 2024 06:22:02 +0000 Received: (at 73304) by debbugs.gnu.org; 2 Oct 2024 06:21:02 +0000 Received: from localhost ([127.0.0.1]:56332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svsjN-0002SH-W0 for submit@debbugs.gnu.org; Wed, 02 Oct 2024 02:21:02 -0400 Received: from fout-a6-smtp.messagingengine.com ([103.168.172.149]:38319) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svsjL-0002Rq-Pt for 73304@debbugs.gnu.org; Wed, 02 Oct 2024 02:21:00 -0400 Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfout.phl.internal (Postfix) with ESMTP id 9086313804A4; Wed, 2 Oct 2024 02:20:54 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Wed, 02 Oct 2024 02:20:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.net; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1727850054; x=1727936454; bh=tIUgxYt3Jg1qTzoRsdLL+2hnHLXGOeTOVd/VdRDk/Oc=; b= jhxd6DuMTNQhHj5/zh8IB/CoQXt50jcHEpEgtWEeoh5rnVT9NbuumgGu8VAeTgJa psxjwQ5VxlglEAyEjNS63qPABnOwQhUGiCFDCoWFsurqPDXkVVZCj9oBPw37JlGb gvAii02JeB+UwZcSUXYnwDm4/4+Me1Qy8W41Kup2bO3Y7kBHCN63OIssh3+j82tm 171jF79e24hCgrkeHXrPlXv87lsphTjiPhG/vQ03Z7BduJ4dsFA2yw2fWc0y+ZaG GqSt9FchYO5s0k2GRMXKDZjA7NvpvvNIcGZauc6j7zQbKdi4nsdBfrFixMcgOff8 nYPQNApCI17oIhdJ/bM7vA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1727850054; x= 1727936454; bh=tIUgxYt3Jg1qTzoRsdLL+2hnHLXGOeTOVd/VdRDk/Oc=; b=M h8suPxBvNnPsjirTeb5QQiLHT/9Qw7hj5nYjiuqUrNvi28KpOnG06xnoV0ddGCBk Vd7GsDwzJ1RkvFcNZaojg7PJMHxYJCByxbU4VBhtIv+ws7VzEpkDLYhb9+SmMGhv BRCdhptqL17T5vwX8k4S73gGmmhuIdZsGoZDm+ZUsfHchQuHxNOegTspglp9lnVD OfWl6QQi+anF26ph9JErvoy+yYe8dFOygfRKtbcw8C+iDsRJnTiLMlCz5QzJGvVf KyDhFCFW0Fn7v2ROLnVKtUc/VnK+45k9u1ECfMBKQrPNP9aN95rdaAqMXASo8Rmp JfOyaCOUXPMbdjIn8R38g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddukedguddtjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufgjfhffkfggtgfgsehtqhertddttdej necuhfhrohhmpefmohhnrhgrugcujfhinhhsvghnuceokhhonhhrrggurdhhihhnshgvnh esfhgrshhtmhgrihhlrdhnvghtqeenucggtffrrghtthgvrhhnpeekudfgjedugfffvedu leevudeugeeggfejiefhleeuffdtffehffetteejfeffieenucffohhmrghinhepghhnuh drohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehkohhnrhgrugdrhhhinhhsvghnsehfrghsthhmrghilhdrnhgvthdpnhgspghrtghpth htohepiedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepsggttgeskhhhihhnshgv nhdrfhgrshhtmhgrihhlrdhnvghtpdhrtghpthhtohepuggvvhesjhhpohhirhgvthdrgi ihiidprhgtphhtthhopehmrgigihhmrdgtohhurhhnohihvghrsehgmhgrihhlrdgtohhm pdhrtghpthhtohepjeeffedtgeesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtth hopehruhhthhgvrhhthhgvrhesphhrohhtohhnmhgrihhlrdgtohhmpdhrtghpthhtohep lhhuughosehgnhhurdhorhhg X-ME-Proxy: Feedback-ID: i184641e2:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 2 Oct 2024 02:20:53 -0400 (EDT) From: Konrad Hinsen In-Reply-To: <87zfno3l4i.fsf@gnu.org> References: <87ed5j1jzd.fsf@protonmail.com> <87zfno3l4i.fsf@gnu.org> Date: Wed, 02 Oct 2024 08:20:51 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: 4.41 X-Spam-Score: 4.41 X-Migadu-Queue-Id: 802568E156 X-TUID: g1uzbgvTFV1w Ludovic Court=C3=A8s writes: > Rutherther skribis: > >> When I add both python and a python package (seems like any) to a >> relocatable guix pack, the resulting python in the merged profile seems >> to be broken. Specifically its `sys.path` contains missing paths. > Commit d5e0180805f52ef38a03ff9d6c11dd6174e3526b fixed a similar issue I > think, discussed at . > > Not sure whether it=E2=80=99s a new problem here. Konrad, Maxim, Josseli= n, > WDYT? :-) This problem clearly looks like it's caused by our sitecustomize.py. One indicator is "When I add both python and a python package": if there is no additional package, only python by itself, our sitecustomize doesn't do anything. However, I don't see how the recent patch (see https://issues.guix.gnu.org/68241) could be responsible for this new problem. It should have happened before as well. Here is what sitecustomize.py does: 1. Collect the "site-packages" subdirectories of everything on $GUIX_PYTHONPATH. 2. Normalize them via sys.normpath() 3. Add them to sys.path 4. Re-arrange the elements in sys.path such that the add-on packages come before Python's standard library. The recent patch fixes a bug in the last step, which wasn't executed at all (and generated an error message). So the difference between the current and the previous behavior is only the order of entries in sys.path. The current problem is that even the standard library's paths are wrong. I suspect that this is due to sys.normpath not implementing the correct POSIX semantics for dot-dot. Cheers, Konrad.