Last-Modified: Fri, 08 Nov 2024 09:44:09 GMT
Expires: Fri, 08 Nov 2024 09:59:09 GMT

<!DOCTYPE html>
<html lang='en'>
<head>
<title>guix - Wojtek's customized Guix</title>
<meta name='generator' content='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='af5ead8b346f11105c964726101618116af13426'/><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=14bb1c4842eafdba9e646573101cb2335490ee01'>refs</a><a href='/guix/log/'>log</a><a href='/guix/tree/?id=14bb1c4842eafdba9e646573101cb2335490ee01'>tree</a><a href='/guix/commit/?id=14bb1c4842eafdba9e646573101cb2335490ee01'>commit</a><a href='/guix/diff/?id=14bb1c4842eafdba9e646573101cb2335490ee01'>diff</a></td><td class='form'><form class='right' method='get' action='/guix/log/'>
<input type='hidden' name='id' value='14bb1c4842eafdba9e646573101cb2335490ee01'/><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>
#!/bin/sh

# GNU Guix --- Functional package management for GNU
# Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021 Ludovic Courtès &lt;ludo@gnu.org&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;.

# Usage: ./test-env COMMAND ARG...
#
# Run the daemon in the build directory, and run COMMAND within
# `pre-inst-env&apos;.  This is used to run unit tests with the just-built
# daemon, unless `--disable-daemon&apos; was passed at configure time.


# Make sure &apos;cd&apos; behaves deterministically and doesn&apos;t write anything to
# stdout.
unset CDPATH

case &quot;$1&quot; in
    --quiet-stderr)
	# Silence the daemon&apos;s output, which is often useless, as well as that
	# of Bash (such as &quot;Terminated&quot; messages when &apos;guix-daemon&apos; is
	# killed.)
	exec 2&gt; /dev/null
	shift
	;;
esac

