diff options
author | Ludovic Courtès <ludovic.courtes@inria.fr> | 2023-08-11 17:20:06 +0200 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2023-09-17 15:09:09 -0400 |
commit | cbb793995ff58943e9976af9b5d3cef478c0ea0d (patch) | |
tree | dea8508a1ecb3fb5aa31d469e67b5843e0e42b47 /tests/guix-build.sh | |
parent | aec91bc5fe7a955050133e47118b6988cc5acb68 (diff) |
ui: 'load*' accepts /dev/fd/N files pointing to a pipe.
This allows users to write Bash commands like:
guix time-machine -C <(echo %default-channels) -- ...
or:
guix build -m <(echo '(specifications->manifest (list "guile"))')
Previously, on GNU/Linux, they would fail with:
error: failed to load '/dev/fd/63': No such file or directory
* guix/ui.scm (try-canonicalize-path): New procedure.
(load*): Use it.
* tests/guix-build.sh: Test 'guix build -m' with a /dev/fd/N file.
Diffstat (limited to 'tests/guix-build.sh')
-rw-r--r-- | tests/guix-build.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/guix-build.sh b/tests/guix-build.sh index 317c58ac42..4eab0e38b6 100644 --- a/tests/guix-build.sh +++ b/tests/guix-build.sh @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2012-2014, 2016-2022 Ludovic Courtès <ludo@gnu.org> +# Copyright © 2012-2014, 2016-2023 Ludovic Courtès <ludo@gnu.org> # Copyright © 2020 Marius Bakke <mbakke@fastmail.com> # Copyright © 2021 Chris Marusich <cmmarusich@gmail.com> # @@ -397,6 +397,13 @@ guix build -d -m "$module_dir/manifest.scm" \ rm "$module_dir"/*.scm +if [ -n "$BASH_VERSION" ] +then + # Check whether we can load from a /dev/fd/N denoting a pipe, using this + # handy Bash-specific construct. + guix build -m <(echo '(specifications->manifest (list "guile"))') -n +fi + # Using 'GUIX_BUILD_OPTIONS'. GUIX_BUILD_OPTIONS="--dry-run --no-grafts" export GUIX_BUILD_OPTIONS |