From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: thesis: guixsd should provide /usr/bin/env Date: Thu, 19 Nov 2015 17:07:16 +0100 Message-ID: <87h9ki9dmz.fsf@gnu.org> References: <874mgmti7b.fsf@igalia.com> 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]:46033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzRk3-0000yR-Uy for guix-devel@gnu.org; Thu, 19 Nov 2015 11:07:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzRk0-0005bs-KG for guix-devel@gnu.org; Thu, 19 Nov 2015 11:07:23 -0500 In-Reply-To: <874mgmti7b.fsf@igalia.com> (Andy Wingo's message of "Mon, 16 Nov 2015 09:19:20 +0000") 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: Andy Wingo Cc: guix-devel@gnu.org Andy Wingo skribis: > I think GuixSD should follow NixOS's lead and provide /usr/bin/env. The > reason is to support scripts that can run either on GuixSD or on some > other system. For example instead of: > > #!/bin/bash > > we can do > > #!/usr/bin/env bash > > So we just need /usr/bin/env in the root and nothing else. In ~8 years of NixOS and then GuixSD, I=E2=80=99ve lived without /usr/bin/e= nv. I use #!/bin/sh in scripts I write, which is known to be Bash on GuixSD. But I don=E2=80=99t write so many throwaway scripts, and when I do, it=E2= =80=99s either Guile or Bash. On IRC, Mark pointed out that, if /usr/bin/env were available by default, then scripts or generated scripts may more often end up relying on /usr/bin/env rather that precisely specify what interpreter they need, which would partly defeat the point of all this. My current inclination would be to not provide /usr/bin/env by default, and instead let users add it if they want to, either using the sledgehammer Ricardo suggests ;-), or simply with: ln -s /run/current-system/profile/bin/env /usr/bin/env We could document it, and/or even add a switch in =E2=80=98operating-system= =E2=80=99 to do that. How does that sound? > Alternately, I am not sure if this would work but we could make a form > of "guix environment" which populates a profile that is mounted at /usr > in a container. That would allow many more non-Guix tools to run. Technically =E2=80=98guix environment --container=E2=80=99 could create /us= r, just like it creates /bin/sh. Not sure if it=E2=80=99s a good idea, though. Thanks, Ludo=E2=80=99.