if [ -x &quot;@abs_top_builddir@/guix-daemon&quot; ]
then
    NIX_STORE_DIR=&quot;@GUIX_TEST_ROOT@/store&quot;

    # Do that because store.scm calls `canonicalize-path&apos; on it.
    mkdir -p &quot;$NIX_STORE_DIR&quot;

    # Canonicalize the store directory name in an attempt to avoid symlinks in
    # it or its parent directories.  See &lt;http://bugs.gnu.org/17935&gt;.
    NIX_STORE_DIR=&quot;`cd &quot;@GUIX_TEST_ROOT@/store&quot;; pwd -P`&quot;

    GUIX_LOG_DIRECTORY=&quot;@GUIX_TEST_ROOT@/var/log/guix&quot;
    GUIX_DATABASE_DIRECTORY=&quot;@GUIX_TEST_ROOT@/db&quot;

    # Choose a PID-dependent name to allow for parallel builds.  Note
    # that the directory name must be chosen so that the socket&apos;s file
    # name is less than 108-char long (the size of `sun_path&apos; in glibc).
    # Currently, in Nix builds, we&apos;re at ~106 chars...
    GUIX_STATE_DIRECTORY=&quot;@GUIX_TEST_ROOT@/var/$$&quot;

    # We can&apos;t exit when we reach the limit, because perhaps the test doesn&apos;t
    # actually rely on the daemon, but at least warn.
    if test &quot;`echo -n &quot;$GUIX_STATE_DIRECTORY/daemon-socket/socket&quot; | wc -c`&quot; -ge 108
    then
	echo &quot;warning: exceeding socket file name limit; test may fail!&quot; &gt;&amp;2
    fi

    # The configuration directory, for import/export signing keys.
    GUIX_CONFIGURATION_DIRECTORY=&quot;@GUIX_TEST_ROOT@/etc&quot;
    if [ ! -d &quot;$GUIX_CONFIGURATION_DIRECTORY&quot; ]
    then
	# Copy the keys so that the secret key has the right permissions (the
	# daemon errors out when this is not the case.)
	mkdir -p &quot;$GUIX_CONFIGURATION_DIRECTORY&quot;
	cp &quot;@abs_top_srcdir@/tests/keys/signing-key.sec&quot;	\
	   &quot;@abs_top_srcdir@/tests/keys/signing-key.pub&quot;	\
	   &quot;$GUIX_CONFIGURATION_DIRECTORY&quot;
	chmod 400 &quot;$GUIX_CONFIGURATION_DIRECTORY/signing-key.sec&quot;
    fi

    # A place to store data of the substituter.
    GUIX_BINARY_SUBSTITUTE_URL=&quot;file://$GUIX_STATE_DIRECTORY/substituter-data&quot;
    rm -rf &quot;$GUIX_STATE_DIRECTORY/substituter-data&quot;
    mkdir -p &quot;$GUIX_STATE_DIRECTORY/substituter-data&quot;

    # For a number of tests, we want to allow unsigned narinfos, for
    # simplicity.
    GUIX_ALLOW_UNAUTHENTICATED_SUBSTITUTES=yes

    # Place for the substituter&apos;s cache.
    XDG_CACHE_HOME=&quot;$GUIX_STATE_DIRECTORY/cache-$$&quot;

    export NIX_IGNORE_SYMLINK_STORE NIX_STORE_DIR		\
	GUIX_LOG_DIRECTORY GUIX_STATE_DIRECTORY GUIX_DATABASE_DIRECTORY	\
	GUIX_BINARY_SUBSTITUTE_URL				\
        GUIX_ALLOW_UNAUTHENTICATED_SUBSTITUTES			\
        GUIX_CONFIGURATION_DIRECTORY XDG_CACHE_HOME

    # Launch the daemon without chroot support because is may be
    # unavailable, for instance if we&apos;re not running as root.
    &quot;@abs_top_builddir@/pre-inst-env&quot;				\
	&quot;@abs_top_builddir@/guix-daemon&quot; --disable-chroot	\
	--substitute-urls=&quot;$GUIX_BINARY_SUBSTITUTE_URL&quot; &amp;

    daemon_pid=$!
    trap &quot;kill $daemon_pid ; rm -rf $GUIX_STATE_DIRECTORY&quot; EXIT

    # The test suite expects the &apos;guile-bootstrap&apos; package to be available.
    # Normally the Guile bootstrap tarball is downloaded by a fixed-output
    # derivation but when network access is missing we allow users to drop
    # the tarball in &apos;gnu/packages/bootstrap/SYSTEM&apos; and &quot;intern&quot; it here.
    bootstrap_directory=&quot;@abs_top_builddir@/gnu/packages/bootstrap/@guix_system@&quot;
    if [ -d &quot;$bootstrap_directory&quot; ]
    then
	# Make sure &apos;guix-daemon&apos; is listening before invoking &apos;guix
	# download&apos;.
	&quot;@abs_top_builddir@/pre-inst-env&quot; &quot;@GUILE@&quot; -c \
	     &apos;(use-modules (guix))
(let loop ((i 10))
  (catch #t
    (lambda () (open-connection))
    (lambda (key . args)
      (if (zero? i)
          (apply throw key args)
          (begin (usleep 500000) (loop (- i 1)))))))&apos;

	for file in &quot;$bootstrap_directory&quot;/guile-*
	do
	    [ -f &quot;$file&quot; ] &amp;&amp;					\
	    &quot;@abs_top_builddir@/pre-inst-env&quot;			\
		guix download &quot;file://$file&quot; &gt; /dev/null
	done
    fi
fi

# Avoid issues that could stem from l10n, such as language/encoding
# mismatches.
unset LANGUAGE
LC_MESSAGES=C
export LC_MESSAGES

# Disable grafts by default because they can cause things to be built
# regardless of &apos;--dry-run&apos;.
GUIX_BUILD_OPTIONS=&quot;--no-grafts&quot;
export GUIX_BUILD_OPTIONS

# Ignore user settings.
unset GUIX_PACKAGE_PATH

storedir=&quot;@storedir@&quot;
prefix=&quot;@prefix@&quot;
datarootdir=&quot;@datarootdir@&quot;
datadir=&quot;@datadir@&quot;
localstatedir=&quot;@localstatedir@&quot;
export storedir prefix datarootdir datadir localstatedir

&quot;@abs_top_builddir@/pre-inst-env&quot; &quot;$@&quot;
exit $?
</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>
