From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] scripts: Add 'environment' command. Date: Sat, 11 Oct 2014 23:52:38 +0200 Message-ID: <87d29y6zq1.fsf@gnu.org> References: <87oatmch5i.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87siix59cs.fsf@gnu.org> <87r3yg1wpp.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <871tqgdt3o.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87y4sn9900.fsf@gnu.org> <87fvevdcfu.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87siivabzg.fsf@gnu.org> <877g07d0zd.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <8761fq99mr.fsf@gnu.org> <87oati3i79.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xd4ac-0002k8-6v for guix-devel@gnu.org; Sat, 11 Oct 2014 17:52:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xd4aX-0005Zu-AC for guix-devel@gnu.org; Sat, 11 Oct 2014 17:52:38 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:54726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xd4aX-0005Zh-30 for guix-devel@gnu.org; Sat, 11 Oct 2014 17:52:33 -0400 In-Reply-To: <87oati3i79.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> (David Thompson's message of "Sat, 11 Oct 2014 08:27:06 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: David Thompson Cc: guix-devel@gnu.org David Thompson skribis: > I don't think it's something "wrong" with your files, really, but it is > incompatible with the way 'guix environment' currently operates. > > I took another look at nix-build to see how they do things. They create > a bashrc file in a temporary directory and run bash (or whatever > $NIX_BUILD_SHELL is) with the '--rcfile' flag so that the user's bashrc > isn't used. We could do something similar, but right now I don't have > any reason to believe that all shells accept an '--rcfile' option, so it > could easily break other setups. POSIX specifies the =E2=80=98ENV=E2=80=99 environment variable for that: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sh.html So that=E2=80=99s one thing that could be used. Apparently Bash checks =E2=80=98BASH_ENV=E2=80=99 instead, unless invoked as =E2=80=98sh=E2=80=99 = (info "(bash) Bash Startup Files"). In the longer run, another option would be to have a Bash built-in command, in the form of a plug-in loaded with =E2=80=98enable FOO.so=E2=80= =99, that would modify the environment variables of the running Bash process (recutils has an example of that.) My 2=C2=A2, Ludo=E2=80=99.