nonguix: multiarch-container: Handle empty shares env variable.

Launching a package, like steam, with GUIX_SANDBOX_EXTRA_SHARES= (set to an
empty string) will cause guix shell to fail to launch with "guix shell: error:
statfs: : No such file or directory".

* nonguix/multiarch-container.scm (make-container-wrapper): Check that the
environment variable GUIX_SANDBOX_EXTRA_SHARES is both set and not an empty
string.

Reported-by: apoorv569
This commit is contained in:
John Kehayias 2025-01-08 17:48:20 -05:00
parent 3813013d69
commit 3195ddf9f1
No known key found for this signature in database
GPG Key ID: 499097AE5EA815D9

View File

@ -342,8 +342,11 @@ in a sandboxed FHS environment."
,@(exists-> (getenv "XAUTHORITY"))
#$@(ngc-shared container)))
(DEBUG (equal? (getenv "DEBUG") "1"))
(extra-shares (if (getenv "GUIX_SANDBOX_EXTRA_SHARES")
(string-split (getenv "GUIX_SANDBOX_EXTRA_SHARES") #\:)
;; Make sure this environment variable is not set to the
;; emptry string or else guix shell will fail to start.
(extra-shares-env (getenv "GUIX_SANDBOX_EXTRA_SHARES"))
(extra-shares (if (and extra-shares-env (not (string= extra-shares-env "")))
(string-split extra-shares-env #\:)
#f))
(args (cdr (command-line)))
(command (if DEBUG '()