From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id ONRMLusFxF8uagAA0tVLHw (envelope-from ) for ; Sun, 29 Nov 2020 20:34:51 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id kKYIKusFxF8mWAAAbx9fmQ (envelope-from ) for ; Sun, 29 Nov 2020 20:34:51 +0000 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 DC69794011A for ; Sun, 29 Nov 2020 20:34:50 +0000 (UTC) Received: from localhost ([::1]:35372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjTPE-0004ny-NI for larch@yhetil.org; Sun, 29 Nov 2020 15:34:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjTP5-0004nn-UM for help-guix@gnu.org; Sun, 29 Nov 2020 15:34:39 -0500 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]:38328) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kjTP4-00089w-2w for help-guix@gnu.org; Sun, 29 Nov 2020 15:34:39 -0500 Received: by mail-qt1-x835.google.com with SMTP id g17so6843601qts.5 for ; Sun, 29 Nov 2020 12:34:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=vHGs0tUauUQSzcLgA4GTmgUvofF0t+5emb8kQPW+bug=; b=brKgaTAvvpn4UJjxXzCTm3b8rk0RqTDscQrE0grdhRjnZTsNYYO0MnZVZ1GvF4dAQ/ /PAV8jTo/akewJfMaKMSUm4Cd8IqaZzPRfmPwVFN8DPyXUUJcVlvh4kUiHg5raR5tUXq AiMWqj1cUseyC3crQS20SlyzauIv38DHh69OhYjrsSS8xBuaK+rTQggXQlEEeaVXHoch 95svZCzqUdEcUKw56AOxZXJ9j/BHwPxEE3qCvAexqWBH9xq1gBsrkYgZ49Q+y33i0ZeU PXK8WIjOUcNCV/7xvBxn3PpyQSt4s/MVuGH0qTQnswsL7wB2BSrGDcxXTGgGatqu2t+R jhpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=vHGs0tUauUQSzcLgA4GTmgUvofF0t+5emb8kQPW+bug=; b=q6grKkvoPYJDS3QsWQU5clDpykPxtgbm2P7xwd1yKIj1vdxytPQ3NmeBhVVxZfV7w2 2veOQ26zSKh5BFACP5JvZhZVpaRnB4Hp0wtbZlwLoasB5JhdX49Av4EbMbMRTYPxiUlB +N0bNgGLQtrqRacZ6SpObKScoWSqv2FUUSHIjiPgo6WbZOCvFmDuA1ehCtA7207eAYU0 UwOv4DJxcuVgTr5xuwLtS362x9n9j6ixO9h92v9Yf0o1rKx/OtO8lsQf4aVMgHGbXKAq V7ZavDzP5zKsg8LJeL8l+m6HCwKp2AqtBVSa35oojryRIBrZPGiSLuOq7rfzjX26PtPu lSXQ== X-Gm-Message-State: AOAM531ZmtLbwbRtvWjAyVK+T1DIjufC4CY9hcIHeVxzFH9AyNJk0rgB Rs4HsFJrbnkn61PAkRDvsrKsOEiGwRIc1g== X-Google-Smtp-Source: ABdhPJxn58zcDtNrfoRzMio7ZwPviIyVNz1K9mHdMbSs0eHpt9fp2lM56nqeg0SGp3oSzReELhZpSw== X-Received: by 2002:aed:32c7:: with SMTP id z65mr18302194qtd.266.1606682076841; Sun, 29 Nov 2020 12:34:36 -0800 (PST) Received: from hurd (dsl-150-82.b2b2c.ca. [66.158.150.82]) by smtp.gmail.com with ESMTPSA id h16sm1955563qko.135.2020.11.29.12.34.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2020 12:34:36 -0800 (PST) From: Maxim Cournoyer To: Phil Subject: Re: Replacing python venv - environment or profile? References: <85r1oifz56.fsf@beadling.co.uk> Date: Sun, 29 Nov 2020 15:34:34 -0500 In-Reply-To: <85r1oifz56.fsf@beadling.co.uk> (phil@beadling.co.uk's message of "Tue, 24 Nov 2020 17:22:29 +0000") Message-ID: <871rgboqat.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::835; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x835.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: help-guix@gnu.org Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.98 X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=brKgaTAv; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-TUID: 4Yw1vnqGiEVP Hi Phil, Phil writes: > Hi all, > > Apologies this is a bit longer than I anticipated, but I wanted to record > all the steps I'd taken to explain my reasoning - in case it's wrong! > > I'm new the Guix and considering adopting it as an expansion to my > current use of Python virtual environments in development and > production, to include other non-Python packages too. > > The potential of the software is very exciting! > > I've read the manual/cookbook and I get the gist of the tool. One thing > I'm getting a bit stuck on is the appropriate use of environment vs > profile; different sources give slightly different takes on the theme, and I > want to make sure my use is correct from the get-go. It seems you've done your homework :-). > I'll be using Guix on a foreign OS, I suspect the answers might be > slightly different if I was able to adopt the Guix System OS, but for > now I can't. > [...] > I'm keen to avoid accidentally calling anything in the foreign OS, > something the 'guix environment' command gives me, but obviously the foreign > OS will serve as a fallback given the above PATH construction under a sourced > profile. So if my profile doesn't have python installed, but it is part > of the foreign OS, I would silently pick that up, which would be bad. > > > As per 4.1.1 in the cookbook I can avoid setting other profiles using: > > $ env -i $(which bash) --login --noprofile --norc > $ export GUIX_PROFILE=/home/ubuntu/dev/test-profile > $ . $GUIX_PROFILE/etc/profile > > But the foreign OS variables remain: > > $ echo $PATH > /home/ubuntu/dev/test-profile/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin > $ I could reproduce on a foreign distro but not on Guix System: --8<---------------cut here---------------start------------->8--- $ env -i $(which bash) -c 'echo $PATH' /no-such-path --8<---------------cut here---------------end--------------->8--- It appears this is caused by the foreign Bash, which hard-codes a default value for PATH (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin in your case). The Bash package on Guix (you can go to its definition using 'guix edit bash') has the following compilation flags: (let* ((cppflags (string-join '("-DDEFAULT_PATH_VALUE='\"/no-such-path\"'" "-DSTANDARD_UTILS_PATH='\"/no-such-path\"'" "-DNON_INTERACTIVE_LOGIN_SHELLS" "-DSSH_SOURCE_BASHRC") " ")) This is where that non-existing (/no-such-path) value comes from. As a workaround, you could use Bash from Guix after installing it with 'guix install bash'. HTH! Thanks, Maxim