Hi Lars,

I am observing the same behavior.

I built a SquashFS image using `guix pack -f squashfs', then I executed `singularity exec -e --env HELLO=hello image.gz.squashfs env', but the HELLO variable did not show up.

Then, I executed the same command with debugging enabled, like so `singularity -d exec -e --env HELLO=hello image.gz.squashfs env'. The output showed "Forwarding SINGULARITYENV_HELLO as HELLO environment variable", but the variable did not survive.

The /.singularity.d/env/ folder in the image contains only one script, i.e., 90-environment.sh, which does ". /gnu/store/...zs3w-profile/etc/profile". The profile simply exports three environment variables, but does not seem to load any external script that could explain the disappearance of the HELLO variable from the environment.

To confirm, I spawned a shell using `singularity exec -e --env HELLO=hello image.gz.squashfs bash --norc --noprofile' and executed the following sequence:

export HELLO=hello
env
. /gnu/store/...zs3w-profile/etc/profile (source the Guix profile of the image)
env

The HELLO variable remained in the environment.

Unfortunately, I currently do not have time to investigate further so I use a workaround -- `singularity exec -e image.gz.squashfs env HELLO=hello ...'.

Questions for the developers: Is this behavior intentional? Can it be 
customized?

Best regards,
Marek




Reply via email to