From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uNW0DbX3W2PwVAAAbAwnHQ (envelope-from ) for ; Fri, 28 Oct 2022 17:39:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 2AalDbX3W2PnIgEA9RJhRA (envelope-from ) for ; Fri, 28 Oct 2022 17:39:33 +0200 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 C8B9026119 for ; Fri, 28 Oct 2022 17:39:32 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooRRm-0000l7-Aw; Fri, 28 Oct 2022 11:39:02 -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 1ooRRf-0000kn-11 for help-guix@gnu.org; Fri, 28 Oct 2022 11:38:55 -0400 Received: from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ooRRb-00028Q-4y for help-guix@gnu.org; Fri, 28 Oct 2022 11:38:54 -0400 Received: by mail-qt1-x832.google.com with SMTP id g16so3681289qtu.2 for ; Fri, 28 Oct 2022 08:38:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=V/LAUQVyI0qRZoWHo8u6iVRksvovFfysYMUxR+GSVEc=; b=mj3Ai1GSgtP+YbGi/vnWoiGXxQs84vFFlOculhSxEBkl4VuOPubQWcQq82it02X/5k JZNKDDcoru4/LsfuqOi5J6jMYXM/v1v6w3NhdV4oJ3wSBgcV0tenqU7RAJju/8kkmgJ0 IPTGtKB2ZQj0vNP9f5FtkJlE/G0zaAYjFbBch0OrfVHb86ObDx7F9jU8IvkE1uMzRwIB ZlvzKJornrnzhYqI07MU5XKXF8T1LMM4HBqko96kbXd0e7OPteHNIJoKrH9jCzvuhjEn xDSp/eWAOS4OIybZ/0Zx2YLx/T0aPA1CgO4a0gudylOP+Acp79Dm0LLN9VEOIETQnlIx 5jMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=V/LAUQVyI0qRZoWHo8u6iVRksvovFfysYMUxR+GSVEc=; b=1B3Igf58r0wybNTPNsWBjOh7Y4RvPJHKqNemrLDBWZ2wnE21s5/d71Kk7swjzLrXWD LSGSjx2eSUYtqGfsHo2GRvfoW/1+5Rpbovr6Wq+75QjJWYcFvr5+dy4UnjB8GoS9HxoD IOd3qdJNZ92VdAeX4EaJ+oBtR7s53kZk05Dui3oygg8bDMDrVrTvTbNs3n3D9t441fcx GjKq/DqZgjimS6dlhvycFyZH4OuH/nUHoQvOsSBP+IhNG+tcOEXWyW0fqtkeCjnDcK8C vVIhsdFvbE3D5BS7rHrMrPDVtUQ8bHSenmv4A51dcedREkAS/1WaETvOfT8lPqMHqDb5 pD2A== X-Gm-Message-State: ACrzQf20kHAEsA4PqeazZwkXrIo4TGT2vQ6LQihy3mryXiuT2PKj3SVo BlrBVu0QGzfR1Yu5+R3YOPlCZmUz65k= X-Google-Smtp-Source: AMsMyM47xZfHc8H586VXu+P+2LE8p7vFJcHNjTsOFxKeUm4Fwug5LW4UWq+Q9SENuxexamVWsKhIOw== X-Received: by 2002:ac8:59cb:0:b0:39a:dbc7:2424 with SMTP id f11-20020ac859cb000000b0039adbc72424mr61643qtf.304.1666971528691; Fri, 28 Oct 2022 08:38:48 -0700 (PDT) Received: from hurd (dsl-152-179.b2b2c.ca. [66.158.152.179]) by smtp.gmail.com with ESMTPSA id g21-20020ac85815000000b0039cc47752casm2522113qtg.77.2022.10.28.08.38.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 08:38:48 -0700 (PDT) From: Maxim Cournoyer To: Wojtek Kosior Cc: Csepp , help-guix@gnu.org Subject: Re: program prepared with `guix pack` unusable by end users References: <20221013182027.2044d8ff@koszkonutek-tmp.pl.eu.org> <87czaurh9e.fsf@gmail.com> <20221014110911.66168330@koszkonutek-tmp.pl.eu.org> <87mt9ypt4t.fsf@gmail.com> <20221017153648.7185c235@koszkonutek-tmp.pl.eu.org> <20221026092330.6df3870c@koszkonutek-tmp.pl.eu.org> <87ilk61hpu.fsf@riseup.net> <877d0ljj84.fsf@gmail.com> <20221027192825.08f0af15@koszkonutek-tmp.pl.eu.org> Date: Fri, 28 Oct 2022 11:38:46 -0400 In-Reply-To: <20221027192825.08f0af15@koszkonutek-tmp.pl.eu.org> (Wojtek Kosior's message of "Thu, 27 Oct 2022 19:28:25 +0200") Message-ID: <87o7twez5l.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::832; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x832.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Help-Guix" Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1666971573; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=V/LAUQVyI0qRZoWHo8u6iVRksvovFfysYMUxR+GSVEc=; b=AIWr3JGGR8u2TO2wx2c9ytKD7v5zn7CpYr+2Qj+3lIAn7s53C8QMefPPyxQIMjxip8q1vd oV187WrZ9lOFCnEOkZSFF063yRDFiByAiqz/YRJ+TSTCLFfJWSNR3wJTZYQNMMi/AH9Zyq CPXBjwQqcja/gbZppcxARl26J7Zwxa2l0B2pFXUCw0MwQcYvWq1lBbr9pUxBBSf5pAuczM 9BdnfLTeXYFiHpIdRvUOJgtRKqTjCtUIE7ogICjbyqJWU1uPUnF8P823cso2rwK61lMy6d IBgWiZ9Laqp+KbgpWBza0zLk66WpaHCjltjypBaRnpuMfERDS6Y8JtpMTr97pA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666971573; a=rsa-sha256; cv=none; b=mhvXw5AOarAH6R5L03UMfg59cfcK5kQ7mlWfdXL9NC1t4SV1vDkgrD/aunF19Lc25cQ5DA B7hDDyx5WKi9XLrknfG98Xw9rr5lesmb50EM8x86jhCL4cJ8+TfCbnsI2YJNuUDi6Y8t9B um6HIEEQWZ4BrcQou3agzLZ4EdIYODm++u3Fo6c33B+ge1UbBvrq4B0TfwRwNPqoRj1KJC F1hfdXn2DAdkBta/Ns0zJv1nhsFJ4tfEVi7gjdhVTkLiagVAYfFL5cZF/MLqDxz3Ojg5Dl Y6wBC/ZWAladCnr+XPi64IBIxXxV4jT3loEXbT80IQw03KtGz32j1RjsExxXuw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=mj3Ai1GS; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.92 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=mj3Ai1GS; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: C8B9026119 X-Spam-Score: -3.92 X-Migadu-Scanner: scn1.migadu.com X-TUID: YdTgYYDeVg02 Hello, Wojtek Kosior writes: >> > IMHO yes, the pack output does not work as expected. That's the >> > definition of a bug. >> >> I disagree. That Python gives precedence to USERSITE compared to >> site-packages and GUIX_PYTHONPATH is by design, so that users can >> override system provided libraries such as those by Guix. It used to be >> the other way around, and it caused all sort of problems such as >> virtualenv not working as expected on Guix. My memory failed me here; the past problems with Guix and virtualenv had to do with us (ab)using PYTHONPATH, which would take precedence above everything and not get reset by virtualenv, if I remember. --8<---------------cut here---------------start------------->8--- $ . bin/activate (venv) maxim@hurd /tmp/venv [env]$ python -m site sys.path = [ '/tmp/venv', '/gnu/store/bbakd2h7s4g62fymjmqpxgvlanp1ydny-python-3.9.9/lib/python39.zip', '/gnu/store/bbakd2h7s4g62fymjmqpxgvlanp1ydny-python-3.9.9/lib/python3.9', '/gnu/store/bbakd2h7s4g62fymjmqpxgvlanp1ydny-python-3.9.9/lib/python3.9/lib-dynload', '/tmp/venv/lib/python3.9/site-packages', ] USER_BASE: '/home/maxim/.local' (exists) USER_SITE: '/home/maxim/.local/lib/python3.9/site-packages' (doesn't exist) ENABLE_USER_SITE: False --8<---------------cut here---------------end--------------->8--- We can see that virtualenv disables loading libraries from USER_SITE (ENABLE_USER_SITE: False). We can also see that it puts its site-packages directly on sys.path. > Perhaps the best solution would be to > * have Python interpreter itself give precedence to user site packages but > * have user site disabled (or enabled with lower precedence) by default > for Python applications. > > Consider the creation of wrapper script for python programs as it is > done now[1]. Is there currently any application that would behave > incorrectly with PYTHONNOUSERSITE exported as 1 and > `~/.local/lib/python/site-packages/` included in > GUIX-PYTHONPATH after the other paths? If there is, perhaps it would be > at least easier to make a workaround for this single application? I agree that setting PYTHONNOUSERSITE to 1 in the wrapper of Python commands to ensure no stray user-installed librairies from under "~/.local/lib/python/site-packages/" clash with their operation would make sense. Note that this is an interoperability problem between 'guix' and 'pip', for 'pip install x' users that end up filling their "~/.local/lib/python/site-packages/" directory. If you 'rm -rf ~/.local/lib/python*' and stick to use only Guix-provided packages, they won't experience any issue. -- Thanks, Maxim