aboutsummaryrefslogtreecommitdiff
# GNU Guix --- Functional package management for GNU
# Copyright © 2013, 2014, 2015, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
#
# 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 <http://www.gnu.org/licenses/>.

#
# Test the 'guix archive' command-line utility.
#

guix archive --version

archive="t-archive-$$"
archive_alt="t-archive-alt-$$"
tmpdir="t-archive-dir-$$"
rm -f "$archive" "$archive_alt"
rm -rf "$tmpdir"

trap 'rm -f "$archive" "$archive_alt"; chmod -R +w "$tmpdir"; rm -rf "$tmpdir"' EXIT

guix archive --export guile-bootstrap > "$archive"
guix archive --export guile-bootstrap:out > "$archive_alt"
cmp "$archive" "$archive_alt"

guix archive --export							\
    -e '(@ (gnu packages bootstrap) %bootstrap-guile)' > "$archive_alt"
cmp "$archive" "$archive_alt"

guix archive --export `guix build guile-bootstrap` > "$archive_alt"
cmp "$archive" "$archive_alt"

# Check the exit value upon import.
guix archive --import < "$archive"

guix archive --export something-that-does-not-exist && false

# This one must not be listed as missing.
guix build guile-bootstrap > "$archive"
guix archive --missing < "$archive"
test "`guix archive --missing < "$archive"`" = ""

# Two out of three should be listed as missing.
echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo" >> "$archive"
echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar" >> "$archive"
guix archive --missing < "$archive" > "$archive_alt"
echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo" > "$archive"
echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar" >> "$archive"
cmp "$archive" "$archive_alt"

# This is not a valid store file name, so an error.
echo something invalid > "$archive"
guix archive --missing < "$archive" && false

# Check '--extract'.
guile -c "(use-modules (guix serialization))
  (call-with-output-file \"$archive\"
    (lambda (port)
      (write-file \"$(guix build guile-bootstrap)\" port)))"
guix archive -x "$tmpdir" < "$archive"
test -x "$tmpdir/bin/guile"
test -d "$tmpdir/lib/guile"

# Check '--list'.
guix archive -t < "$archive" | grep "^D /share/guile"
guix archive -t < "$archive" | grep "^x /bin/guile"
guix archive -t < "$archive" | grep "^r /share/guile.*/boot-9\.scm"

echo foo | guix archive --authorize && false

exit 0
m, gnu/packages/lolcode.scm, gnu/packages/lxde.scm, gnu/packages/lxqt.scm, gnu/packages/mail.scm, gnu/packages/markup.scm, gnu/packages/mate.scm, gnu/packages/maths.scm, gnu/packages/mc.scm, gnu/packages/messaging.scm, gnu/packages/music.scm, gnu/packages/ncurses.scm, gnu/packages/networking.scm, gnu/packages/nickle.scm, gnu/packages/openbox.scm, gnu/packages/pdf.scm, gnu/packages/perl-check.scm, gnu/packages/perl.scm, gnu/packages/python-compression.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/python-xyz.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/ruby.scm, gnu/packages/rust.scm, gnu/packages/scheme.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/ssh.scm, gnu/packages/suckless.scm, gnu/packages/tbb.scm, gnu/packages/telephony.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tls.scm, gnu/packages/tor.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/web.scm, gnu/packages/wm.scm, gnu/packages/xdisorg.scm, gnu/packages/xfce.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, gnu/services/certbot.scm, gnu/services/desktop.scm, gnu/services/version-control.scm, gnu/services/web.scm, guix/import/hackage.scm, guix/licenses.scm: Likewise. Signed-off-by: Efraim Flashner <efraim@flashner.co.il> 2020-03-24gnu: GHC: Enable RUNPATH validation.Marius Bakke * gnu/packages/haskell.scm (ghc-7, ghc-8.0, ghc-8.4)[arguments]: Remove #:validate-runpath?. 2020-03-24gnu: ghc@8.0: Remove obsolete patch.Marius Bakke * gnu/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/haskell.scm (ghc-8.0)[source](patches): Remove it. 2020-03-24gnu: ghc: Really disable test that fails with glibc 2.30 and later.Marius Bakke This follows up commit 2e9c43aa9adac2bd6bcf92373d1cf9f322afa5a3, which was incomplete. Fixes <https://bugs.gnu.org/39358>. * gnu/packages/patches/ghc-testsuite-dlopen-pie.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. Also use tabs instead of spaces on surrounding patches. * gnu/packages/haskell.scm (ghc-8.6)[native-inputs]: Add patch for "ghc-testsuite". [arguments]: Remove incomplete workaround for the same issue. 2020-03-23gnu: GHC: Disable test that fails with glibc 2.30 and later.Marius Bakke Fixes <https://bugs.gnu.org/39358>. * gnu/packages/haskell.scm (ghc-8.6)[arguments]: Add substitution to disable broken test. 2020-03-23gnu: ghc@8.4: Update to 8.4.4.Marius Bakke * gnu/packages/haskell.scm (ghc-8.4): Update to 8.4.4. 2020-03-23gnu: ghc@8.4: Remove redundant inputs.Marius Bakke Incidentally, this fixes a build failure where GHC's build processes fail to link libffi and libgmp for 'ghc-cabal'. * gnu/packages/haskell.scm (ghc-8.4)[inputs]: Remove BINUTILS, GCC, and MAKE-LD-WRAPPER. [arguments]: Adjust accordingly.