# GNU Guix --- Functional package management for GNU # Copyright © 2021-2022 Ludovic Courtès # # This file is part of GNU Guix. # # GNU Guix is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or (at # your option) any later version. # # GNU Guix is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Guix. If not, see . # # Test the 'guix shell' alias. # guix shell --version configdir="t-guix-shell-config-$$" tmpdir="t-guix-shell-$$" trap 'rm -r "$tmpdir" "$configdir"' EXIT mkdir "$tmpdir" "$configdir" "$configdir/guix" XDG_CONFIG_HOME="$(realpath $configdir)" export XDG_CONFIG_HOME guix shell --bootstrap --pure guile-bootstrap -- guile --version # '--ad-hoc' is a thing of the past. ! guix shell --ad-hoc guile-bootstrap # Rejecting unsupported packages. ! guix shell -s armhf-linux intelmetool -n # Test approximately that the child process does not inherit extra file # descriptors. Ideally we'd check there's nothing more than 0, 1, and 2, but # we cannot do that because (1) we might be inheriting additional FDs, for # example due to , and (2) Bash itself # opens a couple of extra FDs. initial_fd_list="$(echo /proc/$$/fd/*)" fd_list="$(guix shell --bootstrap guile-bootstrap -- \ "$SHELL" -c 'echo /proc/$$/fd/*')" test "$(echo $fd_list | wc -w)" -le "$(echo $initial_fd_list | wc -w)" # Ignoring unauthorized files. cat > "$tmpdir/guix.scm" < "stderr") grep "not authorized" "$tmpdir/stderr" rm "$tmpdir/stderr" # Authorize the directory. echo "$(realpath "$tmpdir")" > "$configdir/guix/shell-authorized-directories" # Ignoring 'manifest.scm' and 'guix.scm' in non-interactive use. (cd "$tmpdir"; guix shell --bootstrap -- true) mv "$tmpdir/guix.scm" "$tmpdir/manifest.scm" (cd "$tmpdir"; guix shell --bootstrap -- true) rm "$tmpdir/manifest.scm" # Honoring the local 'manifest.scm' file. cat > "$tmpdir/manifest.scm" <manifest '("guile-bootstrap")) EOF cat > "$tmpdir/fake-shell.sh" < "$tmpdir/manifest.scm" (cd "$tmpdir"; SHELL="$(realpath fake-shell.sh)" guix shell --bootstrap -q) rm "$tmpdir/manifest.scm" # Make sure '-D' affects only the immediately following '-f', and not packages # that appear later: . cat > "$tmpdir/empty-package.scm" < /dev/null then # Compute the build environment for the initial GNU Make. guix shell --bootstrap --no-substitutes --search-paths --pure \ -D -e '(@ (guix tests) gnu-make-for-tests)' > "$tmpdir/a" # Make sure bootstrap binaries are in the profile. profile=`grep "^export PATH" "$tmpdir/a" | sed -r 's|^.*="(.*)/bin"|\1|'` # Make sure the bootstrap binaries are all listed where they belong. grep -E "^export PATH=\"$profile/bin\"" "$tmpdir/a" grep -E "^export C_INCLUDE_PATH=\"$profile/include\"" "$tmpdir/a" grep -E "^export LIBRARY_PATH=\"$profile/lib\"" "$tmpdir/a" for dep in bootstrap-binaries-0 gcc-bootstrap-0 glibc-bootstrap-0 do guix gc --references "$profile" | grep "$dep" done # 'make-boot0' itself must not be listed. ! guix gc --references "$profile" | grep make-boot0 # Honoring the local 'guix.scm' file. echo '(@ (guix tests) gnu-make-for-tests)' > "$tmpdir/guix.scm" (cd "$tmpdir"; guix shell --bootstrap --search-paths --pure > "b") cmp "$tmpdir/a" "$tmpdir/b" rm "$tmpdir/guix.scm" fi sts/packages.scm?id=1b0a095a817b2743ad4a111edbb5e11b40a311a5'>tests: Re-add debug output to a package tests....* tests/packages.scm ("fold-available-packages with/without cache"): Re-introduce debugging output. Maxim Cournoyer 2023-03-13packages: 'package-input-rewriting/spec' ignores hidden packages....The primary motivation is to support things like: guix build guix --with-input=guile=guile-next without triggering a rebuild of (@@ (gnu packages commencement) guile-final) and similar things. It is also consistent with package name resolution on the command line: a package that cannot be named cannot be replaced. * guix/packages.scm (package-input-rewriting/spec)[rewrite]: When P is hidden, return it as-is. * tests/packages.scm ("package-input-rewriting/spec, hidden package"): New test. * doc/guix.texi (Defining Package Variants): Update. (Package Transformation Options): Update '--with-input' example. Ludovic Courtès 2023-03-13packages: Consider 'patches' by 'package-direct-sources'....* guix/packages.scm (package-direct-sources): Return 'origin' from 'patches'. * tests/packages.scm: Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Simon Tournier 2022-12-13packages: Add 'package-upstream-name*'....* guix/packages.scm (package-upstream-name*): New procedure. * tests/packages.scm ("package-upstream-name*"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Lars-Dominik Braun 2022-11-11grafts: Run with a UTF-8 locale....Fixes <https://issues.guix.gnu.org/55968>. Reported by Maxime Devos <maximedevos@telenet.be>. * guix/grafts.scm (%graft-with-utf8-locale?): New parameter. (graft-derivation/shallow)[glibc-locales, set-utf8-locale]: New variables. [build]: Use 'set-utf8-locale'. * tests/gexp.scm, tests/grafts.scm, tests/packages.scm: Set '%graft-with-utf8-locale?' to #f. Ludovic Courtès