aboutsummaryrefslogtreecommitdiff
# GNU Guix --- Functional package management for GNU
# Copyright © 2013, 2015, 2017, 2018, 2019 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 gc' command-line utility.
#

guix gc --version

trap "rm -f guix-gc-root" EXIT
rm -f guix-gc-root

# Below we are using 'drv' and 'out' to contain store file names.  If 'drv'
# and 'out' are environment variables, 'list-runtime-roots' will "see" them
# and thus prevent $drv and $out from being garbage-collected.  Using 'unset'
# allows us to make sure these are truly local shell variables and not
# environments variables.
unset drv
unset out

# For some operations, passing extra arguments is an error.
for option in "" "-C 500M" "--verify" "--optimize" "--list-roots"
do
    guix gc $option whatever && false
done

# This should fail.
guix gc --verify=foo && false

# Check the references of a .drv.
drv="`guix build guile-bootstrap -d`"
out="`guix build guile-bootstrap`"
test -f "$drv" && test -d "$out"

guix gc --references "$drv" | grep -e -bash
guix gc --references "$out"
guix gc --references "$out/bin/guile"

guix gc --references /dev/null && false

# Check derivers.
guix gc --derivers "$out" | grep "$drv"

# Add then reclaim a .drv file.
drv="`guix build idutils -d`"
test -f "$drv"

guix gc --list-dead | grep "$drv"
guix gc --delete "$drv"
test ! -f "$drv"

# Add a .drv, register it as a root.
drv="`guix build --root=guix-gc-root lsh -d`"
test -f "$drv" && test -L guix-gc-root

guix gc --list-roots | grep "$PWD/guix-gc-root"

guix gc --list-live | grep "$drv"
guix gc --delete "$drv" && false

rm guix-gc-root
guix gc --list-dead | grep "$drv"
guix gc --delete "$drv"
test ! -f "$drv"

# Try a random collection.
guix gc -C 1KiB

# Check trivial error cases.
guix gc --delete /dev/null && false

# Bug #19757
out="`guix build guile-bootstrap`"
test -d "$out"

guix gc --delete "$out"

test ! -d "$out"

out="`guix build guile-bootstrap`"
test -d "$out"

guix gc --delete "$out/"

test ! -d "$out"

out="`guix build guile-bootstrap`"
test -d "$out"

