# GNU Guix --- Functional package management for GNU # Copyright © 2018 Chris Marusich # Copyright © 2018, 2019, 2020, 2022, 2023 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 pack' command-line utility. # # A network connection is required to build %bootstrap-coreutils&co, # which is required to run these tests with the --bootstrap option. if ! guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null; then exit 77 fi guix pack --version # Use --no-substitutes because we need to verify we can do this ourselves. # Use --no-grafts to avoid interference--e.g., --dry-run passing even when # given an unsupported package. GUIX_BUILD_OPTIONS="--no-substitutes --no-grafts" export GUIX_BUILD_OPTIONS test_directory="`mktemp -d`" trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_directory"' EXIT # Reject unsuppoted packages. guix pack intelmetool -s armhf-linux -n && false # Compute the derivation of a pack. drv="`guix pack coreutils -d --no-grafts`" guix gc -R "$drv" | grep "`guix build coreutils -d --no-grafts`" # Compute the derivation of a cross-compiled pack. Make sure it refers to the # cross-compiled package and not to the native package. drv="`guix pack idutils -d --no-grafts --target=arm-linux-gnueabihf`" guix gc -R "$drv" | \ grep "`guix build idutils --target=arm-linux-gnueabihf -d --no-grafts`" guix gc -R "$drv" | grep "`guix build idutils -d --no-grafts`" && false # Build a tarball with no compression. guix pack --compression=none --bootstrap guile-bootstrap # Build a tarball (with compression). Check that '-e' works as well. out1="`guix pack --bootstrap guile-bootstrap`" out2="`guix pack --bootstrap -e '(@ (gnu packages bootstrap) %bootstrap-guile)'`" test -n "$out1" test "$out1" = "$out2" # Test '--root'. guix pack -r "$test_directory/my-guile" --bootstrap guile-bootstrap test "`readlink "$test_directory/my-guile"`" = "$out1" guix gc --list-roots | grep "^$test_directory/my-guile$" rm "$test_directory/my-guile" # Build a tarball with a symlink.2016-11-03tests: 'make check-system' prints the "build trace"....Ludovic Courtès 2016-10-27tests: Use #:fallback? #t when building system tests....Ludovic Courtès 2016-06-20build: 'make check-system' now honors $TESTS....Ludovic Courtès 2016-06-20tests: Add a mechanism to describe and discover system tests....Ludovic Courtès 2016-06-20tests: Add system installation test....Ludovic Courtès 2016-05-04build: Add 'run-system-tests.scm'....Ludovic Courtès
    st_directory guile 2>&1 | grep pack.*\.drv`" test -n "$drv1" test "$drv1" != "$drv2" # Try '--manifest' options. cat > "$test_directory/manifest1.scm" <manifest '("guile")) EOF cat > "$test_directory/manifest2.scm" <manifest '("emacs")) EOF drv="`guix pack --no-grafts -d -m "$test_directory/manifest1.scm" -m "$test_directory/manifest2.scm"`" guix gc -R "$drv" | grep `guix build guile -d --no-grafts` guix gc -R "$drv" | grep `guix build emacs -d --no-grafts`