all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#46782: guix environment --expose options cannot be layered onto $PWD
@ 2021-02-25 21:12 Maxim Cournoyer
  2022-11-23 14:24 ` bug#46782: bbb ee
  0 siblings, 1 reply; 9+ messages in thread
From: Maxim Cournoyer @ 2021-02-25 21:12 UTC (permalink / raw)
  To: 46782

Hello Guix!

I noticed, while trying to expose the SSL environment variable inside a
container and doing things such as:

--8<---------------cut here---------------start------------->8---
guix environment --container --network -E SSL --expose=$SSL_CERT_FILE \
     --expose=$SSL_CERT_DIR --ad-hoc [...]
--8<---------------cut here---------------end--------------->8---

that it wasn't possible to expose things onto the implicitly mounted
current working directory.  No error message would be shown, yet the
--expose arguments wouldn't go through unless using --no-cwd.

Here's a minimal example:

--8<---------------cut here---------------start------------->8---
$ guix environment -C --expose=/tmp=$PWD/tmp \
  --ad-hoc bash coreutils -- bash -c 'stat $PWD/tmp'
stat: cannot statx '/var/lib/jenkins/tmp': No such file or directory
--8<---------------cut here---------------end--------------->8---

but,

--8<---------------cut here---------------start------------->8---
$ guix environment --no-cwd -C --expose=/tmp=$PWD/tmp \
  --ad-hoc bash coreutils -- bash -c 'stat $PWD/tmp'
  File: /var/lib/jenkins/tmp
  Size: 73728           Blocks: 152        IO Block: 4096   directory
Device: fd00h/64768d    Inode: 1966081     Links: 397
Access: (1777/drwxrwxrwt)  Uid: (65534/ UNKNOWN)   Gid: (65534/overflow)
Access: 2021-02-25 20:40:08.534757708 +0000
Modify: 2021-02-25 21:10:49.205636074 +0000
Change: 2021-02-25 21:10:49.205636074 +0000
 Birth: 2016-12-07 20:43:16.029221570 +0000
--8<---------------cut here---------------end--------------->8---

succeeds.

I can't think of a technical reason why layering bind mounts wouldn't
work; in fact it already appear to work for multiple --expose options
touching the same hierarchy of files.

If there's a technical reason this cannot/shouldn't happen, we should
warn the user about it.

Thanks,

Maxim




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-03-07  2:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.