GNU bug report logs - #78497
[PATCH] environment: Provide a writable /run/user/$UID.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Ludovic Courtès <ludo@HIDDEN>; Keywords: patch; dated Mon, 19 May 2025 19:32:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 19 May 2025 19:31:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 19 15:31:20 2025
Received: from localhost ([127.0.0.1]:45197 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uH6Cl-0000QY-O0
	for submit <at> 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 <ludo@HIDDEN>) id 1uH6Ci-0000PA-Qy
 for submit <at> 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 <ludo@HIDDEN>) id 1uH6Ca-0002J0-VN
 for guix-patches@HIDDEN; 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 <ludo@HIDDEN>)
 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: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] environment: Provide a writable /run/user/$UID.
Date: Mon, 19 May 2025 21:30:53 +0200
Message-ID: <fda82779cee9cc1b1a73a18624c1aa508b573243.1747682960.git.ludo@HIDDEN>
X-Mailer: git-send-email 2.49.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: submit
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>,
 Tomas Volf <~@wolfsden.cz>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* guix/scripts/environment.scm (launch-environment/container): Add
/run/user/UID to ‘file-systems’.
* tests/guix-environment-container.sh: Test it.

Change-Id: I44c70a7554a06f40d073c25929ea7c6ded356d08
---
 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’.

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.
 

base-commit: 11e88de06043d367d02ceceade84733a65f84e27
-- 
2.49.0





Acknowledgement sent to Ludovic Courtès <ludo@HIDDEN>:
New bug report received and forwarded. Copy sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN. Full text available.
Report forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#78497; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 19 May 2025 19:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.