diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index d86d30308..5c7d83881 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -513,7 +513,7 @@ symbolic link from ~/.guix-profile to the environment profile." (symlink profile profile-dir)) (lambda args (if (= EEXIST (system-error-errno args)) - (leave (G_ "cannot link profile: path '~a' already exists within container~%") + (leave (G_ "cannot link profile: '~a' already exists within container~%") profile-dir) (apply throw args)))))) @@ -625,7 +625,7 @@ message if any test fails." (when container? (assert-container-features)) (when (and (not container?) link-prof?) - (leave (G_ "--link-prof cannot be used without --container~%"))) + (leave (G_ "'--link-profile' cannot be used without '--container'~%"))) (with-store store (set-build-options-from-command-line store opts) diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh index d7c1b7057..df40ce03e 100644 --- a/tests/guix-environment-container.sh +++ b/tests/guix-environment-container.sh @@ -97,6 +97,20 @@ grep -e "$NIX_STORE_DIR/.*-bash" $tmpdir/mounts # bootstrap bash rm $tmpdir/mounts +# Make sure 'GUIX_ENVIRONMENT' is linked to '~/.guix-profile' when requested +# within a container. +( + linktest='(exit (string=? (getenv "GUIX_ENVIRONMENT") +(readlink (string-append (getenv "HOME") "/.guix-profile"))))' + + cd "$tmpdir" \ + && guix environment --bootstrap --container --link-profile \ + --ad-hoc guile-bootstrap --pure \ + -- guile -c "$linktest" +) + +# Check the exit code. + abnormal_exit_code=" (use-modules (system foreign)) ;; Purposely make Guile crash with a segfault. :) diff --git a/tests/guix-environment.sh b/tests/guix-environment.sh index ba686816f..b44aca099 100644 --- a/tests/guix-environment.sh +++ b/tests/guix-environment.sh @@ -71,18 +71,6 @@ echo "(use-modules (guix profiles) (gnu packages bootstrap)) guix environment --bootstrap --manifest=$tmpdir/manifest.scm --pure \ -- "$SHELL" -c 'test -f "$GUIX_ENVIRONMENT/bin/guile"' -# Make sure 'GUIX_ENVIRONMENT' is linked to '~/.guix-profile' when requested -# within a container -( - linktest='(exit (string=? (getenv "GUIX_ENVIRONMENT") -(readlink (string-append (getenv "HOME") "/.guix-profile"))))' - - cd "$tmpdir" \ - && guix environment --bootstrap --container --link-profile \ - --ad-hoc guile-bootstrap --pure \ - -- guile -c "$linktest" -) - # Make sure '-r' works as expected. rm -f "$gcroot" expected="`guix environment --bootstrap --ad-hoc guile-bootstrap \