# GNU Guix --- Functional package management for GNU
-# Copyright © 2012, 2013, 2014, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2012, 2013, 2014, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
#
# This file is part of GNU Guix.
#
guix build hello -d | \
grep -e '-hello-[0-9\.]\+\.drv$'
+# Passing a URI.
+GUIX_DAEMON_SOCKET="file://$GUIX_STATE_DIRECTORY/daemon-socket/socket" \
+guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'
+
+( if GUIX_DAEMON_SOCKET="weird://uri" \
+ guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'; \
+ then exit 1; fi )
+
# Check --sources option with its arguments
module_dir="t-guix-build-$$"
mkdir "$module_dir"
| grep -e 'foo\.tar\.gz' -e 'bar\.tar\.gz' -e 'bar\.dat' \
| wc -l` -eq 3
+
+# Unbound variables.
+cat > "$module_dir/foo.scm"<<EOF
+(define-module (foo)
+ #:use-module (guix tests)
+ #:use-module (guix build-system trivial))
+
+(define-public foo
+ (dummy-package "package-with-something-wrong"
+ (build-system trivial-build-system)
+ (inputs (quasiquote (("sed" ,sed)))))) ;unbound variable
+EOF
+
+if guix build package-with-something-wrong -n; then false; else true; fi
+guix build package-with-something-wrong -n 2> "$module_dir/err" || true
+grep "unbound" "$module_dir/err" # actual error
+grep "forget.*(gnu packages base)" "$module_dir/err" # hint
+rm -f "$module_dir"/*
+
# Should all return valid log files.
drv="`guix build -d -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'`"
out="`guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'`"
# Parsing package names and versions.
guix build -n time # PASS
-guix build -n time@1.7 # PASS, version found
-guix build -n time-1.7 # PASS, deprecated version syntax
+guix build -n time@1.9 # PASS, version found
if guix build -n time@3.2; # FAIL, version not found
then false; else true; fi
if guix build -n something-that-will-never-exist; # FAIL
guix build -e '#~(mkdir #$output)' -d
guix build -e '#~(mkdir #$output)' -d | grep 'gexp\.drv'
+# Same with a file-like object.
+guix build -e '(computed-file "foo" #~(mkdir #$output))' -d
+guix build -e '(computed-file "foo" #~(mkdir #$output))' -d | grep 'foo\.drv'
+
# Building from a package file.
cat > "$module_dir/package.scm"<<EOF
(use-modules (gnu))