guix gc --delete "$out/bin/guile"
ific is not something we really want or do elsewhere, and interferers with mass updates like the one I'm about to make. * gnu/packages/glib.scm (perl-net-dbus-glib)[home-page]: Use canonical home page. * gnu/packages/perl-check.scm (perl-test-nowarnings, perl-test-output) (perl-test-simple, perl-test-tester)[home-page]: Likewise. * gnu/packages/perl.scm (perl-benchmark-timer, perl-clone) (perl-digest-sha1, perl-file-which, perl-getopt-tabular, perl-io-string) (perl-ipc-run3, perl-probe-perl, perl-regexp-common, perl-sys-cpu) [home-page]: Likewise. * gnu/packages/tcl.scm (perl-tk)[home-page]: Likewise. * gnu/packages/tls.scm (perl-net-ssleay)[home-page]: Likewise. * gnu/packages/web.scm (perl-www-curl)[home-page]: Likewise. * gnu/packages/xml.scm (perl-xml-dom)[home-page]: Likewise. * gnu/packages/xorg.scm (perl-x11-protocol-other)[home-page]: Likewise. Tobias Geerinckx-Rice 2018-06-16gnu: Add perl-test-perltidy....* gnu/packages/perl-check.scm (perl-test-perltidy): New variable. Kei Kebreau 2018-06-16gnu: Add perl-test-distmanifest....* gnu/packages/perl-check.scm (perl-test-distmanifest): New variable. Kei Kebreau 2018-06-04gnu: perl-test-without-module: Update to 0.20....* gnu/packages/perl-check.scm (perl-test-without-module): Update to 0.20. Tobias Geerinckx-Rice 2018-04-27gnu: perl-test-notabs: Update to 2.02....* gnu/packages/perl-check.scm (perl-test-notabs): Update to 2.02. Tobias Geerinckx-Rice 2018-04-26gnu: perl-test-simple: Update to 1.302136....* gnu/packages/perl-check.scm (perl-test-simple): Update to 1.302136. Tobias Geerinckx-Rice 2018-04-26gnu: perl-test-output: Update to 1.031....* gnu/packages/perl-check.scm (perl-test-output): Update to 1.031. Tobias Geerinckx-Rice 2018-04-26gnu: perl-test-differences: Update to 0.64....* gnu/packages/perl-check.scm (perl-test-differences): Update to 0.64. Tobias Geerinckx-Rice 2018-04-26gnu: perl-test-pod: Update to 1.52....* gnu/packages/perl-check.scm (perl-test-pod): Update to 1.52. Tobias Geerinckx-Rice 2018-04-26gnu: perl-test-base: Update to 0.89....* gnu/packages/perl-check.scm (perl-test-base): Update to 0.89. Tobias Geerinckx-Rice 2018-04-19gnu: Add perl-test-runvalgrind...* gnu/packages/perl-check.scm (perl-test-runvalgrind): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Pierre Neidhardt 2018-03-20Correct name and Email for ng0....* .mailmap: Correct name and Email for ng0. * Makefile.am, doc/guix.texi, etc/completion/fish/guix.fish gnu/packages/accessibility.scm, gnu/packages/admin.scm, gnu/packages/audio.scm, gnu/packages/autotools.scm, gnu/packages/cdrom.scm, gnu/packages/check.scm, gnu/packages/cinnamon.scm, gnu/packages/compression.scm, gnu/packages/crypto.scm, gnu/packages/databases.scm, gnu/packages/django.scm, gnu/packages/dns.scm, gnu/packages/emacs.scm, gnu/packages/enlightenment.scm, gnu/packages/fonts.scm, gnu/packages/fontutils.scm, gnu/packages/forth.scm, gnu/packages/fvwm.scm, gnu/packages/games.scm, gnu/packages/gl.scm, gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm, gnu/packages/gnuzilla.scm, gnu/packages/gtk.scm, gnu/packages/guile-wm.scm, gnu/packages/guile.scm, gnu/packages/haskell-check.scm, gnu/packages/haskell-crypto.scm, gnu/packages/haskell.scm, gnu/packages/image-viewers.scm, gnu/packages/image.scm, gnu/packages/irc.scm, gnu/packages/language.scm, gnu/packages/libcanberra.scm, gnu/packages/linux.scm, gnu/packages/lisp.scm, 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-crypto.scm, gnu/packages/python-web.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: Tobias Geerinckx-Rice <me@tobias.gr> ng0 2018-03-02gnu: perl-test-harness: Update to 3.41....* gnu/packages/perl-check.scm (perl-test-harness): Update to 3.41. Tobias Geerinckx-Rice 2018-02-24gnu: Add perl-test-roo....* gnu/packages/perl-check.scm (perl-test-roo): New public variable. Oleg Pykhalov 2018-02-24gnu: Add perl-test-failwarnings....* gnu/packages/perl-check.scm (perl-test-failwarnings): New public variable. Oleg Pykhalov 2018-02-24gnu: Add perl-test-filename....* gnu/packages/perl-check.scm (perl-test-filename): New public variable. Oleg Pykhalov 2018-02-06gnu: perl-test-simple: Update to 1.302122....* gnu/packages/perl-check.scm (perl-test-simple): Update to 1.302122. Tobias Geerinckx-Rice 2018-01-10gnu: Use one spelling for ‘copyright’....* gnu/packages/gtk.scm: Standardise on ‘copyright’ spelling in file headers. * gnu/packages/pdf.scm: Likewise. * gnu/packages/perl-check.scm: Likewise. * gnu/packages/perl.scm: Likewise. * guix/import/gem.scm: Likewise. * guix/import/hackage.scm: Likewise. Tobias Geerinckx-Rice 2018-01-02gnu: Add perl-test-mockmodule....* gnu/packages/perl-check.scm (perl-test-mockmodule): New public variable. Tobias Geerinckx-Rice 2018-01-02gnu: perl-check: Request to add packages alphabetically....* gnu/packages/perl-check.scm: Copy comment from gnu/packages/perl.scm. Tobias Geerinckx-Rice 2017-12-21gnu: Add perl-test-requiresinternet....* gnu/packages/perl-check.scm (perl-test-requiresinternet): New public variable. Tobias Geerinckx-Rice 2017-12-16gnu: perl-test-yaml: Update to 1.06....* gnu/packages/perl-check.scm (perl-test-yaml): Update to 1.06 Tobias Geerinckx-Rice 2017-12-16gnu: perl-test-trap: Update to 0.3.3....* gnu/packages/perl-check.scm (perl-test-trap): Update to 0.3.3. Tobias Geerinckx-Rice 2017-12-16gnu: perl-test-trailingspace: Update to 0.0301....* gnu/packages/perl-check.scm (perl-test-trailingspace): Update to 0.0301 Tobias Geerinckx-Rice 2017-12-16gnu: perl-test-simple: Update to 1.302120....* gnu/packages/perl-check.scm (perl-test-simple): Update to 1.302120 Tobias Geerinckx-Rice 2017-12-16gnu: perl-test-most: Update to 0.35....* gnu/packages/perl-check.scm (perl-test-most): Update to 0.35 Tobias Geerinckx-Rice 2017-12-14gnu: perl-test-requires: Update to 0.10....* gnu/packages/perl-check.scm (perl-test-requires): Update to 0.10 Tobias Geerinckx-Rice 2017-12-14gnu: perl-test-pod: Update to 1.51....* gnu/packages/perl-check.scm (perl-test-pod): Update to 1.51 [source]: Update URI. Tobias Geerinckx-Rice 2017-12-14gnu: perl-test-mocktime: Update to 0.15....* gnu/packages/perl-check.scm (perl-test-mocktime): Update to 0.15 [propagated-inputs]: Add perl-time-piece. Tobias Geerinckx-Rice 2017-11-19Update email address for ng0.ng0 2017-11-13gnu: Move test packages from perl to perl-check....* gnu/packages/perl.scm (perl-test2-bundle-extended, perl-test2-plugin-nowarnings, perl-test-base, perl-test-class, perl-test-class-most, perl-test-cleannamespaces, perl-test-command, perl-test-cpan-meta, perl-test-cpan-meta-json, perl-test-deep, perl-test-differences, perl-test-directory, perl-test-eol, perl-test-exception, perl-test-fatal, perl-test-file-sharedir-dist, perl-test-files, perl-test-harness, perl-test-leaktrace, perl-test-longstring, perl-test-manifest, perl-test-memory-cycle, perl-test-mockobject, perl-test-mocktime, perl-test-most, perl-test-needs, perl-test-notabs, perl-test-nowarnings, perl-test-number-delta, perl-test-output, perl-test-pod, perl-test-pod-coverage, perl-test-requires, perl-test-script, perl-test-sharedfork, perl-test-simple, perl-test-taint, perl-test-tester, perl-test-trap, perl-test-utf8, perl-test-warn, perl-test-warnings, perl-test-without-module, perl-test-writevariants, perl-test-yaml, perl-test-trailingspace): Move variables to ... * gnu/packages/perl-check.scm: ... this new file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * gnu/packages/admin.scm, gnu/packages/bioinformatics.scm, gnu/packages/crypto.scm, gnu/packages/databases.scm, gnu/packages/glib.scm, gnu/packages/gnupg.scm, gnu/packages/image-viewers.scm, gnu/packages/language.scm, gnu/packages/networking.scm, gnu/packages/package-management.scm, gnu/packages/perl.scm, gnu/packages/terminals.scm, gnu/packages/tex.scm, gnu/packages/version-control.scm, gnu/packages/web.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm: Use perl-check module. Ricardo Wurmus