unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: bokr@bokr.com
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: 46782@debbugs.gnu.org, bbb ee <blasforr@gmail.com>,
	Simon Tournier <zimon.toutoune@gmail.com>
Subject: bug#46782: guix environment --expose options cannot be layered onto $PWD
Date: Tue, 7 Feb 2023 02:24:04 +0100	[thread overview]
Message-ID: <20230207012404.GA3706@LionPure> (raw)
In-Reply-To: <87r0v2lasz.fsf@gmail.com>

Hi,

On +2023-02-06 16:54:20 -0500, Maxim Cournoyer wrote:
> Hi,
> 
> Simon Tournier <zimon.toutoune@gmail.com> writes:
> 
> > Hi Maxim,
> >
> > A naive question since it works when using the --no-cwd option.
> >
> > On ven., 27 janv. 2023 at 11:19, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
> >
> >> --8<---------------cut here---------------start------------->8---
> >> guix environment -C --expose=/tmp=$PWD/tmp --ad-hoc bash coreutils \
> >>  -- bash -c 'stat $PWD/tmp'
> >> --8<---------------cut here---------------end--------------->8---
> >
> > Is $PWD referring to the same thing?  Because one is outside and the
> > other is inside.
> 
> Yes!  See:
> 
> --8<---------------cut here---------------start------------->8---
> maxim@hurd ~$ echo $PWD/tmp && guix environment \
>  -C --expose=/tmp=$PWD/tmp --ad-hoc bash coreutils -- bash -c 'echo $PWD/tmp'
> /home/maxim/tmp
> /home/maxim/tmp
> --8<---------------cut here---------------end--------------->8---
> 
> -- 
> Thanks,
> Maxim
>

I imagine the created environment is COW[1]
[1] <https://en.wikipedia.org/wiki/Copy-on-write>

Then your output above,
--8<---------------cut here---------------start------------->8---
> /home/maxim/tmp
> /home/maxim/tmp
--8<---------------cut here---------------end--------------->8---
looks the same, but IIUC they have different '/' root dirs, the one
in the container being like an initrd separate file system.

Or is --expose meant to be a shared rw reference to the caller's memory
(directory content or regular file etc) from the start?
That would seem hard to keep safe, so I doubt that's the design.

How do the two tmp's stat? (Before and after writing content
like $PWD/tmp/foo ?

And foo doesn't appear in the caller $PWD/tmp/* right?

What is your use case goal for --expose=/tmp=$PWD/tmp ?

SFTN if this is useless distraction.
--
Regards,
Bengt Richter




  reply	other threads:[~2023-02-07  1:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-25 21:12 bug#46782: guix environment --expose options cannot be layered onto $PWD Maxim Cournoyer
2022-11-23 14:24 ` bug#46782: bbb ee
2023-01-27 16:19   ` bug#46782: guix environment --expose options cannot be layered onto $PWD Maxim Cournoyer
2023-01-27 17:31     ` Simon Tournier
2023-02-06 21:54       ` Maxim Cournoyer
2023-02-07  1:24         ` bokr [this message]
2023-02-13 21:17           ` Josselin Poiret via Bug reports for GNU Guix
2023-02-13 21:31             ` bug#46782: [PATCH] scripts: environment: Mount cwd before user specified --expose Josselin Poiret via Bug reports for GNU Guix
2023-03-07  2:23             ` bug#46782: guix environment --expose options cannot be layered onto $PWD Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230207012404.GA3706@LionPure \
    --to=bokr@bokr.com \
    --cc=46782@debbugs.gnu.org \
    --cc=blasforr@gmail.com \
    --cc=maxim.cournoyer@gmail.com \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).