From patchwork Mon May 19 19:30:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 42754 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C755B27BC4B; Mon, 19 May 2025 20:32:26 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7DDB627BC49 for ; Mon, 19 May 2025 20:32:26 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uH6DY-0002SY-1U; Mon, 19 May 2025 15:32:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uH6DW-0002SB-0g for guix-patches@gnu.org; Mon, 19 May 2025 15:32:06 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uH6DV-0000Wl-M4; Mon, 19 May 2025 15:32:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=AmerM3DLS+9wfjtThK9XKUAtPmuKJ8kbQWKAXndjlAU=; b=QOPM2svBf/v4BzUEDFidDvHVyQAPVvoqv/Vvx+bUYriKFDuYMyZXXQx6uSaRRZW6JGjbquMKYsU3S1q17toEIow8yE8Hw96E0f2IVDF2YOC9xMoL4eLNlW4vCrtYTowoSf2PeKFA7mdAnbOAobJ7A4RCpwZsm3U8W1KdAe9Zg3l0yMOiZBbLY20cuE2ys0eSPAnKiY/U09RrRu5G/mr3hIsh4FCEciPRo6tqWovVgyxpEk6XpYwzz0PsrXuCuRO265BLMq+N9c+uJGlmKAmKZgUDSo2Bcl3j59R5scZ9O2UUO2M24s+l/okeg7wZ5C5/zKQQwL16QnpbJX7LLOaqcg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uH6DS-0000U2-6U; Mon, 19 May 2025 15:32:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78497] [PATCH] environment: Provide a writable /run/user/$UID. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Mon, 19 May 2025 19:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 78497 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78497@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Tomas Volf <~@wolfsden.cz>, Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by submit@debbugs.gnu.org id=B.17476830801651 (code B ref -1); Mon, 19 May 2025 19:32:01 +0000 Received: (at submit) by debbugs.gnu.org; 19 May 2025 19:31:20 +0000 Received: from localhost ([127.0.0.1]:45197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uH6Cl-0000QY-O0 for submit@debbugs.gnu.org; Mon, 19 May 2025 15:31:20 -0400 Received: from lists.gnu.org ([2001:470:142::17]:58182) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uH6Ci-0000PA-Qy for submit@debbugs.gnu.org; Mon, 19 May 2025 15:31:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uH6Ca-0002J0-VN for guix-patches@gnu.org; Mon, 19 May 2025 15:31:09 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uH6CZ-0000TO-OB; Mon, 19 May 2025 15:31:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=AmerM3DLS+9wfjtThK9XKUAtPmuKJ8kbQWKAXndjlAU=; b=ad9zqvsNG/i3fs /bP8K6GOjlz97F/+6OYnv84+fHguAs2Kxjt80OmhfcmUucU8+ldzwvrS3xYjBsXRT21EaNwK4bc82 0fxl1VzHCpO2IW17zbm/9szjt5CVQ6FkTYMROwVQxPHHZcxuVGdw+T8P5Lh2nNFEhEeq4dCafmHg2 CUQDXskfxuflDqAamvKu+K+7lHG7mAiBKvtg8lwM7SgIRAoGdb2irx6JLKvPZAMsOIVxpruGO9j32 9EmzSmW7iHpmB1ESDGLIufpKadyH7N4/9BFWXvhretyGvi0OosD+HxiRx6W2NrScgJRB9Xq7AuwJj 02/CPnG0S2YMPYnfen3w==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 19 May 2025 21:30:53 +0200 Message-ID: X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/scripts/environment.scm (launch-environment/container): Add /run/user/UID to ‘file-systems’. * tests/guix-environment-container.sh: Test it. Change-Id: I44c70a7554a06f40d073c25929ea7c6ded356d08 Reviewed-by: Tomas Volf <~@wolfsden.cz> --- guix/scripts/environment.scm | 5 +++++ tests/guix-environment-container.sh | 3 +++ 2 files changed, 8 insertions(+) Hello Guix! This may sound like a recurring joke but hey! when running shepherd in ‘guix shell -C’, I figured that a writable /run/user/$UID would be welcome too. Thoughts? Ludo’. base-commit: 11e88de06043d367d02ceceade84733a65f84e27 diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 96bbc6c9fa..1c2d222c74 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -875,6 +875,11 @@ (define* (launch-environment/container #:key command bash user user-mappings reqs))) (file-systems (append %container-file-systems (list tmpfs ; RW /tmp + (file-system ; RW /run + (inherit tmpfs) + (mount-point + (string-append "/run/user/" + (number->string uid)))) (file-system ; RW ~ (device "none") (mount-point diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh index e1c3655846..220e6b8ec8 100644 --- a/tests/guix-environment-container.sh +++ b/tests/guix-environment-container.sh @@ -203,6 +203,9 @@ guix environment --bootstrap --container --ad-hoc guile-bootstrap \ guix environment --bootstrap --container --ad-hoc guile-bootstrap \ -- guile -c '(mkdir (string-append (getenv "HOME") "/foo"))' +# And /run too! +guix environment --bootstrap --container --ad-hoc guile-bootstrap \ + -- guile -c '(mkdir "/run/user/1000/shepherd")' # Check the exit code.