cgit v1.2.3'/>
<meta name='robots' content='noindex, nofollow'/>
<link rel='stylesheet' type='text/css' href='/cgit-static/cgit.css'/>
<link rel='stylesheet' type='text/css' href='/cgit-static/better-cgit-markdown-heading-color.css'/>
<link rel='shortcut icon' href='/cgit-static/favicon.ico'/>
<link rel='alternate' title='Atom feed' href='https://git.koszko.org/guix/atom/?h=koszko' type='application/atom+xml'/>
</head>
<body>
<div id='cgit'><table id='header'>
<tr>
<td class='logo' rowspan='2'><a href='/'><img src='https://git.koszko.org/cgit-static/cgit.png' alt='cgit logo'/></a></td>
<td class='main'><a href='/'>index</a> : <a href='/guix/'>guix</a></td><td class='form'><form method='get'>
<input type='hidden' name='id' value='c20426ec5cdb846f1f1416942a055651a2a3cb65'/><select name='h' onchange='this.form.submit();'>
<option value='koszko' selected='selected'>koszko</option>
<option value='koszko-scripts'>koszko-scripts</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>Wojtek's customized Guix</td><td class='sub right'></td></tr></table>
<table class='tabs'><tr><td>
<a class='active' href='/guix/about/'>about</a><a href='/guix/'>summary</a><a href='/guix/refs/?id=c20426ec5cdb846f1f1416942a055651a2a3cb65'>refs</a><a href='/guix/log/'>log</a><a href='/guix/tree/?id=c20426ec5cdb846f1f1416942a055651a2a3cb65'>tree</a><a href='/guix/commit/?id=c20426ec5cdb846f1f1416942a055651a2a3cb65'>commit</a><a href='/guix/diff/?id=c20426ec5cdb846f1f1416942a055651a2a3cb65'>diff</a></td><td class='form'><form class='right' method='get' action='/guix/log/'>
<input type='hidden' name='id' value='c20426ec5cdb846f1f1416942a055651a2a3cb65'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='content'><div id='summary'><pre>
# GNU Guix --- Functional package management for GNU
# Copyright © 2012-2022 Ludovic Courtès &lt;ludo@gnu.org&gt;
# Copyright © 2013 Nikita Karetnikov &lt;nikita@karetnikov.org&gt;
# Copyright © 2022 Josselin Poiret &lt;dev@jpoiret.xyz&gt;
#
# 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 &lt;http://www.gnu.org/licenses/&gt;.

#
# Test the `guix package&apos; command-line utility.
#

guix package --version

readlink_base ()
{
    basename `readlink &quot;$1&quot;`
}

module_dir=&quot;t-guix-package-$$&quot;
profile=&quot;t-profile-$$&quot;
tmpfile=&quot;t-guix-package-file-$$&quot;
rm -f &quot;$profile&quot; &quot;$tmpfile&quot;

trap &apos;rm -f &quot;$profile&quot; &quot;$profile.lock&quot; &quot;$profile-&quot;[0-9]* &quot;$tmpfile&quot;; rm -rf &quot;$module_dir&quot; t-home-&apos;&quot;$$&quot; EXIT

# Use `-e&apos; with a non-package expression.
guix package --bootstrap -e + &amp;&amp; false

# Install a store item and make sure the version and output in the manifest
# are correct.
guix package --bootstrap -p &quot;$profile&quot; -i `guix build guile-bootstrap`
test &quot;`guix package -A guile-bootstrap | cut -f 1-2`&quot; \
     = &quot;`guix package -p &quot;$profile&quot; -I | cut -f 1-2`&quot;
test &quot;`guix package -p &quot;$profile&quot; -I | cut -f 3`&quot; = &quot;out&quot;
rm &quot;$profile&quot;

guix package --bootstrap -p &quot;$profile&quot; -i guile-bootstrap
test -L &quot;$profile&quot; &amp;&amp; test -L &quot;$profile-1-link&quot;
test -f &quot;$profile/bin/guile&quot;

