From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:49347) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIASV-0007zV-2Q for guix-patches@gnu.org; Sat, 28 Mar 2020 08:21:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIASU-0008Ge-15 for guix-patches@gnu.org; Sat, 28 Mar 2020 08:21:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55975) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jIAST-0008GI-To for guix-patches@gnu.org; Sat, 28 Mar 2020 08:21:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jIAST-000380-Po for guix-patches@gnu.org; Sat, 28 Mar 2020 08:21:01 -0400 Subject: [bug#34638] [PATCH v2 2/4] linux-container: Add 'start-child-in-container'. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20190419140427.15183-1-mail@cbaines.net> <20190419140427.15183-2-mail@cbaines.net> <87ftdvea8d.fsf@gnu.org> <87mu80sosv.fsf@cbaines.net> Date: Sat, 28 Mar 2020 13:20:08 +0100 In-Reply-To: <87mu80sosv.fsf@cbaines.net> (Christopher Baines's message of "Sat, 28 Mar 2020 11:26:40 +0000") Message-ID: <877dz44qo7.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Christopher Baines Cc: 34638@debbugs.gnu.org Hi! Christopher Baines skribis: > Ludovic Court=C3=A8s writes: > >> Christopher Baines skribis: >> >>> This new procedure is similar to open-pipe* in (ice-9 popen), but using >>> run-container from (gnu build linux-container). >>> >>> * gnu/build/linux-container.scm (start-child-in-container): New procedu= re. >> >> [...] >> >>> +(define* (start-child-in-container command >>> + #:key read? write? >>> + (root 'temporary) >>> + (mounts '()) >>> + (namespaces %namespaces) >>> + (host-uids 1) >>> + (extra-environment-variables '())) >> >> Please add a docstring. :-) >> >> I=E2=80=99d change (extra-environment-variables '()) to: >> >> (environment-variables (environ)) >> >> I always find it too hard to reason about =E2=80=9Cextra=E2=80=9D thing;= it=E2=80=99s just more >> convenient as an interface to specify the whole thing rather than a list >> of =E2=80=9Cextras=E2=80=9D. > > I had a go at this, but I think trying to copy the environment variables > from the host Guix to the inferior one caused problems, at least this > backtrace appears when calling open-inferior/container and I'm guessing > it comes from the inferior guix. > > I think calling it environment-variables and having it be '() is OK, the > only change I can see being made elsewhere is that > open-inferior/container adds HOME=3D/tmp, and that's just to avoid issues > with (guix profiles). > > Does that make sense? Ah yes, defaulting to the empty list is even better. Thanks, Ludo=E2=80=99.