mbox

[bug#36469,0/2] 'guix pack' records environment variables

Message ID 20190702083731.10354-1-ludo@gnu.org
Headers show

Message

Ludovic Courtès July 2, 2019, 8:37 a.m. UTC
Hello Guix!

With these patches, images created by ‘guix pack -f docker’ or
‘guix pack -f singularity’ define the right environment variables
for the profile.

For instance, if you do:

  guix pack -f docker guile guile-json --entry-point=bin/guile

Then:

  docker run THE-IMAGE

will spawn Guile in an environment with $GUILE_LOAD_PATH pointing
to the profile, such that the (json) module is automatically found.

The change for Singularity is similar.  I’ve tested it with an
instance of Singularity 3.2.0.  Unfortunately, we still have 2.x
in Guix and that doesn’t quite support the environment file, so I’ve
chosen to punt on this one.

Thoughts?

Ludo’.

Ludovic Courtès (2):
  pack: 'docker' backend records the profile's search paths.
  pack: 'squashfs' backend records the profile's search paths.

 gnu/tests/docker.scm      | 16 ++++++----
 gnu/tests/singularity.scm | 18 ++++++++++-
 guix/docker.scm           | 17 ++++++++---
 guix/scripts/pack.scm     | 64 ++++++++++++++++++++++++++++++++++++---
 4 files changed, 99 insertions(+), 16 deletions(-)

Comments

Simon Tournier July 2, 2019, 4:46 p.m. UTC | #1
Hi,

That's awesome !

I have not tried the patch yet because I am not able to `git pull`
(issue with gnu.org NS and the network of my University, whatever!)
and my current version seems too old.


> The change for Singularity is similar.  I’ve tested it with an
> instance of Singularity 3.2.0.  Unfortunately, we still have 2.x
> in Guix and that doesn’t quite support the environment file, so I’ve
> chosen to punt on this one.

In `docker.scm` you replace %bootstrap-guile by guile-2.2, that's you
are talking about?
And now both `docker.scm` and `singularity.scm` are consistent to
guile-2.2 and there were not. :-)


Thank you again for the patch
simon
Ludovic Courtès July 4, 2019, 9:22 a.m. UTC | #2
Hi,

zimoun <zimon.toutoune@gmail.com> skribis:

> That's awesome !

Glad you like it!

>> The change for Singularity is similar.  I’ve tested it with an
>> instance of Singularity 3.2.0.  Unfortunately, we still have 2.x
>> in Guix and that doesn’t quite support the environment file, so I’ve
>> chosen to punt on this one.
>
> In `docker.scm` you replace %bootstrap-guile by guile-2.2, that's you
> are talking about?

No no, I was talking about Singularity 2.x, not Guile 2.x.  :-)

Thanks for your feedback,
Ludo’.