mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
tests: Disable grafts by default.
Fixes <http://bugs.gnu.org/22872>. Reported by myglc2 <myglc2@gmail.com>. * test-env.in: Define and export 'GUIX_BUILD_OPTIONS'. * tests/guix-build.sh: When setting 'GUIX_BUILD_OPTIONS', make sure it contains '--no-grafts'. * tests/guix-package.sh: Likewise. * tests/guix-daemon.sh: Add (%graft? #f) in Scheme snippets.
This commit is contained in:
parent
637cd12543
commit
442a6ff5ea
4 changed files with 18 additions and 7 deletions
|
@ -108,8 +108,13 @@ unset LANGUAGE
|
||||||
LC_MESSAGES=C
|
LC_MESSAGES=C
|
||||||
export LC_MESSAGES
|
export LC_MESSAGES
|
||||||
|
|
||||||
|
# Disable grafts by default because they can cause things to be built
|
||||||
|
# regardless of '--dry-run'.
|
||||||
|
GUIX_BUILD_OPTIONS="--no-grafts"
|
||||||
|
export GUIX_BUILD_OPTIONS
|
||||||
|
|
||||||
# Ignore user settings.
|
# Ignore user settings.
|
||||||
unset GUIX_PACKAGE_PATH GUIX_BUILD_OPTIONS
|
unset GUIX_PACKAGE_PATH
|
||||||
|
|
||||||
storedir="@storedir@"
|
storedir="@storedir@"
|
||||||
prefix="@prefix@"
|
prefix="@prefix@"
|
||||||
|
|
|
@ -207,7 +207,7 @@ guix build --file="$module_dir/gexp.scm" -d
|
||||||
guix build --file="$module_dir/gexp.scm" -d | grep 'gexp\.drv'
|
guix build --file="$module_dir/gexp.scm" -d | grep 'gexp\.drv'
|
||||||
|
|
||||||
# Using 'GUIX_BUILD_OPTIONS'.
|
# Using 'GUIX_BUILD_OPTIONS'.
|
||||||
GUIX_BUILD_OPTIONS="--dry-run"
|
GUIX_BUILD_OPTIONS="--dry-run --no-grafts"
|
||||||
export GUIX_BUILD_OPTIONS
|
export GUIX_BUILD_OPTIONS
|
||||||
|
|
||||||
guix build emacs
|
guix build emacs
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# GNU Guix --- Functional package management for GNU
|
# GNU Guix --- Functional package management for GNU
|
||||||
# Copyright © 2012, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
|
# Copyright © 2012, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
|
||||||
#
|
#
|
||||||
# This file is part of GNU Guix.
|
# This file is part of GNU Guix.
|
||||||
#
|
#
|
||||||
|
@ -27,8 +27,9 @@ guix build --version
|
||||||
|
|
||||||
drv="`guix build emacs -d`"
|
drv="`guix build emacs -d`"
|
||||||
out="`guile -c ' \
|
out="`guile -c ' \
|
||||||
(use-modules (guix) (gnu packages emacs)) \
|
(use-modules (guix) (guix grafts) (gnu packages emacs)) \
|
||||||
(define store (open-connection)) \
|
(define store (open-connection)) \
|
||||||
|
(%graft? #f)
|
||||||
(display (derivation->output-path (package-derivation store emacs)))'`"
|
(display (derivation->output-path (package-derivation store emacs)))'`"
|
||||||
|
|
||||||
hash_part="`basename $out | cut -c 1-32`"
|
hash_part="`basename $out | cut -c 1-32`"
|
||||||
|
@ -88,9 +89,12 @@ guix-daemon --no-substitutes --listen="$socket" --disable-chroot \
|
||||||
daemon_pid=$!
|
daemon_pid=$!
|
||||||
|
|
||||||
guile -c "
|
guile -c "
|
||||||
(use-modules (guix) (guix tests) (srfi srfi-34))
|
(use-modules (guix) (guix grafts) (guix tests) (srfi srfi-34))
|
||||||
(define store (open-connection-for-tests \"$socket\"))
|
(define store (open-connection-for-tests \"$socket\"))
|
||||||
|
|
||||||
|
;; Disable grafts to avoid building more than needed.
|
||||||
|
(%graft? #f)
|
||||||
|
|
||||||
(define (build-without-failing drv)
|
(define (build-without-failing drv)
|
||||||
(lambda (store)
|
(lambda (store)
|
||||||
(guard (c ((nix-protocol-error? c) (values #t store)))
|
(guard (c ((nix-protocol-error? c) (values #t store)))
|
||||||
|
|
|
@ -261,7 +261,7 @@ unset GUIX_PACKAGE_PATH
|
||||||
|
|
||||||
# Using 'GUIX_BUILD_OPTIONS'.
|
# Using 'GUIX_BUILD_OPTIONS'.
|
||||||
available="`guix package -A | sort`"
|
available="`guix package -A | sort`"
|
||||||
GUIX_BUILD_OPTIONS="--dry-run"
|
GUIX_BUILD_OPTIONS="--dry-run --no-grafts"
|
||||||
export GUIX_BUILD_OPTIONS
|
export GUIX_BUILD_OPTIONS
|
||||||
|
|
||||||
# Make sure $GUIX_BUILD_OPTIONS is not simply appended to the command-line,
|
# Make sure $GUIX_BUILD_OPTIONS is not simply appended to the command-line,
|
||||||
|
@ -270,7 +270,9 @@ available2="`guix package -A | sort`"
|
||||||
test "$available2" = "$available"
|
test "$available2" = "$available"
|
||||||
guix package -I
|
guix package -I
|
||||||
|
|
||||||
unset GUIX_BUILD_OPTIONS
|
# Restore '--no-grafts', which makes sure we don't end up building stuff when
|
||||||
|
# '--dry-run' is passed.
|
||||||
|
GUIX_BUILD_OPTIONS="--no-grafts"
|
||||||
|
|
||||||
# Applying a manifest file.
|
# Applying a manifest file.
|
||||||
cat > "$module_dir/manifest.scm"<<EOF
|
cat > "$module_dir/manifest.scm"<<EOF
|
||||||
|
|
Loading…
Reference in a new issue