# Make sure the profile is a GC root.
guix gc --list-live | grep &quot;`readlink &quot;$profile-1-link&quot;`&quot;

# Installing the same package a second time does nothing.
guix package --bootstrap -p &quot;$profile&quot; -i guile-bootstrap
test -L &quot;$profile&quot; &amp;&amp; test -L &quot;$profile-1-link&quot;
test ! -f &quot;$profile-2-link&quot;
test -f &quot;$profile/bin/guile&quot;

# Unsupported packages cannot be installed.
guix package -e &apos;(begin (use-modules (guix) (gnu packages base)) (package (inherit sed) (supported-systems (list))))&apos; -n &amp;&amp; false
case $(uname -m) in
    x86_64|i[3456]86)
	guix package -i novena-eeprom -n &amp;&amp; false
	break;;
    *)
	guix package -i intelmetool -n &amp;&amp; false
	break;;
esac

# Collisions are properly flagged (in this case, &apos;g-wrap&apos; propagates
# guile@2.2, which conflicts with guile@2.0.)
guix package --bootstrap -n -p &quot;$profile&quot; -i g-wrap guile@2.0 &amp;&amp; false

guix package --bootstrap -n -p &quot;$profile&quot; -i g-wrap guile@2.0 \
     --allow-collisions

# No search path env. var. here.
guix package -p &quot;$profile&quot; --search-paths
guix package -p &quot;$profile&quot; --search-paths | grep &apos;^export PATH=&apos;
test &quot;`guix package -p &quot;$profile&quot; --search-paths | wc -l`&quot; = 1  # $PATH
( set -e; set -x;						\
  eval `guix package --search-paths=prefix -p &quot;$PWD/$profile&quot;`;	\
  test &quot;`type -P guile`&quot; = &quot;$PWD/$profile/bin/guile&quot; ;		\
  type -P rm )

# Exit with 1 when a generation does not exist.
guix package -p &quot;$profile&quot; --delete-generations=42 &amp;&amp; false

# Exit with 0 when trying to delete the zeroth generation.
guix package -p &quot;$profile&quot; --delete-generations=0

# Make sure multiple arguments to -i works.
guix package --bootstrap -i guile zile -p &quot;$profile&quot; -n

# Make sure the `:&apos; syntax works.
guix package --bootstrap -i &quot;glibc:debug&quot; -p &quot;$profile&quot; -n

# Make sure nonexistent outputs are reported.
guix package --bootstrap -i &quot;guile-bootstrap:out&quot; -p &quot;$profile&quot; -n
guix package --bootstrap -i &quot;guile-bootstrap:does-not-exist&quot; -p &quot;$profile&quot; -n &amp;&amp; false
guix package --bootstrap -i &quot;guile-bootstrap:does-not-exist&quot; -p &quot;$profile&quot; &amp;&amp; false

# Make sure we get an error when trying to remove something that&apos;s not
# installed.
guix package --bootstrap -r something-not-installed -p &quot;$profile&quot; &amp;&amp; false

# Check whether `--list-available&apos; returns something sensible.
guix package -p &quot;$profile&quot; -A &apos;gui.*e&apos; | grep guile

# Check whether `--show&apos; returns something sensible.
guix package --show=guile | grep &quot;^name: guile&quot;

# Ensure `--show&apos; doesn&apos;t fail for packages with non-package inputs.
guix package --show=texlive

# Fail for non-existent packages or package/version pairs.
guix package --show=does-not-exist &amp;&amp; false
guix package --show=emacs@42 &amp;&amp; false

# Search.
LC_MESSAGES=C
export LC_MESSAGES
test &quot;`guix package -s &quot;An example GNU package&quot; | grep ^name:`&quot; = \
    &quot;name: hello&quot;
test -z &quot;`guix package -s &quot;n0t4r341p4ck4g3&quot;`&quot;

