* Running make inside a Guix Container From Outside
@ 2021-09-06 16:57 jgart
2021-09-07 15:47 ` zimoun
0 siblings, 1 reply; 3+ messages in thread
From: jgart @ 2021-09-06 16:57 UTC (permalink / raw)
To: help-guix
Hi Guixers,
I started making a quick bash script that started like this:
```
#!/bin/sh
git clone https://git.savannah.gnu.org/git/guix.git guix-3000
cd guix-3000
guix environment guix --container
./bootstrap
./configure --local-statedir=/var
time make
exit
print "ready for hacking"
```
One of the problems with the above script is that the `guix environment guix --container` blocks `./bootstrap` etc...
I'm thinking of rewriting the script in python or guile using some form of async to solve that issue if needed.
Once `guix environment guix --container` is unblocked by me killing the process manually,
the following commands run outside the container and fail. This is expected.
So, I ran `guix environment guix --container` in one terminal and opened another terminal to see if I can
first test running commands in containers from the "outside" with `guix container exec`.
I tried `guix container exec PID "./boostrap"` and it didn't fail. In the other terminal running the
container I looked to see if there was any change to container's directory structure and there was none.
I also ran `guix container exec PID "./configure --localstatedir=/var"` and
`guix container exec PID "time make"`.
Am I misusing `guix container exec`?
Is it currently possible to run arbitrary commands in guix containers from outside guix containers?
all best,
_________________________________________
/ 3B1D 7F19 E36B B60C 0F5B 2CA9 A52A A2B4 \
\ 77B6 DD35 /
-----------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Running make inside a Guix Container From Outside
2021-09-06 16:57 Running make inside a Guix Container From Outside jgart
@ 2021-09-07 15:47 ` zimoun
2021-09-10 5:24 ` jgart
0 siblings, 1 reply; 3+ messages in thread
From: zimoun @ 2021-09-07 15:47 UTC (permalink / raw)
To: jgart; +Cc: help-guix
Hi,
On Mon, 6 Sept 2021 at 18:58, jgart <jgart@dismail.de> wrote:
> ```
> #!/bin/sh
> git clone https://git.savannah.gnu.org/git/guix.git guix-3000
> cd guix-3000
> guix environment guix --container
> ./bootstrap
> ./configure --local-statedir=/var
> time make
> exit
> print "ready for hacking"
> ```
Instead, I would run something like
--8<---------------cut here---------------start------------->8---
#!/bin/sh
guix environment -C guix --ad-hoc bash -- bash -c \
'./bootstrap && ./configure --localstatedir=/var && time make'
guix environment -C guix
--8<---------------cut here---------------end--------------->8---
Well, this creates 2 temporary profiles. If you want to save some
time, you can also pass '--ad-hoc bash' to the second environment even
if you do not you it.
Note that instead of '--ad-hoc', I would use '-m manifest.scm'
containing all the useful tools (Git, Emacs, etc.)
> Am I misusing `guix container exec`?
I do not know, I do not really use "guix container". :-) Well, I
consider such subcommand as experimental. ;-)
Hope that helps,
simon
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Running make inside a Guix Container From Outside
2021-09-07 15:47 ` zimoun
@ 2021-09-10 5:24 ` jgart
0 siblings, 0 replies; 3+ messages in thread
From: jgart @ 2021-09-10 5:24 UTC (permalink / raw)
To: zimoun; +Cc: help-guix
On Tue, 07 Sep 2021 17:47:28 +0200 zimoun <zimon.toutoune@gmail.com> wrote:
> Hope that helps,
> simon
Thank you Simon! That solves it for me. :)
all best,
jgart
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-10 5:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-06 16:57 Running make inside a Guix Container From Outside jgart
2021-09-07 15:47 ` zimoun
2021-09-10 5:24 ` jgart
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).