Subject: Unexpected requirement of --writable-root when using --share with guix shell

From: Ricardo Wurmus <[email-masked]>
Date: Thu, 15 May 2025 10:26:07 +0200

This is due to a change introduced with commit 
ce363c1dc7bd63a74dcf7788d340819f6d5db89f:

--8<---------------cut here---------------start------------->8---
commit ce363c1dc7bd63a74dcf7788d340819f6d5db89f
Author: Ludovic Courtès <[email-masked]>

    environment: Add ‘--writable-root’ and default to read-only 
    root.
    
    This is an incompatible change where the root file system in
    ‘guix shell -C’ is now read-only by default.
--8<---------------cut here---------------end--------------->8---

There have been follow-up commits, such as 
edc799dabfb059735f1a3084384925fe573d9de1 to make /tmp writable 
again:

--8<---------------cut here---------------start------------->8---
commit edc799dabfb059735f1a3084384925fe573d9de1
Author: Ludovic Courtès <[email-masked]>

    environment, home: Make /tmp writable.
    
    Fixes <https://issues.guix.gnu.org/78272>.
    
    Fixes a bug caused by commit 
    ce363c1dc7bd63a74dcf7788d340819f6d5db89f,
    which inadvertently made /tmp read-only as well.
--8<---------------cut here---------------end--------------->8---

The problem here is that the user's temporary home directory 
inside the container is now read-only by default, because it is a 
decendent of the read-only root directory:

--8<---------------cut here---------------start------------->8---
guix shell --container coreutils -- /bin/sh -c 'env > ~/.test'
/bin/sh: line 1: /home/rekado/.test: Read-only file system
--8<---------------cut here---------------end--------------->8---

Is this intentional or should we add an exception to make the 
in-container home directory created for the user invoking "guix 
shell" writable for that same user?

-- 
Ricardo