Content-Security-Policy: default-src 'none'
Content-Type: text/plain; charset=UTF-8
Content-Length: 3942
Content-Disposition: inline; filename="hurd.scm"
Last-Modified: Tue, 07 Jan 2025 20:08:51 GMT
Expires: Fri, 05 Jan 2035 20:08:51 GMT
ETag: "5cf37adeaf5d08e525b89e404cf6e83d3c4fc7fc"

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@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/>.

(define-module (gnu services hurd)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages hurd)
  #:use-module (gnu services)
  #:use-module (gnu services shepherd)
  #:use-module </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=8463cc2efb1bafd2a56abf237b51dce7d875c7fe'>refs</a><a href='/guix/log/'>log</a><a href='/guix/tree/?id=8463cc2efb1bafd2a56abf237b51dce7d875c7fe'>tree</a><a href='/guix/commit/?id=8463cc2efb1bafd2a56abf237b51dce7d875c7fe'>commit</a><a href='/guix/diff/?id=8463cc2efb1bafd2a56abf237b51dce7d875c7fe'>diff</a></td><td class='form'><form class='right' method='get' action='/guix/log/'>
<input type='hidden' name='id' value='8463cc2efb1bafd2a56abf237b51dce7d875c7fe'/><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, 2014, 2015, 2016, 2017, 2018, 2019 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;.

#
# Test the daemon and its interaction with &apos;guix substitute&apos;.
#

set -e

guix-daemon --version
guix build --version

drv=&quot;`guix build emacs -d`&quot;
out=&quot;`guile -c &apos;								\
  (use-modules (guix) (gnu packages emacs))					\
  (define store (open-connection))						\
  (%graft? #f)
  (display (derivation-&gt;output-path (package-derivation store emacs)))&apos;`&quot;

hash_part=&quot;`basename $out | cut -c 1-32`&quot;
narinfo=&quot;$hash_part.narinfo&quot;
substitute_dir=&quot;`echo $GUIX_BINARY_SUBSTITUTE_URL | sed -&apos;es,file://,,g&apos;`&quot;

cat &gt; &quot;$substitute_dir/nix-cache-info&quot;&lt;&lt;EOF
StoreDir: `dirname $drv`
WantMassQuery: 0
EOF

cat &gt; &quot;$substitute_dir/$narinfo&quot;&lt;&lt;EOF
StorePath: $out
URL: /nowhere/example.nar
Compression: none
NarSize: 1234
References: 
System: `guile -c &apos;(use-modules (guix)) (display (%current-system))&apos;`
Deriver: $drv
EOF

# Remove the cached narinfo.
rm -f &quot;$XDG_CACHE_HOME/guix/substitute/$hash_part&quot;