# Search with one and then two regexps.
# First we get printed circuit boards *and* board games.
guix package -s &apos;\&lt;board\&gt;&apos; &gt; &quot;$tmpfile&quot;
grep &apos;^name: pcb&apos; &quot;$tmpfile&quot;
grep &apos;^name: gnubg&apos; &quot;$tmpfile&quot;

# Second we get only board games.
guix package -s &apos;\&lt;board\&gt;&apos; -s game &gt; &quot;$tmpfile&quot;
grep -v &apos;^name: pcb&apos; &quot;$tmpfile&quot; &gt; /dev/null
grep &apos;^name: gnubg&apos; &quot;$tmpfile&quot;

rm -f &quot;$tmpfile&quot;

# Make sure deprecated packages don&apos;t show up: &lt;https://bugs.gnu.org/30566&gt;.
mkdir &quot;$module_dir&quot;
cat &gt; &quot;$module_dir/foo.scm&quot;&lt;&lt;EOF
(define-module (foo)
  #:use-module (guix packages)
  #:use-module (gnu packages base))

(define-public deprecated
  (deprecated-package &quot;fileutils-is-the-old-name&quot; coreutils))
EOF

guix build -L &quot;$module_dir&quot; -e &apos;(@ (foo) deprecated)&apos; -n
test &quot;`guix package -L &quot;$module_dir&quot; -s ^fileutils-is-the-old-name$ | grep ^name:`&quot; = &quot;&quot;

rm -rf &quot;$module_dir&quot;

# Make sure `--search&apos; can display all the packages.
guix package --search=&quot;&quot; &gt; /dev/null

# There&apos;s no generation older than 12 months, so the following command should
# have no effect.
generation=&quot;`readlink_base &quot;$profile&quot;`&quot;
guix package -p &quot;$profile&quot; --delete-generations=12m &amp;&amp; false
test &quot;`readlink_base &quot;$profile&quot;`&quot; = &quot;$generation&quot;

# The following command should not delete the current generation, even though
# it matches the given pattern (see &lt;http://bugs.gnu.org/19978&gt;.)  And since
# there&apos;s nothing else to delete, it should just fail.
guix package --list-generations -p &quot;$profile&quot;
guix package --bootstrap -p &quot;$profile&quot; --delete-generations=1.. &amp;&amp; false
test &quot;`readlink_base &quot;$profile&quot;`&quot; = &quot;$generation&quot;

# Make sure $profile is a GC root at this point.
real_profile=&quot;`readlink -f &quot;$profile&quot;`&quot;
guix gc -d &quot;$real_profile&quot; &amp;&amp; false
test -d &quot;$real_profile&quot;

# Now, let&apos;s remove all the symlinks to $real_profile, and make sure
# $real_profile is no longer a GC root.
rm &quot;$profile&quot; &quot;$profile&quot;-[0-9]-link
guix gc -d &quot;$real_profile&quot;
[ ! -d &quot;$real_profile&quot; ]

# Package transformations.

# Make sure we get the right version number when using &apos;--with-source&apos;.
mkdir &quot;$module_dir&quot;
emacs_tarball=&quot;$module_dir/emacs-42.5.9rc7.tar.gz&quot;
touch &quot;$emacs_tarball&quot;
guix package -p &quot;$profile&quot; -i emacs --with-source=&quot;$emacs_tarball&quot; -n \
     2&gt; &quot;$tmpfile&quot;
grep -E &apos;emacs[[:blank:]]+42\.5\.9rc7&apos; &quot;$tmpfile&quot;
rm &quot;$emacs_tarball&quot; &quot;$tmpfile&quot;
rmdir &quot;$module_dir&quot;

# Install with package transformations.
guix install --bootstrap -p &quot;$profile&quot; sed --with-input=sed=guile-bootstrap
grep &quot;sed=guile-bootstrap&quot; &quot;$profile/manifest&quot;
test &quot;$(readlink -f &quot;$profile/bin/guile&quot;)&quot; \
     = &quot;$(guix build guile-bootstrap)/bin/guile&quot;
test ! -f &quot;$profile/bin/sed&quot;

# Make sure the package transformation is preserved.
guix package --bootstrap -p &quot;$profile&quot; -u
grep &quot;sed=guile-bootstrap&quot; &quot;$profile/manifest&quot;
test &quot;$(readlink -f &quot;$profile/bin/guile&quot;)&quot; \
     = &quot;$(guix build guile-bootstrap)/bin/guile&quot;
test ! -f &quot;$profile/bin/sed&quot;
rm &quot;$profile&quot; &quot;$profile&quot;-[0-9]-link

# Make sure transformations apply to propagated inputs and don&apos;t lead to
# conflicts when installing them alongside, see
# &lt;https://issues.guix.gnu.org/55316&gt;.
mkdir &quot;$module_dir&quot;
cat &gt; &quot;$module_dir/test.scm&quot; &lt;&lt;EOF
(define-module (test)
  #:use-module (guix packages)
  #:use-module (gnu packages base)
  #:use-module (guix build-system trivial))

(define-public dummy-package
  (package
    (name &quot;dummy-package&quot;)
    (version &quot;1&quot;)
    (source #f)
    (build-system trivial-build-system)
    (propagated-inputs
     (list hello))
    (synopsis &quot;dummy&quot;)
    (description &quot;dummy&quot;)
    (home-page &quot;dummy&quot;)
    (license #f)))
EOF
guix package -p &quot;$profile&quot; -L &quot;$module_dir&quot;\
     -i hello dummy-package \
     --without-tests=hello -n
rm &quot;$module_dir/test.scm&quot;
rmdir &quot;$module_dir&quot;

# Profiles with a relative file name.  Make sure we don&apos;t create dangling
# symlinks--see bug report at
# &lt;https://lists.gnu.org/archive/html/guix-devel/2018-07/msg00036.html&gt;.
mkdir -p &quot;$module_dir/foo&quot;
( cd &quot;$module_dir&quot; ;						\
  guix package --bootstrap -i guile-bootstrap -p foo/prof )
test -f &quot;$module_dir/foo/prof/bin/guile&quot;
rm &quot;$module_dir/foo&quot;/*
rmdir &quot;$module_dir/foo&quot;
rmdir &quot;$module_dir&quot;

#
# Try with the default profile.
#

XDG_CACHE_HOME=&quot;${XDG_CACHE_HOME:-$HOME/.cache}&quot;
export XDG_CACHE_HOME
HOME=&quot;$PWD/t-home-$$&quot;
export HOME

mkdir -p &quot;$HOME&quot;

# Get the canonical directory name so that &apos;guix package&apos; recognizes it.
HOME=&quot;`cd $HOME; pwd -P`&quot;

guix package --bootstrap -i guile-bootstrap
test -L &quot;$HOME/.guix-profile&quot;
test -f &quot;$HOME/.guix-profile/bin/guile&quot;

# Move to the empty profile.
default_profile=&quot;`readlink &quot;$HOME/.guix-profile&quot;`&quot;
for i in `seq 1 3`
do
    # Make sure the current generation is a GC root.
    profile_link=&quot;`readlink &quot;$default_profile&quot;`&quot;
    guix gc --list-live | grep &quot;`readlink &quot;$profile_link&quot;`&quot;

    guix package --bootstrap --roll-back
    test ! -f &quot;$HOME/.guix-profile/bin&quot;
    test ! -f &quot;$HOME/.guix-profile/lib&quot;
    test &quot;`readlink &quot;$default_profile&quot;`&quot; = &quot;`basename $default_profile-0-link`&quot;
done

# Check whether &apos;-p ~/.guix-profile&apos; makes any difference.
# See &lt;http://bugs.gnu.org/17939&gt;.
test ! -e &quot;$HOME/.guix-profile-0-link&quot;
test ! -e &quot;$HOME/.guix-profile-1-link&quot;
guix package --bootstrap -p &quot;$HOME/.guix-profile&quot; -i guile-bootstrap
test ! -e &quot;$HOME/.guix-profile-1-link&quot;
guix package --bootstrap --roll-back -p &quot;$HOME/.guix-profile&quot;
test ! -e &quot;$HOME/.guix-profile-0-link&quot;

# Extraneous argument.
guix package install foo-bar &amp;&amp; false

# Make sure the &quot;broken pipe&quot; doesn&apos;t yield an error.
# Note: &apos;pipefail&apos; is a Bash-specific option.
set -o pipefail || true
guix package -A g | head -1 2&gt; &quot;$HOME/err1&quot;
guix package -I | head -1 2&gt; &quot;$HOME/err2&quot;
test &quot;`cat &quot;$HOME/err1&quot; &quot;$HOME/err2&quot;`&quot; = &quot;&quot;

# Make sure &apos;-L&apos; extends the package module search path.
mkdir &quot;$module_dir&quot;

cat &gt; &quot;$module_dir/foo.scm&quot;&lt;&lt;EOF
(define-module (foo)
  #:use-module (guix packages)
  #:use-module (gnu packages emacs))

(define-public x
  (package (inherit emacs)
    (name &quot;emacs-foo-bar&quot;)
    (version &quot;42.77.0&quot;)))
EOF

guix package -A emacs-foo-bar -L &quot;$module_dir&quot; | grep 42
guix package -i emacs-foo-bar@42 -n -L &quot;$module_dir&quot;

# Same thing using the &apos;GUIX_PACKAGE_PATH&apos; environment variable.
GUIX_PACKAGE_PATH=&quot;$module_dir&quot;
export GUIX_PACKAGE_PATH
guix package -A emacs-foo-bar | grep 42
guix package -i emacs-foo-bar@42 -n

# Make sure GUIX_PACKAGE_PATH/&apos;-L&apos; takes precedence in case of duplicate packages.
cat &gt; &quot;$module_dir/bar.scm&quot;&lt;&lt;EOF
(define-module (bar)
  #:use-module (guix packages))

(define-public hello
  (package (inherit (@@ (gnu packages base) hello))
    (synopsis &quot;an overridden version of GNU hello&quot;)))
EOF

guix package -i hello -n 2&gt;&amp;1 | grep choosing.*bar.scm
( unset GUIX_PACKAGE_PATH; \
  guix package -i hello -n -L &quot;$module_dir&quot; 2&gt;&amp;1 | grep choosing.*bar.scm )

# Make sure patches that live under $GUIX_PACKAGE_PATH are found.
cat &gt; &quot;$module_dir/emacs.patch&quot;&lt;&lt;EOF
This is a fake patch.
EOF
cat &gt; &quot;$module_dir/foo.scm&quot;&lt;&lt;EOF
(define-module (foo)
  #:use-module (guix packages)
  #:use-module (gnu packages)
  #:use-module (gnu packages emacs))

(define-public x
  (package (inherit emacs)
    (source (origin (inherit (package-source emacs))
              (patches (list (search-patch &quot;emacs.patch&quot;)))))
    (name &quot;emacs-foo-bar-patched&quot;)
    (version &quot;42.42.42&quot;)))

(define-public y
  (package (inherit emacs)
    (name &quot;super-non-portable-emacs&quot;)
    (supported-systems &apos;(&quot;foobar64-hurd&quot;))))
EOF
guix package -i emacs-foo-bar-patched -n

# Same when -L is used.
( unset GUIX_PACKAGE_PATH;					\
  guix package -L &quot;$module_dir&quot; -i emacs-foo-bar-patched -n )

# Make sure installing from a file works.
cat &gt; &quot;$module_dir/package.scm&quot;&lt;&lt;EOF
(use-modules (gnu))
(use-package-modules bootstrap)

%bootstrap-guile
EOF
guix package --bootstrap --install-from-file=&quot;$module_dir/package.scm&quot;

# Make sure an error is raised if the file doesn&apos;t return a package.
cat &gt; &quot;$module_dir/package.scm&quot;&lt;&lt;EOF
(use-modules (gnu packages base))

(define my-package coreutils)   ;returns *unspecified*
EOF
guix package --bootstrap --install-from-file=&quot;$module_dir/package.scm&quot; &amp;&amp; false

rm &quot;$module_dir/package.scm&quot;

# This one should not show up in searches since it&apos;s no supported on the
# current system.
test &quot;`guix package -A super-non-portable-emacs`&quot; = &quot;&quot;
test &quot;`guix package -s super-non-portable-emacs | grep ^systems:`&quot; = &quot;systems: &quot;

# Don&apos;t upgrade packages marked for removal: &lt;http://bugs.gnu.org/27262&gt;.
guix package --bootstrap -p &quot;$profile&quot; -i guile-bootstrap

cat &gt; &quot;$module_dir/foo.scm&quot;&lt;&lt;EOF
(define-module (foo)
  #:use-module (guix)
  #:use-module (gnu packages bootstrap))

(define-public x
  (package (inherit %bootstrap-guile) (version &quot;42&quot;)))
EOF

guix package --bootstrap -p &quot;$profile&quot; -r guile-bootstrap -u guile
test ! -f &quot;$profile/bin/guile&quot;
guix package --bootstrap -p &quot;$profile&quot; --roll-back
test -f &quot;$profile/bin/guile&quot;
rm &quot;$profile-2-link&quot;

unset GUIX_PACKAGE_PATH


# Using &apos;GUIX_BUILD_OPTIONS&apos;.
available=&quot;`guix package -A | sort`&quot;
GUIX_BUILD_OPTIONS=&quot;--dry-run --no-grafts&quot;
export GUIX_BUILD_OPTIONS

# Make sure $GUIX_BUILD_OPTIONS is not simply appended to the command-line,
# which would break &apos;guix package -A&apos; and similar.
available2=&quot;`guix package -A | sort`&quot;
test &quot;$available2&quot; = &quot;$available&quot;
guix package -I

# Restore &apos;--no-grafts&apos;, which makes sure we don&apos;t end up building stuff when
# &apos;--dry-run&apos; is passed.
GUIX_BUILD_OPTIONS=&quot;--no-grafts&quot;

# Install using the &quot;imperative model&quot;, export a manifest, instantiate it, and
# make sure we get the same profile.
guix package --bootstrap -i guile-bootstrap --without-tests=foo
profile_directory=&quot;$(readlink -f &quot;$default_profile&quot;)&quot;
guix package --export-manifest &gt; &quot;$tmpfile&quot;
grep &apos;without-tests.*foo&apos; &quot;$tmpfile&quot;
guix package --rollback --bootstrap
guix package --bootstrap -m &quot;$tmpfile&quot;
test &quot;$(readlink -f &quot;$default_profile&quot;)&quot; = &quot;$profile_directory&quot;
guix package --export-manifest &gt; &quot;$tmpfile.2nd&quot;
cmp &quot;$tmpfile&quot; &quot;$tmpfile.2nd&quot;

rm -f &quot;$tmpfile.2nd&quot;
guix package --rollback --bootstrap

# Applying a manifest file.
cat &gt; &quot;$module_dir/manifest.scm&quot;&lt;&lt;EOF
(use-package-modules bootstrap)

(packages-&gt;manifest (list %bootstrap-guile))
EOF
guix package --bootstrap -m &quot;$module_dir/manifest.scm&quot;
guix package -I | grep guile
test `guix package -I | wc -l` -eq 1

# Export a manifest, instantiate it, and make sure we get the same profile.
profile_directory=&quot;$(readlink -f &quot;$default_profile&quot;)&quot;
guix package --export-manifest &gt; &quot;$tmpfile&quot;
guix package --rollback --bootstrap
guix package --bootstrap -m &quot;$tmpfile&quot;
test &quot;$(readlink -f &quot;$default_profile&quot;)&quot; = &quot;$profile_directory&quot;

guix package --rollback --bootstrap

# Applying two manifests.
cat &gt; &quot;$module_dir/manifest2.scm&quot;&lt;&lt;EOF
(use-modules (gnu packages bootstrap) (guix))
(define p (package (inherit %bootstrap-guile) (name &quot;eliug&quot;)))
(packages-&gt;manifest (list p))
EOF
guix package --bootstrap \
     -m &quot;$module_dir/manifest.scm&quot; -m &quot;$module_dir/manifest2.scm&quot;
guix package -I | grep guile
guix package -I | grep eliug
test `guix package -I | wc -l` -eq 2
guix package --rollback --bootstrap

# Applying a manifest file with inferior packages.
cat &gt; &quot;$module_dir/manifest.scm&quot;&lt;&lt;EOF
(use-modules (guix inferior))

(define i
  (open-inferior &quot;$abs_top_srcdir&quot; #:command &quot;scripts/guix&quot;))

(let ((guile (car (lookup-inferior-packages i &quot;guile-bootstrap&quot;))))
  (packages-&gt;manifest (list guile)))
EOF
guix package --bootstrap -m &quot;$module_dir/manifest.scm&quot;
guix package -I | grep guile
test `guix package -I | wc -l` -eq 1

# Error reporting.
cat &gt; &quot;$module_dir/manifest.scm&quot;&lt;&lt;EOF
(use-package-modules bootstrap)
(packages-&gt;manifest
  (list %bootstrap-guile
        wonderful-package-that-does-not-exist))
EOF
if guix package --bootstrap -n -m &quot;$module_dir/manifest.scm&quot; \
	2&gt; &quot;$module_dir/stderr&quot;
then false
else
    cat &quot;$module_dir/stderr&quot;
    grep &quot;manifest.scm:[1-4]:.*wonderful-package.*: unbound variable&quot; \
	 &quot;$module_dir/stderr&quot;
fi

# Verify that package outputs are included in search results.
rm -rf &quot;$module_dir&quot;
mkdir &quot;$module_dir&quot;
cat &gt; &quot;$module_dir/foo.scm&quot;&lt;&lt;EOF
(define-module (foo)
  #:use-module (guix packages)
  #:use-module (guix build-system trivial))

(define-public dummy-package
  (package
    (name &quot;dummy-package&quot;)
    (version &quot;dummy-version&quot;)
    (outputs &apos;(&quot;out&quot; &quot;dummy-output&quot;))
    (source #f)
    ;; Without a real build system, the &quot;guix package -s&quot; command will fail.
    (build-system trivial-build-system)
    (synopsis &quot;dummy-synopsis&quot;)
    (description &quot;dummy-description&quot;)
    (home-page &quot;https://dummy-home-page&quot;)
    (license #f)))
EOF
guix package -L &quot;$module_dir&quot; -s dummy-output &gt; /tmp/out
test &quot;`guix package -L &quot;$module_dir&quot; -s dummy-output | grep ^name:`&quot; = &quot;name: dummy-package&quot;
rm -rf &quot;$module_dir&quot;

# Make sure we can see user profiles.
guix package --list-profiles | grep &quot;$profile&quot;
guix package --list-profiles | grep &apos;\.guix-profile&apos;

# Make sure we can properly lock a profile.
mkdir &quot;$module_dir&quot;
echo &quot;(open-output-file \&quot;$module_dir/ready\&quot;) (sleep 60)&quot; \
     &gt; &quot;$module_dir/manifest.scm&quot;
guix package -m &quot;$module_dir/manifest.scm&quot; -p &quot;$module_dir/profile&quot; &amp;
pid=$!
while [ ! -f &quot;$module_dir/ready&quot; ] ; do sleep 0.5 ; done
if guix install emacs -p &quot;$module_dir/profile&quot;; then kill $pid; false; else true; fi
kill $pid
</pre>
</div></div> <!-- class=content -->
                         <div class=footer>generated by
                             <a href="https://git.zx2c4.com/cgit/about/">
                                 cgit
                             </a>
                         </div>
                        </div> <!-- id=cgit -->
</body>
</html>
