From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 5DKtEtLS2GKJ6AAAbAwnHQ (envelope-from ) for ; Thu, 21 Jul 2022 06:15:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id uMOlENLS2GLuGwAAG6o9tA (envelope-from ) for ; Thu, 21 Jul 2022 06:15:14 +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 0191731BC1 for ; Thu, 21 Jul 2022 06:15:14 +0200 (CEST) Received: from localhost ([::1]:37296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oENaj-0006FE-6a for larch@yhetil.org; Thu, 21 Jul 2022 00:15:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oENaY-0006F5-F0 for guix-patches@gnu.org; Thu, 21 Jul 2022 00:15:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46655) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oENaY-0001Wn-6S for guix-patches@gnu.org; Thu, 21 Jul 2022 00:15:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oENaY-00012Q-1g for guix-patches@gnu.org; Thu, 21 Jul 2022 00:15:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56677] [PATCH 0/2] environment: Add --emulate-fhs option. Resent-From: John Kehayias Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 21 Jul 2022 04:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56677 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56677@debbugs.gnu.org X-Debbugs-Original-To: Guix-patches Received: via spool by submit@debbugs.gnu.org id=B.16583768763932 (code B ref -1); Thu, 21 Jul 2022 04:15:01 +0000 Received: (at submit) by debbugs.gnu.org; 21 Jul 2022 04:14:36 +0000 Received: from localhost ([127.0.0.1]:36404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oENa8-00011L-Dk for submit@debbugs.gnu.org; Thu, 21 Jul 2022 00:14:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:52832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oENa6-00011D-Er for submit@debbugs.gnu.org; Thu, 21 Jul 2022 00:14:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oENa6-0006D0-AD for guix-patches@gnu.org; Thu, 21 Jul 2022 00:14:34 -0400 Received: from mail-40134.protonmail.ch ([185.70.40.134]:13388) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oENa3-0001S4-LW for guix-patches@gnu.org; Thu, 21 Jul 2022 00:14:33 -0400 Date: Thu, 21 Jul 2022 04:14:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1658376868; x=1658636068; bh=Xs4uyOutqrJ8ToLIt26kAmXDdRKT8SHnp0Ii2hnlks4=; h=Date:To:From:Reply-To:Subject:Message-ID:Feedback-ID:From:To:Cc: Date:Subject:Reply-To:Feedback-ID:Message-ID; b=bAbYX2ZW6+vQpjQswgRlmSR/Wf/qWnVxraUJFwO8pNLunJyo6UE6L51zHSJBtfVrX d3l8o72IkAw6Zx/Hf97UVykKunXpWSRfhhPrJQ0hRgZybWXO6k1H4j8XT4cj8adHg4 NctNfpsHnz55sVPsXMbl7RfHlkV4E/ee1YMVzdcxGGVweYil5wZnbC4z58TITkEOe3 QRiTPIF6ywwpw/eKcUM/Rtfkx0aSj3abt+66ofJb9149fKqUJZwkO4nOluPgPwyQot gQIaTeH0WRWbsSc3YlGX3e59FyywI8mkNxRFqufWeYzdItHiOEIuM84VmIdny3YxNz zEy2uiDeH7IeA== Message-ID: <1LCXD7_zuGflSFovh_mKvhdayNcoWp8ALeguq3i2-XWwWHgzZuPak2gSBN91VLNJ84lubuFAt1dPB282Zy0pBmh_zbiI2qI-7n0LP9F03u4=@protonmail.com> Feedback-ID: 7805494:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.134; envelope-from=john.kehayias@protonmail.com; helo=mail-40134.protonmail.ch 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: John Kehayias X-ACL-Warn: , John Kehayias via Guix-patches From: John Kehayias via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1658376914; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Xs4uyOutqrJ8ToLIt26kAmXDdRKT8SHnp0Ii2hnlks4=; b=GVl9p8XDuQgEVaxU8UZtwzcU8YUiRqrcXb/ntiGR6BJxNJmwF8SHWFCcyUIcV1m14nQL9q nbayyZ99KzJdaKKJmiOvbHeesnjKIUyxbZAnP3jdRB6BhwiMeE5lhqoo1f/jWgKVQ/GfM4 xa+FKTowrRa8B1F6OT8HA+mKTBNuqhCTgpr61hD/k4uMvI2otK+CpjixcwvPw3MVPt5ZIw XyqzCNgHFeUmRADCjthiMUtKpMU7mwwq6cyUQFRG4CeYbYeZ5uTHZXFNbLZ8PWwfl+ht8H PEWIZ8BH3IaOTt9RnulNy0W0IUdSRb5xSSXckHUwN6umP03aoQGXAT50BpgbkA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658376914; a=rsa-sha256; cv=none; b=th8sUHVKWGPixN88x6RjJemUC+YceCvnvmcWiaQpWRHz1faF5kCXmyoObPj3pCmBNeyRTo J5Azgl+Usx6JhWm7eLrDA9BGKQ/y3JXaxgROpGhsHQhpZQhwhghIifXawpqgpVNW76S6ir Lnhll51GT3PDBoFi1ik1JE7WdeZfblR6QOKKzoT59MxUoj/5UUAU6EPWQEmu8Co4sPxa2k JeIqYY4vTKsaBRdkDUs1KWPcuIpEymzoIet2Ih04NhFX/MZxJuyhs529PiP19meW9sik2t nwtKAoUszI18pS3NMzlxPQfF30AFBIxev8npHBH1wM+9r8bTdPc79HViUvcauQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=protonmail.com header.s=protonmail3 header.b=bAbYX2ZW; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.63 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=protonmail.com header.s=protonmail3 header.b=bAbYX2ZW; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 0191731BC1 X-Spam-Score: -3.63 X-Migadu-Scanner: scn1.migadu.com X-TUID: YjiUB03OXyId Hello Guix, As discussed on guix-devel here (please see for more detailed discussion an= d design aims): https://lists.gnu.org/r/guix-devel/2022-07/msg00161.html th= is is a patch to add an FHS (Filesystem Hierarchy Standard) emulation optio= n for environments. The overall goal is to mimic typical GNU/Linux distributions in following F= HS (/bin, /etc, and /usr in particular) as well as a glibc that reads a glo= bal /etc/ld.so.cache and PATH with /bin, and so on. The idea is that follow= ing instructions for setting up a development environment, building softwar= e, running something, and so on in "typical" Linux environments, should "ju= st work" with 'guix shell --container --emulate-fhs ...', provided the righ= t inputs and other options are set. For testers, this can be used by using pre-inst-env (outside of the pure sh= ell used to build a local guix) to run guix shell with this patch. Please s= ee the mailing list discussion for particular examples as well. For review, in particular: 1. On the mailing list there was discussion about the necessity or not of g= libc-for-fhs (added in the first patch). I find this useful and a big piece= of making this FHS option work, but open to discussion or if it should be = a further option. 2. Right now I used a script written to the containers /tmp/fhs.sh to gener= ate the ld cache, supplement $PATH (somewhat optional, but I found useful f= or less tinkering), and finally launch the given command or shell. I found = that when not providing a command the prompt for /bin/sh is not the same as= when not using --emulate-fhs. So I'm not sure if this is the correct way t= o launch the default /bin/sh if no command is given. Open to ideas of a bet= ter way to implement these actions for a container start up as well. 3. This is my first time touching a guix script and the documentation, so p= lease do check the commit message and guix.texi. 4. I decided to link the second level FHS directories, like /usr/bin, as we= ll as optional ones like /lib64 (or /lib32), to the top level /bin, /lib, a= nd so on. These could just be bind mounted to profile/bin and so on as well= , but again tried to mimic an FHS distribution like Arch where the files on= ly live in one place. While perhaps making the code a little more involved,= I hope this makes the container look tidier. I may be forgetting other elements in the implementation decisions I made, = but I have been testing these patches along the way and have gotten good us= age of them. Please test further too! Thanks, John