# Make sure we see the substitute.
guile -c &quot;
  (use-modules (guix))
  (define store (open-connection))
  (set-build-options store #:use-substitutes? #t
                     #:substitute-urls (list \&quot;$GUIX_BINARY_SUBSTITUTE_URL\&quot;))
  (exit (has-substitutes? store \&quot;$out\&quot;))&quot;

# Now, run guix-daemon --no-substitutes.
socket=&quot;$GUIX_STATE_DIRECTORY/alternate-socket&quot;
guix-daemon --no-substitutes --listen=&quot;$socket&quot; --disable-chroot &amp;
daemon_pid=$!
trap &apos;kill $daemon_pid&apos; EXIT

# Make sure we DON&apos;T see the substitute.
guile -c &quot;
  (use-modules (guix))
  (define store (open-connection \&quot;$socket\&quot;))

  ;; This setting MUST NOT override the daemon&apos;s --no-substitutes.
  (set-build-options store #:use-substitutes? #t
                     #:substitute-urls (list \&quot;$GUIX_BINARY_SUBSTITUTE_URL\&quot;))

  (exit (not (has-substitutes? store \&quot;$out\&quot;)))&quot;

kill &quot;$daemon_pid&quot;

# Pass several &apos;--listen&apos; options, and make sure they are all honored.
guix-daemon --disable-chroot --listen=&quot;$socket&quot; --listen=&quot;$socket-second&quot; \
	    --listen=&quot;localhost&quot; --listen=&quot;localhost:9876&quot; &amp;
daemon_pid=$!

for uri in &quot;$socket&quot; &quot;$socket-second&quot; \
		     &quot;guix://localhost&quot; &quot;guix://localhost:9876&quot;
do
    GUIX_DAEMON_SOCKET=&quot;$uri&quot; guix build guile-bootstrap
done

kill &quot;$daemon_pid&quot;

# Make sure &apos;profiles/per-user&apos; is created when connecting over TCP.

orig_GUIX_STATE_DIRECTORY=&quot;$GUIX_STATE_DIRECTORY&quot;
GUIX_STATE_DIRECTORY=&quot;$GUIX_STATE_DIRECTORY-2&quot;

guix-daemon --disable-chroot --listen=&quot;localhost:9877&quot; &amp;
daemon_pid=$!

GUIX_DAEMON_SOCKET=&quot;guix://localhost:9877&quot;
export GUIX_DAEMON_SOCKET

test ! -d &quot;$GUIX_STATE_DIRECTORY/profiles/per-user&quot;

guix build guile-bootstrap -d

test -d &quot;$GUIX_STATE_DIRECTORY/profiles/per-user/$USER&quot;

kill &quot;$daemon_pid&quot;
unset GUIX_DAEMON_SOCKET
GUIX_STATE_DIRECTORY=&quot;$orig_GUIX_STATE_DIRECTORY&quot;

# Check the failed build cache.

guix-daemon --no-substitutes --listen=&quot;$socket&quot; --disable-chroot	\
  --cache-failures &amp;
daemon_pid=$!

guile -c &quot;
  (use-modules (guix) (guix tests) (srfi srfi-34))
  (define store (open-connection-for-tests \&quot;$socket\&quot;))

  ;; Disable grafts to avoid building more than needed.
  (%graft? #f)

  (define (build-without-failing drv)
    (lambda (store)
      (guard (c ((store-protocol-error? c) (values #t store)))
        (build-derivations store (list drv))
        (values #f store))))

  ;; Make sure failed builds are cached and can be removed from
  ;; the cache.
  (run-with-store store
    (mlet* %store-monad ((drv (gexp-&gt;derivation \&quot;failure\&quot;
                                                #~(begin
                                                    (ungexp output)
                                                     #f)))
                         (out -&gt; (derivation-&gt;output-path drv))
                         (ok?    (build-without-failing drv)))
      ;; Note the mixture of monadic and direct style.  Don&apos;t try
      ;; this at home!
      (return (exit (and ok?
                         (equal? (query-failed-paths store) (list out))
                         (begin
                           (clear-failed-paths store (list out))
                           (null? (query-failed-paths store)))))))
    #:guile-for-build (%guile-for-build)) &quot;

kill &quot;$daemon_pid&quot;


# Make sure the daemon&apos;s default &apos;build-cores&apos; setting is honored.

guix-daemon --listen=&quot;$socket&quot; --disable-chroot --cores=42 &amp;
daemon_pid=$!

GUIX_DAEMON_SOCKET=&quot;$socket&quot; \
guile -c &apos;
  (use-modules (guix) (guix tests))

  (with-store store
    (let* ((build  (add-text-to-store store &quot;build.sh&quot;
                                      &quot;echo $NIX_BUILD_CORES &gt; $out&quot;))
           (bash   (add-to-store store &quot;bash&quot; #t &quot;sha256&quot;
                                 (search-bootstrap-binary &quot;bash&quot;
                                                          (%current-system))))
           (drv    (derivation store &quot;the-thing&quot; bash
                               `(&quot;-e&quot; ,build)
                               #:inputs `((,bash) (,build))
                               #:env-vars `((&quot;x&quot; . ,(random-text))))))
      (and (build-derivations store (list drv))
           (exit
            (= 42 (pk (call-with-input-file (derivation-&gt;output-path drv)
                        read)))))))&apos;


kill &quot;$daemon_pid&quot;

# Make sure the daemon&apos;s default &apos;timeout&apos; and &apos;max-silent-time&apos; settings are
# honored.

client_code=&apos;
  (use-modules (guix) (guix tests) (srfi srfi-34))

  (with-store store
    (let* ((build  (add-text-to-store store &quot;build.sh&quot;
                                      &quot;while true ; do : ; done&quot;))
           (bash   (add-to-store store &quot;bash&quot; #t &quot;sha256&quot;
                                 (search-bootstrap-binary &quot;bash&quot;
                                                          (%current-system))))
           (drv    (derivation store &quot;the-thing&quot; bash
                               `(&quot;-e&quot; ,build)
                               #:inputs `((,bash) (,build))
                               #:env-vars `((&quot;x&quot; . ,(random-text))))))
      (exit (guard (c ((store-protocol-error? c)
                       (-&gt;bool
                        (string-contains (pk (store-protocol-error-message c))
                                         &quot;failed&quot;))))
              (build-derivations store (list drv))
              #f))))&apos;


for option in --max-silent-time=1 --timeout=1
do
    guix-daemon --listen=&quot;$socket&quot; --disable-chroot &quot;$option&quot; &amp;
    daemon_pid=$!

    GUIX_DAEMON_SOCKET=&quot;$socket&quot; guile -c &quot;$client_code&quot;
    kill &quot;$daemon_pid&quot;
done

# Make sure garbage collection from a TCP connection does not work.

tcp_socket=&quot;127.0.0.1:9998&quot;
guix-daemon --listen=&quot;$tcp_socket&quot; &amp;
daemon_pid=$!

GUIX_DAEMON_SOCKET=&quot;guix://$tcp_socket&quot;
export GUIX_DAEMON_SOCKET

guix gc &amp;&amp; false

unset GUIX_DAEMON_SOCKET
kill &quot;$daemon_pid&quot;

# Log compression.

guix-daemon --listen=&quot;$socket&quot; --disable-chroot --debug --log-compression=gzip &amp;
daemon_pid=$!

stamp=&quot;compressed-build-log-test-$$-`date +%H%M%S`&quot;
client_code=&quot;
  (use-modules (guix) (gnu packages bootstrap))

  (with-store store
    (run-with-store store
      (mlet %store-monad ((drv (lower-object
				(computed-file \&quot;compressed-log-test\&quot;
					       #~(begin
						   (display \&quot;$stamp\&quot;)
                                                   (newline)
						   (mkdir #\$output))
					       #:guile %bootstrap-guile))))
	(display (derivation-file-name drv))
	(newline)
	(return #t))))
&quot;

GUIX_DAEMON_SOCKET=&quot;$socket&quot;
export GUIX_DAEMON_SOCKET

drv=`guile -c &quot;$client_code&quot;`
guix build &quot;$drv&quot;

log=`guix build &quot;$drv&quot; --log-file`
test -f &quot;$log&quot;
case &quot;$log&quot; in
    *.gz) test &quot;`gunzip -c &lt; &quot;$log&quot;`&quot; = &quot;$stamp&quot; ;;
    *)    false ;;
esac
</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>
oc/guix-cookbook.texi?id=39f88ee29faa98d0b9b9761f2db8dc7721200fe5'>doc: cookbook: Fix commands in example.</a><span class='msg-avail'>...<span class='msg-tooltip'>Fixes &lt;https://issues.guix.gnu.org/59463&gt;.
Reported by Luca Cirrottola &lt;luca.cirrottola@inria.fr&gt;.

* doc/guix-cookbook.texi (Reproducible profiles): Make it work.
</span></span></td><td>Florian Pelz</td></tr>
<tr><td><span title='2022-11-24 20:51:30 -0500'>2022-11-24</span></td><td><a href='/guix/commit/doc/guix-cookbook.texi?id=d524ec6fb595adbd33d3efda562041bb59d7505a'>doc: Add a security keys section to the cookbook.</a><span class='msg-avail'>...<span class='msg-tooltip'>* doc/guix-cookbook.texi (Top): Register new menu.
(System Configuration): Likewise.
(Using security keys): New section.
</span></span></td><td>Maxim Cournoyer</td></tr>
<tr><td><span title='2022-11-06 00:35:56 +0100'>2022-11-06</span></td><td><a href='/guix/commit/doc/guix-cookbook.texi?id=b43200e5b1f942ed0caf3fa006e9d76c63d7a6cc'>doc: cookbook: Add section on MPD with bluealsa.</a><span class='msg-avail'>...<span class='msg-tooltip'>* doc/guix-cookbook.texi (Music Server with Bluetooth Audio): New section
under System Configuration.
</span></span></td><td>Ricardo Wurmus</td></tr>
<tr><td><span title='2022-11-06 00:35:56 +0100'>2022-11-06</span></td><td><a href='/guix/commit/doc/guix-cookbook.texi?id=769c5f563d808aad6c0a6d34aac25373149841b1'>doc: cookbook: Update detailed menu for "System Configuration".</a><span class='msg-avail'>...<span class='msg-tooltip'>* doc/guix-cookbook.texi: Update menu.
</span></span></td><td>Ricardo Wurmus</td></tr>
<tr><td><span title='2022-10-13 17:42:05 +0200'>2022-10-13</span></td><td><a href='/guix/commit/doc/guix-cookbook.texi?id=56915dc275994336efd15199769d78ae295e2339'>doc: Add chapter on containers to Cookbook.</a><span class='msg-avail'>...<span class='msg-tooltip'>* doc/guix-cookbook.texi (Containers): New chapter.
</span></span></td><td>Ricardo Wurmus</td></tr>
<tr><td><span title='2022-07-08 17:28:50 +0200'>2022-07-08</span></td><td><a href='/guix/commit/doc/guix-cookbook.texi?id=9100acb6fb6687f197e557bcf16c465ba97e4fdb'>doc: cookbook: Link to "A Scheme Primer".</a><span class='msg-avail'>...<span class='msg-tooltip'>* doc/guix-cookbook.texi (A Scheme Crash Course): Link to "A Scheme
Primer".  Group references in @quotation for clarity.
</span></span></td><td>Ludovic Courtès</td></tr>
<tr><td><span title='2022-07-08 17:28:50 +0200'>2022-07-08</span></td><td><a href='/guix/commit/doc/guix-cookbook.texi?id=da7bee91fa8ec76e647eb1f2c488a5bc41b0ecba'>doc: cookbook: Suggest 'guix shell'.</a><span class='msg-avail'>...<span class='msg-tooltip'>* doc/guix-cookbook.texi (A Scheme Crash Course): Suggest 'guix shell'
instead of 'guix environment'.
(Customizing the Kernel, The benefits of manifests): Likewise.
</span></span></td><td>Ludovic Courtès</td></tr>
<tr><td><span title='2022-06-01 23:28:20 +0200'>2022-06-01</span></td><td><a href='/guix/commit/doc/guix-cookbook.texi?id=582b4bb4ce8239b321af8b75e866992aff16b8a9'>doc: cookbook: Refer to the "Writing Manifests" manual node.</a><span class='msg-avail'>...<span class='msg-tooltip'>* doc/guix-cookbook.texi (Basic setup with manifests): Tweak
introductory paragraph.  Refer to the new "Writing Manifests" node of
the manual.
</span></span></td><td>Ludovic Courtès</td></tr>
