unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Proposal: prefetch tarballs in a batch
@ 2014-03-27 23:25 Nikita Karetnikov
  2014-03-28 13:23 ` Ludovic Courtès
  0 siblings, 1 reply; 22+ messages in thread
From: Nikita Karetnikov @ 2014-03-27 23:25 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 790 bytes --]

By default, Guix fetches source tarballs on demand.  You download a
tarball, configure and install, move to the next one, and so on.  But it
may be useful to fetch all the prerequisites before building.

For instance, you travel frequently and don’t usually have Internet
access.  So it’d be nice to do something like ‘guix package
–install={foo,bar,baz}’ at home, run ‘pm-hibernate’ at some point, hop
on a train, and continue building if the sources got downloaded.

Actaully, the last part made me realize that it may be better to have a
separate script for downloading.  After all, we’d like to ensure that
the tarballs were fetched, or the train ride would be boring.  On IRC,
Ludo suggested to add a new option to ‘guix build’, how hard would it
be?

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-03-27 23:25 Proposal: prefetch tarballs in a batch Nikita Karetnikov
@ 2014-03-28 13:23 ` Ludovic Courtès
  2014-04-01 23:23   ` Nikita Karetnikov
  0 siblings, 1 reply; 22+ messages in thread
From: Ludovic Courtès @ 2014-03-28 13:23 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: guix-devel

Nikita Karetnikov <nikita@karetnikov.org> skribis:

> By default, Guix fetches source tarballs on demand.  You download a
> tarball, configure and install, move to the next one, and so on.  But it
> may be useful to fetch all the prerequisites before building.
>
> For instance, you travel frequently and don’t usually have Internet
> access.  So it’d be nice to do something like ‘guix package
> –install={foo,bar,baz}’ at home, run ‘pm-hibernate’ at some point, hop
> on a train, and continue building if the sources got downloaded.
>
> Actaully, the last part made me realize that it may be better to have a
> separate script for downloading.  After all, we’d like to ensure that
> the tarballs were fetched, or the train ride would be boring.  On IRC,
> Ludo suggested to add a new option to ‘guix build’, how hard would it
> be?

My first reaction was that, often

  guix build -S foo bar baz

would be enough.  However, it doesnt’t download the sources of
prerequisites.

So, what I had in mind is something like, say:

  guix prefetch foo bar baz

which would prefetch the sources of foo, bar, and baz, plus the sources
of any missing prerequisites.

The simplest way to do it would be by walking the package DAG: start
from ‘foo’, accumulate its ‘package-source’, then traverse its inputs,
etc.  Recursion would stop at the implicit inputs (GCC, glibc,
Coreutils, etc.), though.

If you’d like implicit inputs to be taken into account, then you’d have
to traverse derivations.  It’s less convenient because it’s lower-level.

WDYT?

Ludo’.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-03-28 13:23 ` Ludovic Courtès
@ 2014-04-01 23:23   ` Nikita Karetnikov
  2014-04-02 12:57     ` Ludovic Courtès
  0 siblings, 1 reply; 22+ messages in thread
From: Nikita Karetnikov @ 2014-04-01 23:23 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 501 bytes --]

> The simplest way to do it would be by walking the package DAG: start
> from ‘foo’, accumulate its ‘package-source’, then traverse its inputs,
> etc.  Recursion would stop at the implicit inputs (GCC, glibc,
> Coreutils, etc.), though.

> If you’d like implicit inputs to be taken into account, then you’d have
> to traverse derivations.  It’s less convenient because it’s lower-level.

Is there a function that accepts a package name and returns a list of
implicit inputs?

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-04-01 23:23   ` Nikita Karetnikov
@ 2014-04-02 12:57     ` Ludovic Courtès
  2014-04-02 22:37       ` Nikita Karetnikov
  0 siblings, 1 reply; 22+ messages in thread
From: Ludovic Courtès @ 2014-04-02 12:57 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: guix-devel

Nikita Karetnikov <nikita@karetnikov.org> skribis:

>> The simplest way to do it would be by walking the package DAG: start
>> from ‘foo’, accumulate its ‘package-source’, then traverse its inputs,
>> etc.  Recursion would stop at the implicit inputs (GCC, glibc,
>> Coreutils, etc.), though.
>
>> If you’d like implicit inputs to be taken into account, then you’d have
>> to traverse derivations.  It’s less convenient because it’s lower-level.
>
> Is there a function that accepts a package name and returns a list of
> implicit inputs?

No, because by definition, those “implicit inputs” are not listed in the
package object.  Instead, they are added by the build system (see
build-system/gnu.scm.)

That’s why I suggested using derivations instead: take the output of
(package-derivation x y), and traverse it in search of fixed-output
derivations.

But again, that’s a bit of a sledgehammer, and somewhat inconvenient to
do at the moment.

Ludo’.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-04-02 12:57     ` Ludovic Courtès
@ 2014-04-02 22:37       ` Nikita Karetnikov
  2014-04-03  7:24         ` Ludovic Courtès
  0 siblings, 1 reply; 22+ messages in thread
From: Nikita Karetnikov @ 2014-04-02 22:37 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 473 bytes --]

>> Is there a function that accepts a package name and returns a list of
>> implicit inputs?

> No, because by definition, those “implicit inputs” are not listed in the
> package object.  Instead, they are added by the build system (see
> build-system/gnu.scm.)

> That’s why I suggested using derivations instead: take the output of
> (package-derivation x y), and traverse it in search of fixed-output
> derivations.

What’s a fixed-ouput derivation?

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-04-02 22:37       ` Nikita Karetnikov
@ 2014-04-03  7:24         ` Ludovic Courtès
  2014-04-09 22:29           ` Nikita Karetnikov
  0 siblings, 1 reply; 22+ messages in thread
From: Ludovic Courtès @ 2014-04-03  7:24 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: guix-devel

Nikita Karetnikov <nikita@karetnikov.org> skribis:

>>> Is there a function that accepts a package name and returns a list of
>>> implicit inputs?
>
>> No, because by definition, those “implicit inputs” are not listed in the
>> package object.  Instead, they are added by the build system (see
>> build-system/gnu.scm.)
>
>> That’s why I suggested using derivations instead: take the output of
>> (package-derivation x y), and traverse it in search of fixed-output
>> derivations.
>
> What’s a fixed-ouput derivation?

A derivation whose result (hash thereof) is known in advance, as is the
case for downloads (info "(guix) Derivations").

Ludo’.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-04-03  7:24         ` Ludovic Courtès
@ 2014-04-09 22:29           ` Nikita Karetnikov
  2014-04-10  8:21             ` Ludovic Courtès
  0 siblings, 1 reply; 22+ messages in thread
From: Nikita Karetnikov @ 2014-04-09 22:29 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 2094 bytes --]

So, in order to add a tarball to the store, one can write:

$ ./pre-inst-env guile
scheme@(guile-user)> ,use (guix store) (guix packages) (guix derivations) (gnu packages wget)
scheme@(guile-user)> (define s (open-connection))
scheme@(guile-user)> (package-source-derivation s (package-source wget))
$1 = #<derivation /gnu/store/jf4hzf16akk7bjidpr6im3wamfnr5rpv-wget-1.15.tar.xz.drv => /gnu/store/qz9vm8802v6pi69ci2kgnvfivrkr085r-wget-1.15.tar.xz 1922cd0>
scheme@(guile-user)> (build-derivations s (list $1))
$2 = #t
scheme@(guile-user)> (file-exists? (derivation->output-path $1))
$3 = #t

And to get a list of inputs (including the implicit ones):

scheme@(guile-user)> ,use (srfi srfi-26)
scheme@(guile-user)> (for-each (cut format #t "~a~%" <>) (derivation-inputs (package-derivation s wget)))
#<<derivation-input> path: "/gnu/store/divcaakxh5zhgpkih3paxb6znmnpbzhw-guile-2.0.11.drv" sub-derivations: ("out")>
#<<derivation-input> path: "/gnu/store/jf4hzf16akk7bjidpr6im3wamfnr5rpv-wget-1.15.tar.xz.drv" sub-derivations: ("out")>
#<<derivation-input> path: "/gnu/store/rx5kn39gcc0vm4hwr81kcwpxgybx2yay-perl-5.16.1.drv" sub-derivations: ("out")>
[…]

Then ‘read-derivation’ can be used to “turn” a <derivation-input> type into <derivation>:

scheme@(guile-user)> ,use (srfi srfi-1)
scheme@(guile-user)> (call-with-input-file (derivation-input-path (first (derivation-inputs (package-derivation s wget)))) read-derivation)
$4 = #<derivation /gnu/store/divcaakxh5zhgpkih3paxb6znmnpbzhw-guile-2.0.11.drv => /gnu/store/6mfc9dhala2mnkmc8xjyjzc04mxwym26-guile-2.0.11-debug /gnu/store/1r1097pd7842mf3fpyhfn86wdrilx73q-guile-2.0.11 1922fa0>

I’m planning to do the same for every input.  But a couple of things are
not clear:

1. Should the recursion stop when ‘fixed-output-derivation?’ returns #t?
   Or should I use a different function for the base case?

2. I’d like to use ‘package-source-derivation’ (see above) in order to
   get a tarball.  Is it possible to get a <package> type from
   <derivation>?  If not, what are my options?

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-04-09 22:29           ` Nikita Karetnikov
@ 2014-04-10  8:21             ` Ludovic Courtès
  2014-04-12 20:19               ` Nikita Karetnikov
  0 siblings, 1 reply; 22+ messages in thread
From: Ludovic Courtès @ 2014-04-10  8:21 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: guix-devel

Nikita Karetnikov <nikita@karetnikov.org> skribis:

> So, in order to add a tarball to the store, one can write:
>
> $ ./pre-inst-env guile
> scheme@(guile-user)> ,use (guix store) (guix packages) (guix derivations) (gnu packages wget)
> scheme@(guile-user)> (define s (open-connection))
> scheme@(guile-user)> (package-source-derivation s (package-source wget))
> $1 = #<derivation /gnu/store/jf4hzf16akk7bjidpr6im3wamfnr5rpv-wget-1.15.tar.xz.drv => /gnu/store/qz9vm8802v6pi69ci2kgnvfivrkr085r-wget-1.15.tar.xz 1922cd0>
> scheme@(guile-user)> (build-derivations s (list $1))
> $2 = #t
> scheme@(guile-user)> (file-exists? (derivation->output-path $1))
> $3 = #t
>
> And to get a list of inputs (including the implicit ones):
>
> scheme@(guile-user)> ,use (srfi srfi-26)
> scheme@(guile-user)> (for-each (cut format #t "~a~%" <>) (derivation-inputs (package-derivation s wget)))
> #<<derivation-input> path: "/gnu/store/divcaakxh5zhgpkih3paxb6znmnpbzhw-guile-2.0.11.drv" sub-derivations: ("out")>
> #<<derivation-input> path: "/gnu/store/jf4hzf16akk7bjidpr6im3wamfnr5rpv-wget-1.15.tar.xz.drv" sub-derivations: ("out")>
> #<<derivation-input> path: "/gnu/store/rx5kn39gcc0vm4hwr81kcwpxgybx2yay-perl-5.16.1.drv" sub-derivations: ("out")>

Yup, but note that the you don’t need to actually build the derivation
to traverse it (IOW the ‘build-derivations’ call is not needed.)

> I’m planning to do the same for every input.  But a couple of things are
> not clear:
>
> 1. Should the recursion stop when ‘fixed-output-derivation?’ returns #t?

I think so.  In general fixed-output derivations are the things you
would like to pre-fetch; so you would typically call ‘build-derivations’
on these to do the actual pre-fetching.

> 2. I’d like to use ‘package-source-derivation’ (see above) in order to
>    get a tarball.  Is it possible to get a <package> type from
>    <derivation>?  If not, what are my options?

No: as the manual so nicely says ;-), “derivations are to package
definitions what assembly is to C programs.”

What I would imagine is something like:

  (define (derivations-to-prefetch store drv)
    "Return the list of fixed-output derivations that DRV depends on,
  directly or indirectly."
    ...)

And then you would just pass the result of this procedure to
‘build-derivations’, which would download anything not already present.

Does that make sense?

Ludo’.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-04-10  8:21             ` Ludovic Courtès
@ 2014-04-12 20:19               ` Nikita Karetnikov
  2014-04-12 22:44                 ` Ludovic Courtès
  0 siblings, 1 reply; 22+ messages in thread
From: Nikita Karetnikov @ 2014-04-12 20:19 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 434 bytes --]

>> 1. Should the recursion stop when ‘fixed-output-derivation?’ returns #t?

> I think so.  In general fixed-output derivations are the things you
> would like to pre-fetch; so you would typically call ‘build-derivations’
> on these to do the actual pre-fetching.

Could you show a package with a fixed-output derivation?  My current
implementation calls itself indefinitely because the base case is never
satisfied.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-04-12 20:19               ` Nikita Karetnikov
@ 2014-04-12 22:44                 ` Ludovic Courtès
  2014-04-24 21:20                   ` Nikita Karetnikov
  0 siblings, 1 reply; 22+ messages in thread
From: Ludovic Courtès @ 2014-04-12 22:44 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: guix-devel

Nikita Karetnikov <nikita@karetnikov.org> skribis:

>>> 1. Should the recursion stop when ‘fixed-output-derivation?’ returns #t?
>
>> I think so.  In general fixed-output derivations are the things you
>> would like to pre-fetch; so you would typically call ‘build-derivations’
>> on these to do the actual pre-fetching.
>
> Could you show a package with a fixed-output derivation?  My current
> implementation calls itself indefinitely because the base case is never
> satisfied.

Any “origin” that has no patches/snippet is a fixed-output derivation.

But!  There was a bug in ‘fixed-output-derivation?’ (which was actually
unused until now.)  Fixed in 99e17dc:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (package-source-derivation s (package-source wget))
$12 = #<derivation /gnu/store/f96502xhla1k3daikjckn2zb1l17m8r5-wget-1.15.tar.xz.drv => /gnu/store/qz9vm8802v6pi69ci2kgnvfivrkr085r-wget-1.15.tar.xz 2d1e730>
scheme@(guile-user)> (fixed-output-derivation? $12)
$13 = #t
--8<---------------cut here---------------end--------------->8---

Thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-04-12 22:44                 ` Ludovic Courtès
@ 2014-04-24 21:20                   ` Nikita Karetnikov
  2014-04-25 11:51                     ` Ludovic Courtès
  2014-04-25 12:04                     ` Ludovic Courtès
  0 siblings, 2 replies; 22+ messages in thread
From: Nikita Karetnikov @ 2014-04-24 21:20 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 2254 bytes --]

I’m attaching the patch.  Several issues must be addressed before it can
be pushed:

1. ‘guix prefetch’ tries to configure and build some packages instead of
   just downloading them.  I tried the following on a machine with the
   empty store:

   a. Ran ‘guix prefetch hello’.  Some packages were downloaded and
      built (I gathered those are needed to download the other packages,
      so I didn’t write down the names.  If I recall correctly, Guile
      was in that list.)

   b. Invoked ‘guix build hello’ without network access.  The command
      succeeded.  No questions here.

   c. Called ‘guix prefetch emacs’.  These packages were configured and
      built: pkg-config, libunistring, ncurses, libatomic_ops, patch,
      tar, xz, gzip, zlib, which, gc, perl, m4, readline, libffi,
      texinfo, libtool, gmp, libtasn1, nettle, guile, gnutls.

      Are these essential, or is there an error in ‘guix prefetch’?
      According to the build logs, the install prefix of gmp is
      ‘/gnu/store/hpaz49xz76p4qmpjc9r33hni1w781y66-gmp-5.1.3’, which
      doesn’t appear in the lists provided by ‘guix prefetch hello’ and
      ‘guix prefetch emacs’.  I’m not sure why it’s the case.

2. I think it would be nice to output the location of a tarball after
   running ‘guix prefetch’, but I’m not sure how to get the relevant
   derivation.  For ‘hello’, it’s neither

     (package-source-derivation store (package-source hello))

   nor

     (package-derivation store hello)

   because the derivation listed in the initial output of ‘guix prefetch
   hello’ differs.  Of course, it’s possible to filter the list
   produced by

     (build-derivations
      store
      (map (lambda (drv)
             ;; (format #t "   ~a~%" (derivation-file-name drv))
             (format #t "   ~a~%" drv)
             drv)
           (derivations-to-prefetch
            store
            (package-derivation store package)))))

   But it’s error-prone, so I’d rather avoid that.

3. I’m planning to add ‘--dry-run’, which will simply print the list of
   needed derivations.  What options would you like to see implemented?


[-- Attachment #1.2: prefetch.patch.4 --]
[-- Type: text/plain, Size: 5655 bytes --]

diff --git a/guix/scripts/prefetch.scm b/guix/scripts/prefetch.scm
new file mode 100644
index 0000000..16346bb
--- /dev/null
+++ b/guix/scripts/prefetch.scm
@@ -0,0 +1,149 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2014 Nikita Karetnikov <nikita@karetnikov.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 (guix scripts prefetch)
+  #:use-module (guix derivations)
+  #:use-module (guix packages)
+  #:use-module (guix store)
+  #:use-module (guix ui)
+  #:use-module (guix utils)
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-11)
+  #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-37)
+  #:use-module (ice-9 match)
+  #:export (guix-prefetch))
+
+;;; Commentary:
+;;;
+;;; This program is used to download and add to the store all inputs that are
+;;; needed to build the specified packages.
+;;;
+;;; Code:
+
+(define (fold-values f acc seen lst)
+  (if (null-list? lst)
+      (values acc seen)
+      (let-values (((acc* seen*)
+                    (f acc seen (first lst))))
+        (fold-values f
+                     acc*
+                     seen*
+                     (cdr lst)))))
+
+(define (derivations-to-prefetch store drv)
+  "Return the list of fixed-output derivations that DRV depends on, directly
+or indirectly."
+  (define (unique-derivations acc seen lst)
+    ;; Return two values: the list of unique fixed-output derivations and the
+    ;; list of seen derivations.
+    (fold-values (lambda (acc seen drv-input)
+                   (let ((drv* (call-with-input-file (derivation-input-path drv-input)
+                                 read-derivation)))
+                     (cond ((fixed-output-derivation? drv*)
+                            (values (lset-adjoin equal? acc drv*)
+                                    seen))
+                           ((member drv* seen)
+                            (values acc seen))
+                           (else
+                            (unique-derivations acc
+                                                (cons drv* seen)
+                                                (derivation-inputs drv*))))))
+                 acc
+                 seen
+                 lst))
+
+  (identity  ; discard the second value
+   (unique-derivations '() '() (derivation-inputs drv))))
+
+\f
+;;;
+;;; Command-line options.
+;;;
+
+(define %default-options
+  '())
+
+(define (show-help)
+  (display (_ "Usage: guix prefetch [OPTION]... PACKAGES...
+Download and add to the store all inputs that are needed to build
+PACKAGES.\n"))
+  (display (_ "
+  -h, --help             display this help and exit"))
+  (display (_ "
+  -V, --version          display version information and exit"))
+  (newline)
+  (show-bug-report-information))
+
+(define %options
+  ;; Specification of the command-line options.
+  (list (option '(#\h "help") #f #f
+                 (lambda args
+                   (show-help)
+                   (exit 0)))
+        (option '(#\V "version") #f #f
+                (lambda args
+                  (show-version-and-exit "guix prefetch")))))
+
+\f
+;;;
+;;; Entry point.
+;;;
+
+;; XXX: remove me.
+(define specification->package+output
+  (@@ (guix scripts package) specification->package+output))
+
+(define (guix-prefetch . args)
+  (define (parse-options)
+    ;; Return the alist of option values.
+    (args-fold* args %options
+                (lambda (opt name arg result)
+                  (leave (_ "~A: unrecognized option~%") name))
+                (lambda (arg result)
+                  (alist-cons 'argument arg result))
+                %default-options))
+
+  (let ((opts  (parse-options))
+        (store (open-connection)))
+    (map (lambda (package)
+           (format #t "Prefetching the derivations for '~a':~%"
+                   (package-name package))
+
+           (build-derivations
+            store
+            (map (lambda (drv)
+                   ;; (format #t "   ~a~%" (derivation-file-name drv))
+                   (format #t "   ~a~%" drv)
+                   drv)
+                 (derivations-to-prefetch
+                  store
+                  (package-derivation store package)))))
+
+         (delete-duplicates
+          (filter-map (match-lambda
+                       (('argument . value)
+                        (identity  ; discard the second value
+                         ;; Check that all VALUEs in the list are valid
+                         ;; packages before calling 'derivations-to-prefetch'.
+                         ;; If VALUE is not a valid package,
+                         ;; 'specification->package+output' will raise an
+                         ;; error.
+                         (specification->package+output value)))
+                       (_ #f))
+                      (reverse opts))))))

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-04-24 21:20                   ` Nikita Karetnikov
@ 2014-04-25 11:51                     ` Ludovic Courtès
  2014-04-25 12:04                     ` Ludovic Courtès
  1 sibling, 0 replies; 22+ messages in thread
From: Ludovic Courtès @ 2014-04-25 11:51 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: guix-devel

Nikita Karetnikov <nikita@karetnikov.org> skribis:

> 1. ‘guix prefetch’ tries to configure and build some packages instead of
>    just downloading them.  I tried the following on a machine with the
>    empty store:
>
>    a. Ran ‘guix prefetch hello’.  Some packages were downloaded and
>       built (I gathered those are needed to download the other packages,
>       so I didn’t write down the names.  If I recall correctly, Guile
>       was in that list.)

Yes, by default ‘guile-final’ is used to build derivations (including
download derivations), so that needs to be built before anything else
can be done.  (And that involves building gcc, libc, etc. first.)

>    b. Invoked ‘guix build hello’ without network access.  The command
>       succeeded.  No questions here.
>
>    c. Called ‘guix prefetch emacs’.  These packages were configured and
>       built: pkg-config, libunistring, ncurses, libatomic_ops, patch,
>       tar, xz, gzip, zlib, which, gc, perl, m4, readline, libffi,
>       texinfo, libtool, gmp, libtasn1, nettle, guile, gnutls.
>
>       Are these essential, or is there an error in ‘guix prefetch’?
>       According to the build logs, the install prefix of gmp is
>       ‘/gnu/store/hpaz49xz76p4qmpjc9r33hni1w781y66-gmp-5.1.3’, which
>       doesn’t appear in the lists provided by ‘guix prefetch hello’ and
>       ‘guix prefetch emacs’.  I’m not sure why it’s the case.

Perhaps these were just the prerequisites for ‘guile-final’ no?

> 2. I think it would be nice to output the location of a tarball after
>    running ‘guix prefetch’, but I’m not sure how to get the relevant
>    derivation.  For ‘hello’, it’s neither
>
>      (package-source-derivation store (package-source hello))
>
>    nor
>
>      (package-derivation store hello)
>
>    because the derivation listed in the initial output of ‘guix prefetch
>    hello’ differs.  Of course, it’s possible to filter the list
>    produced by
>
>      (build-derivations
>       store
>       (map (lambda (drv)
>              ;; (format #t "   ~a~%" (derivation-file-name drv))
>              (format #t "   ~a~%" drv)
>              drv)
>            (derivations-to-prefetch
>             store
>             (package-derivation store package)))))
>
>    But it’s error-prone, so I’d rather avoid that.

I don’t understand.  You can do:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (derivation->output-path
                       (package-source-derivation s (package-source hello)))
$4 = "/gnu/store/070fnjll8hb3q2l4373bbahh2i1n2qhg-hello-2.9.tar.gz"
--8<---------------cut here---------------end--------------->8---

Isn’t it what you want?

> 3. I’m planning to add ‘--dry-run’, which will simply print the list of
>    needed derivations.

I think this should use ‘show-what-to-build’, as in ‘guix build’ and
other commands, so that it would also show what other derivations need
to be built, such as those for ‘guile-final’.

> What options would you like to see implemented?

Probably all of ‘%standard-build-options’ from (guix scripts build) can
be made available?

Thanks for the nice work!

Ludo’.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-04-24 21:20                   ` Nikita Karetnikov
  2014-04-25 11:51                     ` Ludovic Courtès
@ 2014-04-25 12:04                     ` Ludovic Courtès
  2014-05-06 12:37                       ` Nikita Karetnikov
  1 sibling, 1 reply; 22+ messages in thread
From: Ludovic Courtès @ 2014-04-25 12:04 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: guix-devel

I forgot to comment on the actual patch...

Nikita Karetnikov <nikita@karetnikov.org> skribis:

> +(define (fold-values f acc seen lst)

Use ‘fold2’ from (guix utils) instead.

> +(define (derivations-to-prefetch store drv)
> +  "Return the list of fixed-output derivations that DRV depends on, directly
> +or indirectly."
> +  (define (unique-derivations acc seen lst)
> +    ;; Return two values: the list of unique fixed-output derivations and the
> +    ;; list of seen derivations.
> +    (fold-values (lambda (acc seen drv-input)
> +                   (let ((drv* (call-with-input-file (derivation-input-path drv-input)
> +                                 read-derivation)))
> +                     (cond ((fixed-output-derivation? drv*)
> +                            (values (lset-adjoin equal? acc drv*)
> +                                    seen))
> +                           ((member drv* seen)
> +                            (values acc seen))
> +                           (else
> +                            (unique-derivations acc
> +                                                (cons drv* seen)
> +                                                (derivation-inputs drv*))))))
> +                 acc
> +                 seen
> +                 lst))
> +
> +  (identity  ; discard the second value
> +   (unique-derivations '() '() (derivation-inputs drv))))

Can’t it be simplified along these lines:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (define (derivation-input->derivation input) 
		       (call-with-input-file (derivation-input-path input)
			 read-derivation))
scheme@(guile-user)> (filter fixed-output-derivation?
			     (map derivation-input->derivation (derivation-prerequisites $6)))
$10 = (#<derivation /gnu/store/slmkaqybzszjxbl78ymp1dn9c79m9kmy-linux-libre-3.3.8-gnu.tar.xz.drv => /gnu/store/zgh2nvvxkwvmijchf4gyrqb4cq11znvd-linux-libre-3.3.8-gnu.tar.xz 3cbc2d0> #<derivation /gnu/store/c41c2g3g54ipwf5ja3wip5wc...
--8<---------------cut here---------------end--------------->8---

> +;; XXX: remove me.
> +(define specification->package+output
> +  (@@ (guix scripts package) specification->package+output))

I think ‘specification->package’ from (guix scripts build) should be
used instead (it can be exported from there), because the output part of
the specification isn’t needed here: it would make no sense to type

  guix prefetch glibc:debug

because the source of glibc:debug is the same as that of glibc.

> +  (let ((opts  (parse-options))
> +        (store (open-connection)))
> +    (map (lambda (package)
> +           (format #t "Prefetching the derivations for '~a':~%"
> +                   (package-name package))
> +
> +           (build-derivations
> +            store
> +            (map (lambda (drv)
> +                   ;; (format #t "   ~a~%" (derivation-file-name drv))
> +                   (format #t "   ~a~%" drv)
> +                   drv)
> +                 (derivations-to-prefetch
> +                  store
> +                  (package-derivation store package)))))
> +
> +         (delete-duplicates
> +          (filter-map (match-lambda
> +                       (('argument . value)
> +                        (identity  ; discard the second value
> +                         ;; Check that all VALUEs in the list are valid
> +                         ;; packages before calling 'derivations-to-prefetch'.
> +                         ;; If VALUE is not a valid package,
> +                         ;; 'specification->package+output' will raise an
> +                         ;; error.
> +                         (specification->package+output value)))
> +                       (_ #f))
> +                      (reverse opts))))))

It should be a single ‘build-derivations’ call, to allow for
parallelism.

Thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-04-25 12:04                     ` Ludovic Courtès
@ 2014-05-06 12:37                       ` Nikita Karetnikov
  2014-05-06 20:02                         ` Ludovic Courtès
  0 siblings, 1 reply; 22+ messages in thread
From: Nikita Karetnikov @ 2014-05-06 12:37 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 4507 bytes --]

I’m attaching the version incorporating your suggestions, which was
tested with the empty store.  There are a bunch of problems:

1. It doesn’t seem to prefetch all the needed dependencies.  ‘guix build
   hello’ (without network access) fails after prefetching the said
   package.

2. The substituter fails from time to time.  Note that eight tests fail
   on the machine I used: ‘builders.scm’, ‘utils.scm’, ‘packages.scm’,
   ‘store.scm’, ‘monads.scm’, ‘gexp.scm’, ‘guix-package.sh’,
   ‘guix-register.sh’.  Perhaps we ought to fix the mentioned failures
   first.  Which log files would you like to see?

   $ ./pre-inst-env guix prefetch -n icecat
   substitute-binary: guile: hashtab.c:137: vacuum_weak_hash_table: Assertion `removed <= len' failed.
   Backtrace:
   In ice-9/boot-9.scm:
    157: 15 [catch #t #<catch-closure 9c5bef0> ...]
   In unknown file:
      ?: 14 [apply-smob/1 #<catch-closure 9c5bef0>]
   In ice-9/boot-9.scm:
     63: 13 [call-with-prompt prompt0 ...]
   In ice-9/eval.scm:
    432: 12 [eval # #]
   In ice-9/boot-9.scm:
   2320: 11 [save-module-excursion #<procedure 9b8ae60 at ice-9/boot-9.scm:3961:3 ()>]
   3966: 10 [#<procedure 9b8ae60 at ice-9/boot-9.scm:3961:3 ()>]
   1645: 9 [%start-stack load-stack ...]
   1650: 8 [#<procedure 9c5c960 ()>]
   In unknown file:
      ?: 7 [primitive-load "/home/nikita/guix/guix-savannah/scripts/guix"]
   In guix/ui.scm:
    630: 6 [run-guix-command prefetch "-n" "icecat"]
   In ice-9/eval.scm:
    432: 5 [eval # #]
   In guix/ui.scm:
    265: 4 [show-what-to-build #<build-daemon 256.14 a369660> (# # # ...) ...]
   In guix/utils.scm:
    667: 3 [loop (# # # # ...) () (# # # # ...)]
   In guix/ui.scm:
    267: 2 [#<procedure c6fc288 at guix/ui.scm:265:24 (drv build download)> # # ()]
   In guix/derivations.scm:
    175: 1 [derivation-prerequisites-to-build # # # ...]
   In guix/store.scm:
    695: 0 [substitutable-paths # #]

   guix/store.scm:695:2: In procedure substitutable-paths:
   guix/store.scm:695:2: Throw to key `srfi-34' with args `(#<condition &nix-protocol-error [message: "substituter `substitute-binary' died unexpectedly" status: 1] be0d570>)'.

   I’ve also seen this one.  In case it matters, that was before running
   ‘chgrp 1001 /gnu/store; chmod 1775 /gnu/store’.

   $ ./pre-inst-env guix prefetch -n gnunet
   Backtrace:
   In ice-9/boot-9.scm:
    157: 17 [catch #t #<catch-closure 9319ef0> ...]
   In unknown file:
      ?: 16 [apply-smob/1 #<catch-closure 9319ef0>]
   In ice-9/boot-9.scm:
     63: 15 [call-with-prompt prompt0 ...]
   In ice-9/eval.scm:
    432: 14 [eval # #]
   In ice-9/boot-9.scm:
   2320: 13 [save-module-excursion #<procedure 9289e60 at ice-9/boot-9.scm:3961:3 ()>]
   3966: 12 [#<procedure 9289e60 at ice-9/boot-9.scm:3961:3 ()>]
   1645: 11 [%start-stack load-stack ...]
   1650: 10 [#<procedure 931a960 ()>]
   In unknown file:
      ?: 9 [primitive-load "/home/nikita/guix/guix-savannah/scripts/guix"]
   In guix/ui.scm:
    630: 8 [run-guix-command prefetch "-n" "gnunet"]
   In ice-9/eval.scm:
    432: 7 [eval # #]
   In guix/ui.scm:
    265: 6 [show-what-to-build #<build-daemon 256.14 9a29660> (# # # ...) ...]
   In guix/utils.scm:
    667: 5 [loop () () ...]
   In guix/ui.scm:
    267: 4 [#<procedure aab63c0 at guix/ui.scm:265:24 (drv build download)> # () ()]
   In guix/derivations.scm:
    175: 3 [derivation-prerequisites-to-build # # # ...]
   In guix/store.scm:
    695: 2 [substitutable-paths # #]
    392: 1 [process-stderr #<build-daemon 256.14 9a29660> #f]
   In guix/serialization.scm:
     51: 0 [read-int #<input-output: socket 11>]

   guix/serialization.scm:51:4: In procedure read-int:
   guix/serialization.scm:51:4: In procedure bv-u32-ref: Wrong type argument in position 1 (expecting bytevector): #<eof>

3. When using the substituter, the command takes much more time.  Do
   we even need it in this case?  I seem to recall that the GNUnet
   tarball was served by Hydra, but I forgot the details.

   $ time ./pre-inst-env guix prefetch -n icecat
   The following derivations would be built:
      […]
   101987 operations

   real	4m7.477s
   user	0m19.249s
   sys	0m4.848s

   $ time ./pre-inst-env guix prefetch -n --no-substitutes icecat
   The following derivations would be built:
      […]
   101675 operations

   real	0m22.933s
   user	0m14.745s
   sys	0m3.168s


[-- Attachment #1.2: prefetch.patch.8 --]
[-- Type: text/x-diff, Size: 5975 bytes --]

diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 35b10a0..8937d76 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -37,6 +37,7 @@
   #:export (%standard-build-options
             set-build-options-from-command-line
             show-build-options-help
+            specification->package
 
             guix-build))
 
diff --git a/guix/scripts/prefetch.scm b/guix/scripts/prefetch.scm
new file mode 100644
index 0000000..dbcef0f
--- /dev/null
+++ b/guix/scripts/prefetch.scm
@@ -0,0 +1,141 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2014 Nikita Karetnikov <nikita@karetnikov.org>
+;;; Copyright © 2014 Ludovic Courtès <ludo@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 (guix scripts prefetch)
+  #:use-module (guix derivations)
+  #:use-module (guix packages)
+  #:use-module (guix store)
+  #:use-module (guix ui)
+  #:use-module (guix utils)
+  #:use-module (guix scripts build)
+  #:use-module (ice-9 match)
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-11)
+  #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-37)
+  #:export (guix-prefetch))
+
+;;; Commentary:
+;;;
+;;; This program is used to download and add to the store all inputs that are
+;;; needed to build the specified packages.
+;;;
+;;; Code.
+
+(define (derivation-input->derivation input)
+  (call-with-input-file (derivation-input-path input)
+    read-derivation))
+
+(define* (derivations-to-prefetch store package #:key (use-substitutes? #t))
+  "Return the list of fixed-output derivations for PACKAGE."
+  (filter fixed-output-derivation?
+          (map derivation-input->derivation
+               (derivation-prerequisites-to-build
+                store
+                (package-derivation store package)
+                #:use-substitutes? use-substitutes?))))
+
+\f
+;;;
+;;; Command-line options.
+;;;
+
+(define %default-options
+  '((substitutes? . #t)))
+
+(define (show-help)
+  (display (_ "Usage: guix prefetch [OPTION]... PACKAGES...
+Download and add to the store all inputs that are needed to build
+PACKAGES.\n"))
+  (display (_ "
+  -n, --dry-run          do not build the derivations"))
+  (display (_ "
+      --no-substitutes   build instead of resorting to pre-built substitutes"))
+  (display (_ "
+  -h, --help             display this help and exit"))
+  (display (_ "
+  -V, --version          display version information and exit"))
+  (newline)
+  (show-bug-report-information))
+
+(define %options
+  ;; Specification of the command-line options.
+  (list (option '("no-substitutes") #f #f
+                (lambda (opt name arg result . rest)
+                  (apply values
+                         (alist-cons 'substitutes? #f
+                                     (alist-delete 'substitutes? result))
+                         rest)))
+        (option '(#\n "dry-run") #f #f
+                (lambda (opt name arg result)
+                  (alist-cons 'dry-run? #t result)))
+
+        (option '(#\h "help") #f #f
+                (lambda args
+                  (show-help)
+                  (exit 0)))
+        (option '(#\V "version") #f #f
+                (lambda args
+                  (show-version-and-exit "guix prefetch")))))
+
+\f
+;;;
+;;; Entry point.
+;;;
+
+(define (guix-prefetch . args)
+  (define (parse-options)
+    ;; Return the alist of option values.
+    (args-fold* args %options
+                (lambda (opt name arg result)
+                  (leave (_ "~A: unrecognized option~%") name))
+                (lambda (arg result)
+                  (alist-cons 'argument arg result))
+                %default-options))
+
+  (let* ((opts         (parse-options))
+         (dry-run?     (assoc-ref opts 'dry-run?))
+         (substitutes? (assoc-ref opts 'substitutes?))
+         (store        (open-connection))
+         (drvs
+          (append-map (lambda (package)
+                        (derivations-to-prefetch
+                         store
+                         package
+                         #:use-substitutes? substitutes?))
+
+                      (delete-duplicates
+                       (filter-map (match-lambda
+                                    (('argument . value)
+                                     (identity  ; discard the second value
+                                      ;; Check that all VALUEs in the list are
+                                      ;; valid packages before calling
+                                      ;; 'derivations-to-prefetch'.  If VALUE
+                                      ;; is not a valid package,
+                                      ;; 'specification->package' will raise
+                                      ;; an error.
+                                      (specification->package value)))
+                                    (_ #f))
+                                   (reverse opts))))))
+    (show-what-to-build store
+                        drvs
+                        #:dry-run? dry-run?
+                        #:use-substitutes? substitutes?)
+    (unless dry-run?
+      (build-derivations store drvs))))

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-05-06 12:37                       ` Nikita Karetnikov
@ 2014-05-06 20:02                         ` Ludovic Courtès
  2014-05-07 23:14                           ` Nikita Karetnikov
  0 siblings, 1 reply; 22+ messages in thread
From: Ludovic Courtès @ 2014-05-06 20:02 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: guix-devel

Nikita Karetnikov <nikita@karetnikov.org> skribis:

> 1. It doesn’t seem to prefetch all the needed dependencies.  ‘guix build
>    hello’ (without network access) fails after prefetching the said
>    package.

Fails how?

> 2. The substituter fails from time to time.  Note that eight tests fail
>    on the machine I used: ‘builders.scm’, ‘utils.scm’, ‘packages.scm’,
>    ‘store.scm’, ‘monads.scm’, ‘gexp.scm’, ‘guix-package.sh’,
>    ‘guix-register.sh’.  Perhaps we ought to fix the mentioned failures
>    first.  Which log files would you like to see?

The SRFI-64 log files of the failing tests, plus test-suite.log.  Test
failures must not remain uncorrected!  ;-)

When there are so many failures, it’s likely that there’s a setup issue,
like socket names are too long.

>    $ ./pre-inst-env guix prefetch -n icecat
>    substitute-binary: guile: hashtab.c:137: vacuum_weak_hash_table: Assertion `removed <= len' failed.

What Guile and libgc version is this, and what platform?

>    I’ve also seen this one.  In case it matters, that was before running
>    ‘chgrp 1001 /gnu/store; chmod 1775 /gnu/store’.
>
>    $ ./pre-inst-env guix prefetch -n gnunet
>    Backtrace:
>    In ice-9/boot-9.scm:
>     157: 17 [catch #t #<catch-closure 9319ef0> ...]

[...]

>    In guix/derivations.scm:
>     175: 3 [derivation-prerequisites-to-build # # # ...]
>    In guix/store.scm:
>     695: 2 [substitutable-paths # #]
>     392: 1 [process-stderr #<build-daemon 256.14 9a29660> #f]
>    In guix/serialization.scm:
>      51: 0 [read-int #<input-output: socket 11>]
>
>    guix/serialization.scm:51:4: In procedure read-int:
>    guix/serialization.scm:51:4: In procedure bv-u32-ref: Wrong type argument in position 1 (expecting bytevector): #<eof>

That seems similar no?

Does the installation seem sane, basically?  Do ‘guix build’, ‘guix
package’ etc. work somehow, or not even?

> 3. When using the substituter, the command takes much more time.  Do
>    we even need it in this case?  I seem to recall that the GNUnet
>    tarball was served by Hydra, but I forgot the details.

There’s a local cache of substituter hits/failures in
/var/guix/substitute-binary (or similar.)  When that cache is empty or
outdated, a lot of HTTP queries are made to hydra.gnu.org, which can
take a bit of time.

When using a recent Guile, these queries are made in parallel.  On my
machine, it goes like this:

--8<---------------cut here---------------start------------->8---
$ sudo rm -rf /var/guix/substitute-binary/cache/

$ time guix build emacs -n

real	0m30.551s
user	0m2.519s
sys	0m0.154s

$ time guix build emacs -n

real	0m3.381s
user	0m2.039s
sys	0m0.123s
--8<---------------cut here---------------end--------------->8---

The cost is high when starting from an empty cache, but afterwards it’s
small.

> +(define (show-help)

Add call to ‘show-build-options-help’ from (guix scripts build).

> +(define %options
> +  ;; Specification of the command-line options.
> +  (list (option '("no-substitutes") #f #f
> +                (lambda (opt name arg result . rest)
> +                  (apply values
> +                         (alist-cons 'substitutes? #f
> +                                     (alist-delete 'substitutes? result))
> +                         rest)))

Remove this option, and concatenate with ‘%standard-build-options’.

> +                       (filter-map (match-lambda
> +                                    (('argument . value)
> +                                     (identity  ; discard the second value

The extra value gets truncated here, so it’s not strictly needed.

Thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-05-06 20:02                         ` Ludovic Courtès
@ 2014-05-07 23:14                           ` Nikita Karetnikov
  2014-05-08 16:35                             ` Ludovic Courtès
  0 siblings, 1 reply; 22+ messages in thread
From: Nikita Karetnikov @ 2014-05-07 23:14 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 1123 bytes --]

> The SRFI-64 log files of the failing tests, plus test-suite.log.  Test
> failures must not remain uncorrected!  ;-)

Attached.

> What Guile and libgc version is this, and what platform?

2.0.9; 1:7.1-8ubuntu0.12.04.1 (from Trisquel); i686.

> Does the installation seem sane, basically?  Do ‘guix build’, ‘guix
> package’ etc. work somehow, or not even?

Turns out I can’t even build ‘hello’ (though the build succeeded in the
logs).  I didn’t expect this because Guix had worked on this machine
previously.  IIRC, I did the following: deleted ‘/gnu/store’ and
‘/usr/local/var/guix/*’, cloned, and ran ‘./bootstrap’ & co.

Regarding ‘test-suite.log’:

> substitute-binary: warning: authentication and authorization of substitutes disabled!

How can I enable them?  Are they specifically disabled for testing
purposes?

> SQLite header and source version mismatch
> 2011-11-01 00:52:41 c7c6050ef060877ebe77b41d959e9df13f8c9b5e
> 2013-09-03 17:11:13 7dd4968f235d6e1ca9547cda9cf3bd570e1609ef

This was discussed before and should be fixed by upgrading SQLite.


[-- Attachment #1.2: builders.log --]
[-- Type: text/plain, Size: 1917 bytes --]

%%%% Starting test builders
Group begin: builders
Test begin:
  test-name: "url-fetch"
  source-file: "tests/builders.scm"
  source-line: 68
  source-form: (test-assert "url-fetch" (let* ((url (quote ("http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz" "ftp://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz"))) (hash (nix-base32-string->bytevector "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6")) (drv (url-fetch %store url (quote sha256) hash #:guile %bootstrap-guile)) (out-path (derivation->output-path drv))) (and (build-derivations %store (list drv)) (file-exists? out-path) (valid-path? %store out-path))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "gnu-build-system"
  source-file: "tests/builders.scm"
  source-line: 80
  source-form: (test-assert "gnu-build-system" (and (build-system? gnu-build-system) (eq? gnu-build (build-system-builder gnu-build-system))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "gnu-build"
  source-file: "tests/builders.scm"
  source-line: 85
  source-form: (test-assert "gnu-build" (let* ((url "http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz") (hash (nix-base32-string->bytevector "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6")) (tarball (url-fetch %store url (quote sha256) hash #:guile %bootstrap-guile)) (build (gnu-build %store "hello-2.8" tarball %bootstrap-inputs #:implicit-inputs? #f #:guile %bootstrap-guile #:search-paths %bootstrap-search-paths)) (out (derivation->output-path build))) (and (build-derivations %store (list (pk (quote hello-drv) build))) (valid-path? %store out) (file-exists? (string-append out "/bin/hello")))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1599602736: Bad file descriptor" status: 1] 8a62798>)
Group end: builders
# of expected passes      2
# of unexpected failures  1

[-- Attachment #1.3: derivations.log --]
[-- Type: text/plain, Size: 34422 bytes --]

%%%% Starting test derivations
Group begin: derivations
Test begin:
  test-name: "parse & export"
  source-file: "tests/derivations.scm"
  source-line: 84
  source-form: (test-assert "parse & export" (let* ((f (search-path %load-path "tests/test.drv")) (b1 (call-with-input-file f get-bytevector-all)) (d1 (read-derivation (open-bytevector-input-port b1))) (b2 (call-with-bytevector-output-port (cut write-derivation d1 <>))) (d2 (read-derivation (open-bytevector-input-port b2)))) (and (equal? b1 b2) (equal? d1 d2))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "add-to-store, flat"
  source-file: "tests/derivations.scm"
  source-line: 95
  source-form: (test-assert "add-to-store, flat" (let* ((file (search-path %load-path "language/tree-il/spec.scm")) (drv (add-to-store %store "flat-test" #f "sha256" file))) (and (eq? (quote regular) (stat:type (stat drv))) (valid-path? %store drv) (equal? (call-with-input-file file get-bytevector-all) (call-with-input-file drv get-bytevector-all)))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "add-to-store, recursive"
  source-file: "tests/derivations.scm"
  source-line: 103
  source-form: (test-assert "add-to-store, recursive" (let* ((dir (dirname (search-path %load-path "language/tree-il/spec.scm"))) (drv (add-to-store %store "dir-tree-test" #t "sha256" dir))) (and (eq? (quote directory) (stat:type (stat drv))) (valid-path? %store drv) (equal? (directory-contents dir) (directory-contents drv)))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "derivation with no inputs"
  source-file: "tests/derivations.scm"
  source-line: 111
  source-form: (test-assert "derivation with no inputs" (let* ((builder (add-text-to-store %store "my-builder.sh" "echo hello, world\n" (quote ()))) (drv (derivation %store "foo" %bash (quasiquote ("-e" (unquote builder))) #:env-vars (quote (("HOME" . "/homeless")))))) (and (store-path? (derivation-file-name drv)) (valid-path? %store (derivation-file-name drv)))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "build derivation with 1 source"
  source-file: "tests/derivations.scm"
  source-line: 121
  source-form: (test-assert "build derivation with 1 source" (let* ((builder (add-text-to-store %store "my-builder.sh" "echo hello, world > \"$out\"\n" (quote ()))) (drv (derivation %store "foo" %bash (quasiquote ((unquote builder))) #:env-vars (quote (("HOME" . "/homeless") ("zzz" . "Z!") ("AAA" . "A!"))) #:inputs (quasiquote (((unquote %bash)) ((unquote builder)))))) (succeeded? (build-derivations %store (list drv)))) (and succeeded? (let ((path (derivation->output-path drv))) (and (valid-path? %store path) (string=? (call-with-input-file path read-line) "hello, world"))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1852768304: Bad file descriptor" status: 1] 9c3eea0>)
Test begin:
  test-name: "derivation with local file as input"
  source-file: "tests/derivations.scm"
  source-line: 139
  source-form: (test-assert "derivation with local file as input" (let* ((builder (add-text-to-store %store "my-builder.sh" "(while read line ; do echo \"$line\" ; done) < $in > $out" (quote ()))) (input (search-path %load-path "ice-9/boot-9.scm")) (input* (add-to-store %store (basename input) #t "sha256" input)) (drv (derivation %store "derivation-with-input-file" %bash (quasiquote ((unquote builder))) #:env-vars (quasiquote (("in" unquote input*))) #:inputs (quasiquote (((unquote %bash)) ((unquote builder)) ((unquote input))))))) (and (build-derivations %store (list drv)) (valid-path? %store (derivation->output-path drv)))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1953431600: Bad file descriptor" status: 1] 9c4e000>)
Test begin:
  test-name: "fixed-output-derivation?"
  source-file: "tests/derivations.scm"
  source-line: 162
  source-form: (test-assert "fixed-output-derivation?" (let* ((builder (add-text-to-store %store "my-fixed-builder.sh" "echo -n hello > $out" (quote ()))) (hash (sha256 (string->utf8 "hello"))) (drv (derivation %store "fixed" %bash (quasiquote ((unquote builder))) #:inputs (quasiquote (((unquote builder)))) #:hash hash #:hash-algo (quote sha256)))) (fixed-output-derivation? drv)))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "fixed-output derivation"
  source-file: "tests/derivations.scm"
  source-line: 172
  source-form: (test-assert "fixed-output derivation" (let* ((builder (add-text-to-store %store "my-fixed-builder.sh" "echo -n hello > $out" (quote ()))) (hash (sha256 (string->utf8 "hello"))) (drv (derivation %store "fixed" %bash (quasiquote ((unquote builder))) #:inputs (quasiquote (((unquote builder)))) #:hash hash #:hash-algo (quote sha256))) (succeeded? (build-derivations %store (list drv)))) (and succeeded? (let ((p (derivation->output-path drv))) (and (equal? (string->utf8 "hello") (call-with-input-file p get-bytevector-all)) (bytevector? (query-path-hash %store p)))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 48: Bad file descriptor" status: 1] 9c896c0>)
Test begin:
  test-name: "fixed-output derivation: output paths are equal"
  source-file: "tests/derivations.scm"
  source-line: 187
  source-form: (test-assert "fixed-output derivation: output paths are equal" (let* ((builder1 (add-text-to-store %store "fixed-builder1.sh" "echo -n hello > $out" (quote ()))) (builder2 (add-text-to-store %store "fixed-builder2.sh" "echo hey; echo -n hello > $out" (quote ()))) (hash (sha256 (string->utf8 "hello"))) (drv1 (derivation %store "fixed" %bash (quasiquote ((unquote builder1))) #:hash hash #:hash-algo (quote sha256))) (drv2 (derivation %store "fixed" %bash (quasiquote ((unquote builder2))) #:hash hash #:hash-algo (quote sha256))) (succeeded? (build-derivations %store (list drv1 drv2)))) (and succeeded? (equal? (derivation->output-path drv1) (derivation->output-path drv2)))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1769537584: Bad file descriptor" status: 1] 9cc8678>)
Test begin:
  test-name: "fixed-output derivation, recursive"
  source-file: "tests/derivations.scm"
  source-line: 204
  source-form: (test-assert "fixed-output derivation, recursive" (let* ((builder (add-text-to-store %store "my-fixed-builder.sh" "echo -n hello > $out" (quote ()))) (hash (sha256 (string->utf8 "hello"))) (drv (derivation %store "fixed-rec" %bash (quasiquote ((unquote builder))) #:inputs (quasiquote (((unquote builder)))) #:hash (base32 "0sg9f58l1jj88w6pdrfdpj5x9b1zrwszk84j81zvby36q9whhhqa") #:hash-algo (quote sha256) #:recursive? #t)) (succeeded? (build-derivations %store (list drv)))) (and succeeded? (let ((p (derivation->output-path drv))) (and (equal? (string->utf8 "hello") (call-with-input-file p get-bytevector-all)) (bytevector? (query-path-hash %store p)))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1919221808: Bad file descriptor" status: 1] 9cdb228>)
Test begin:
  test-name: "derivation with a fixed-output input"
  source-file: "tests/derivations.scm"
  source-line: 221
  source-form: (test-assert "derivation with a fixed-output input" (let* ((builder1 (add-text-to-store %store "fixed-builder1.sh" "echo -n hello > $out" (quote ()))) (builder2 (add-text-to-store %store "fixed-builder2.sh" "echo hey; echo -n hello > $out" (quote ()))) (hash (sha256 (string->utf8 "hello"))) (fixed1 (derivation %store "fixed" %bash (quasiquote ((unquote builder1))) #:hash hash #:hash-algo (quote sha256))) (fixed2 (derivation %store "fixed" %bash (quasiquote ((unquote builder2))) #:hash hash #:hash-algo (quote sha256))) (fixed-out (derivation->output-path fixed1)) (builder3 (add-text-to-store %store "final-builder.sh" "echo $in ; (read -u 3 c; echo $c) 3< $in > $out" (quote ()))) (final1 (derivation %store "final" %bash (quasiquote ((unquote builder3))) #:env-vars (quasiquote (("in" unquote fixed-out))) #:inputs (quasiquote (((unquote %bash)) ((unquote builder3)) ((unquote fixed1)))))) (final2 (derivation %store "final" %bash (quasiquote ((unquote builder3))) #:env-vars (quasiquote (("in" unquote fixed-out))) #:inputs (quasiquote (((unquote %bash)) ((unquote builder3)) ((unquote fixed2)))))) (succeeded? (build-derivations %store (list final1 final2)))) (and succeeded? (equal? (derivation->output-path final1) (derivation->output-path final2)))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1862271024: Bad file descriptor" status: 1] 9d4c870>)
Test begin:
  test-name: "multiple-output derivation"
  source-file: "tests/derivations.scm"
  source-line: 255
  source-form: (test-assert "multiple-output derivation" (let* ((builder (add-text-to-store %store "my-fixed-builder.sh" "echo one > $out ; echo two > $second" (quote ()))) (drv (derivation %store "fixed" %bash (quasiquote ((unquote builder))) #:env-vars (quote (("HOME" . "/homeless") ("zzz" . "Z!") ("AAA" . "A!"))) #:inputs (quasiquote (((unquote %bash)) ((unquote builder)))) #:outputs (quote ("out" "second")))) (succeeded? (build-derivations %store (list drv)))) (and succeeded? (let ((one (derivation->output-path drv "out")) (two (derivation->output-path drv "second"))) (and (lset= equal? (derivation->output-paths drv) (quasiquote (("out" unquote one) ("second" unquote two)))) (eq? (quote one) (call-with-input-file one read)) (eq? (quote two) (call-with-input-file two read)))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1769537584: Bad file descriptor" status: 1] 9d85df8>)
Test begin:
  test-name: "multiple-output derivation, non-alphabetic order"
  source-file: "tests/derivations.scm"
  source-line: 276
  source-form: (test-assert "multiple-output derivation, non-alphabetic order" (let* ((builder (add-text-to-store %store "my-fixed-builder.sh" "echo one > $out ; echo two > $AAA" (quote ()))) (drv (derivation %store "fixed" %bash (quasiquote ((unquote builder))) #:inputs (quasiquote (((unquote %bash)) ((unquote builder)))) #:outputs (quote ("out" "AAA")))) (succeeded? (build-derivations %store (list drv)))) (and succeeded? (let ((one (derivation->output-path drv "out")) (two (derivation->output-path drv "AAA"))) (and (eq? (quote one) (call-with-input-file one read)) (eq? (quote two) (call-with-input-file two read)))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1835991088: Bad file descriptor" status: 1] 9d96af8>)
Test begin:
  test-name: "multiple-output derivation, derivation-path->output-path"
  source-file: "tests/derivations.scm"
  source-line: 293
  source-form: (test-assert "multiple-output derivation, derivation-path->output-path" (let* ((builder (add-text-to-store %store "builder.sh" "echo one > $out ; echo two > $second" (quote ()))) (drv (derivation %store "multiple" %bash (quasiquote ((unquote builder))) #:outputs (quote ("out" "second")))) (drv-file (derivation-file-name drv)) (one (derivation->output-path drv "out")) (two (derivation->output-path drv "second")) (first (derivation-path->output-path drv-file "out")) (second (derivation-path->output-path drv-file "second"))) (and (not (string=? one two)) (string-suffix? "-second" two) (string=? first one) (string=? second two))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "user of multiple-output derivation"
  source-file: "tests/derivations.scm"
  source-line: 310
  source-form: (test-assert "user of multiple-output derivation" (let* ((builder1 (add-text-to-store %store "my-mo-builder.sh" "echo one > $out ; echo two > $two" (quote ()))) (mdrv (derivation %store "multiple-output" %bash (quasiquote ((unquote builder1))) #:inputs (quasiquote (((unquote %bash)) ((unquote builder1)))) #:outputs (quote ("out" "two")))) (builder2 (add-text-to-store %store "my-mo-user-builder.sh" "read x < $one;\n                                         read y < $two;\n                                         echo \"($x $y)\" > $out" (quote ()))) (udrv (derivation %store "multiple-output-user" %bash (quasiquote ((unquote builder2))) #:env-vars (quasiquote (("one" unquote (derivation->output-path mdrv "out")) ("two" unquote (derivation->output-path mdrv "two")))) #:inputs (quasiquote (((unquote %bash)) ((unquote builder2)) ((unquote mdrv)) ((unquote mdrv) "two")))))) (and (build-derivations %store (list (pk (quote udrv) udrv))) (let ((p (derivation->output-path udrv))) (and (valid-path? %store p) (equal? (quote (one two)) (call-with-input-file p read)))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1835991088: Bad file descriptor" status: 1] 9dc5fa8>)
Test begin:
  test-name: "derivation with #:references-graphs"
  source-file: "tests/derivations.scm"
  source-line: 343
  source-form: (test-assert "derivation with #:references-graphs" (let* ((input1 (add-text-to-store %store "foo" "hello" (list %bash))) (input2 (add-text-to-store %store "bar" (number->string (random 7777)) (list input1))) (builder (add-text-to-store %store "build-graph" (format #f "\n~a $out\n (while read l ; do echo $l ; done) < bash > $out/bash\n (while read l ; do echo $l ; done) < input1 > $out/input1\n (while read l ; do echo $l ; done) < input2 > $out/input2" %mkdir) (list %mkdir))) (drv (derivation %store "closure-graphs" %bash (quasiquote ((unquote builder))) #:references-graphs (quasiquote (("bash" unquote %bash) ("input1" unquote input1) ("input2" unquote input2))) #:inputs (quasiquote (((unquote %bash)) ((unquote builder)))))) (out (derivation->output-path drv))) (define (deps path . deps) (let ((count (length deps))) (string-append path "\n\n" (number->string count) "\n" (string-join (sort deps string<?) "\n") (if (zero? count) "" "\n")))) (and (build-derivations %store (list drv)) (equal? (directory-contents out get-string-all) (quasiquote (("/bash" unquote (string-append %bash "\n\n0\n")) ("/input1" unquote (if (string>? input1 %bash) (string-append (deps %bash) (deps input1 %bash)) (string-append (deps input1 %bash) (deps %bash)))) ("/input2" unquote (string-concatenate (map cdr (sort (map (lambda (p d) (cons p (apply deps p d))) (list %bash input1 input2) (list (quote ()) (list %bash) (list input1))) (lambda (x y) (match x ((p1 . _) (match y ((p2 . _) (string<? p1 p2))))))))))))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1599602736: Bad file descriptor" status: 1] 9e1cae0>)
Test begin:
  test-name: "build derivation with coreutils"
  source-file: "tests/derivations.scm"
  source-line: 402
  source-form: (test-assert "build derivation with coreutils" (let* ((builder (add-text-to-store %store "build-with-coreutils.sh" "echo $PATH ; mkdir --version ; mkdir $out ; touch $out/good" (quote ()))) (drv (derivation %store "foo" %bash (quasiquote ((unquote builder))) #:env-vars (quasiquote (("PATH" unquote (string-append (derivation->output-path %coreutils) "/bin")))) #:inputs (quasiquote (((unquote builder)) ((unquote %coreutils)))))) (succeeded? (build-derivations %store (list drv)))) (and succeeded? (let ((p (derivation->output-path drv))) (and (valid-path? %store p) (file-exists? (string-append p "/good")))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 2424880: Bad file descriptor" status: 1] 9a05d38>)
Test begin:
  test-name: "build-expression->derivation and derivation-prerequisites"
  source-file: "tests/derivations.scm"
  source-line: 425
  source-form: (test-assert "build-expression->derivation and derivation-prerequisites" (let ((drv (build-expression->derivation %store "fail" #f))) (any (match-lambda (($ <derivation-input> path) (string=? path (derivation-file-name (%guile-for-build))))) (derivation-prerequisites drv))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "build-expression->derivation without inputs"
  source-file: "tests/derivations.scm"
  source-line: 432
  source-form: (test-assert "build-expression->derivation without inputs" (let* ((builder (quote (begin (mkdir %output) (call-with-output-file (string-append %output "/test") (lambda (p) (display (quote (hello guix)) p)))))) (drv (build-expression->derivation %store "goo" builder)) (succeeded? (build-derivations %store (list drv)))) (and succeeded? (let ((p (derivation->output-path drv))) (equal? (quote (hello guix)) (call-with-input-file (string-append p "/test") read))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1769537584: Bad file descriptor" status: 1] 9b6e4e0>)
Test begin:
  test-name: "build-expression->derivation and max-silent-time"
  source-file: "tests/derivations.scm"
  source-line: 445
  source-form: (test-assert "build-expression->derivation and max-silent-time" (let* ((store (let ((s (open-connection))) (set-build-options s #:max-silent-time 1) s)) (builder (quote (begin (sleep 100) (mkdir %output) #t))) (drv (build-expression->derivation store "silent" builder)) (out-path (derivation->output-path drv))) (guard (c ((nix-protocol-error? c) (and (string-contains (nix-protocol-error-message c) "failed") (not (valid-path? store out-path))))) (build-derivations store (list drv)) #f)))
Test end:
  result-kind: fail
  actual-value: #f
Test begin:
  test-name: "build-expression->derivation and timeout"
  source-file: "tests/derivations.scm"
  source-line: 459
  source-form: (test-assert "build-expression->derivation and timeout" (let* ((store (let ((s (open-connection))) (set-build-options s #:timeout 1) s)) (builder (quote (begin (sleep 100) (mkdir %output) #t))) (drv (build-expression->derivation store "slow" builder)) (out-path (derivation->output-path drv))) (guard (c ((nix-protocol-error? c) (and (string-contains (nix-protocol-error-message c) "failed") (not (valid-path? store out-path))))) (build-derivations store (list drv)) #f)))
Test end:
  result-kind: fail
  actual-value: #f
Test begin:
  test-name: "build-expression->derivation and derivation-prerequisites-to-build"
  source-file: "tests/derivations.scm"
  source-line: 473
  source-form: (test-assert "build-expression->derivation and derivation-prerequisites-to-build" (let ((drv (build-expression->derivation %store "fail" #f))) (null? (derivation-prerequisites-to-build %store drv))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "derivation-prerequisites-to-build when outputs already present"
  source-file: "tests/derivations.scm"
  source-line: 479
  source-form: (test-assert "derivation-prerequisites-to-build when outputs already present" (let* ((builder (quote (begin (mkdir %output) #t))) (input-drv (build-expression->derivation %store "input" builder)) (input-path (derivation-output-path (assoc-ref (derivation-outputs input-drv) "out"))) (drv (build-expression->derivation %store "something" builder #:inputs (quasiquote (("i" (unquote input-drv)))))) (output (derivation->output-path drv))) (when (valid-path? %store input-path) (delete-paths %store (list input-path))) (when (valid-path? %store output) (delete-paths %store (list output))) (and (equal? (map derivation-input-path (derivation-prerequisites-to-build %store drv)) (list (derivation-file-name input-drv))) (build-derivations %store (list drv)) (delete-paths %store (list input-path)) (not (valid-path? %store input-path)) (null? (derivation-prerequisites-to-build %store drv)))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1835991088: Bad file descriptor" status: 1] 9bbaed0>)
Test begin:
  test-name: "derivation-prerequisites-to-build and substitutes"
  source-file: "tests/derivations.scm"
  source-line: 509
  source-form: (test-assert "derivation-prerequisites-to-build and substitutes" (let* ((store (open-connection)) (drv (build-expression->derivation store "prereq-subst" (random 1000))) (output (derivation->output-path drv)) (dir (and=> (getenv "GUIX_BINARY_SUBSTITUTE_URL") (compose uri-path string->uri)))) (call-with-output-file (string-append dir "/nix-cache-info") (lambda (p) (format p "StoreDir: ~a\nWantMassQuery: 0\n" (%store-prefix)))) (call-with-output-file (string-append dir "/" (store-path-hash-part output) ".narinfo") (lambda (p) (format p "StorePath: ~a\nURL: ~a\nCompression: none\nNarSize: 1234\nReferences: \nSystem: ~a\nDeriver: ~a~%" output (string-append dir "/example.nar") (%current-system) (basename (derivation-file-name drv))))) (set-build-options store #:use-substitutes? #t) (let-values (((build download) (derivation-prerequisites-to-build store drv)) ((build* download*) (derivation-prerequisites-to-build store drv #:use-substitutes? #f))) (pk build download build* download*) (and (null? build) (equal? download (list output)) (null? download*) (null? build*)))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "build-expression->derivation with expression returning #f"
  source-file: "tests/derivations.scm"
  source-line: 551
  source-form: (test-assert "build-expression->derivation with expression returning #f" (let* ((builder (quote (begin (mkdir %output) #f))) (drv (build-expression->derivation %store "fail" builder)) (out-path (derivation->output-path drv))) (guard (c ((nix-protocol-error? c) (and (string-match "build .* failed" (nix-protocol-error-message c)) (not (valid-path? %store out-path))))) (build-derivations %store (list drv)) #f)))
Test end:
  result-kind: fail
  actual-value: #f
Test begin:
  test-name: "build-expression->derivation with two outputs"
  source-file: "tests/derivations.scm"
  source-line: 566
  source-form: (test-assert "build-expression->derivation with two outputs" (let* ((builder (quote (begin (call-with-output-file (assoc-ref %outputs "out") (lambda (p) (display (quote (hello)) p))) (call-with-output-file (assoc-ref %outputs "second") (lambda (p) (display (quote (world)) p)))))) (drv (build-expression->derivation %store "double" builder #:outputs (quote ("out" "second")))) (succeeded? (build-derivations %store (list drv)))) (and succeeded? (let ((one (derivation->output-path drv)) (two (derivation->output-path drv "second"))) (and (equal? (quote (hello)) (call-with-input-file one read)) (equal? (quote (world)) (call-with-input-file two read)))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1599602736: Bad file descriptor" status: 1] 9bfc3a8>)
Test begin:
  test-name: "build-expression->derivation with one input"
  source-file: "tests/derivations.scm"
  source-line: 585
  source-form: (test-assert "build-expression->derivation with one input" (let* ((builder (quote (call-with-output-file %output (lambda (p) (let ((cu (assoc-ref %build-inputs "cu"))) (close 1) (dup2 (port->fdes p) 1) (execl (string-append cu "/bin/uname") "uname" "-a")))))) (drv (build-expression->derivation %store "uname" builder #:inputs (quasiquote (("cu" (unquote %coreutils)))))) (succeeded? (build-derivations %store (list drv)))) (and succeeded? (let ((p (derivation->output-path drv))) (string-contains (call-with-input-file p read-line) "GNU")))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1835991088: Bad file descriptor" status: 1] 9fc1ba0>)
Test begin:
  test-name: "imported-files"
  source-file: "tests/derivations.scm"
  source-line: 601
  source-form: (test-assert "imported-files" (let* ((files (quasiquote (("x" unquote (search-path %load-path "ice-9/q.scm")) ("a/b/c" unquote (search-path %load-path "guix/derivations.scm")) ("p/q" unquote (search-path %load-path "guix.scm")) ("p/z" unquote (search-path %load-path "guix/store.scm"))))) (drv (imported-files %store files))) (and (build-derivations %store (list drv)) (let ((dir (derivation->output-path drv))) (every (match-lambda ((path . source) (equal? (call-with-input-file (string-append dir "/" path) get-bytevector-all) (call-with-input-file source get-bytevector-all)))) files)))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "build-expression->derivation with modules"
  source-file: "tests/derivations.scm"
  source-line: 618
  source-form: (test-assert "build-expression->derivation with modules" (let* ((builder (quasiquote (begin (use-modules (guix build utils)) (let ((out (assoc-ref %outputs "out"))) (mkdir-p (string-append out "/guile/guix/nix")) #t)))) (drv (build-expression->derivation %store "test-with-modules" builder #:modules (quote ((guix build utils)))))) (and (build-derivations %store (list drv)) (let* ((p (derivation->output-path drv)) (s (stat (string-append p "/guile/guix/nix")))) (eq? (stat:type s) (quote directory))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1769537584: Bad file descriptor" status: 1] a00f798>)
Test begin:
  test-name: "build-expression->derivation: same fixed-output path"
  source-file: "tests/derivations.scm"
  source-line: 633
  source-form: (test-assert "build-expression->derivation: same fixed-output path" (let* ((builder1 (quote (call-with-output-file %output (lambda (p) (write "hello" p))))) (builder2 (quote (call-with-output-file (pk (quote difference-here!) %output) (lambda (p) (write "hello" p))))) (hash (sha256 (string->utf8 "hello"))) (input1 (build-expression->derivation %store "fixed" builder1 #:hash hash #:hash-algo (quote sha256))) (input2 (build-expression->derivation %store "fixed" builder2 #:hash hash #:hash-algo (quote sha256))) (succeeded? (build-derivations %store (list input1 input2)))) (and succeeded? (not (string=? (derivation-file-name input1) (derivation-file-name input2))) (string=? (derivation->output-path input1) (derivation->output-path input2)))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1769537584: Bad file descriptor" status: 1] a07f8a0>)
Test begin:
  test-name: "build-expression->derivation with a fixed-output input"
  source-file: "tests/derivations.scm"
  source-line: 654
  source-form: (test-assert "build-expression->derivation with a fixed-output input" (let* ((builder1 (quote (call-with-output-file %output (lambda (p) (write "hello" p))))) (builder2 (quote (call-with-output-file (pk (quote difference-here!) %output) (lambda (p) (write "hello" p))))) (hash (sha256 (string->utf8 "hello"))) (input1 (build-expression->derivation %store "fixed" builder1 #:hash hash #:hash-algo (quote sha256))) (input2 (build-expression->derivation %store "fixed" builder2 #:hash hash #:hash-algo (quote sha256))) (builder3 (quote (let ((input (assoc-ref %build-inputs "input"))) (call-with-output-file %output (lambda (out) (format #f "My input is ~a.~%" input)))))) (final1 (build-expression->derivation %store "final" builder3 #:inputs (quasiquote (("input" (unquote input1)))))) (final2 (build-expression->derivation %store "final" builder3 #:inputs (quasiquote (("input" (unquote input2))))))) (and (string=? (derivation->output-path final1) (derivation->output-path final2)) (string=? (derivation->output-path final1) (derivation-path->output-path (derivation-file-name final1))) (build-derivations %store (list final1 final2)))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1599602736: Bad file descriptor" status: 1] a0abab0>)
Test begin:
  test-name: "build-expression->derivation produces recursive fixed-output"
  source-file: "tests/derivations.scm"
  source-line: 685
  source-form: (test-assert "build-expression->derivation produces recursive fixed-output" (let* ((builder (quote (begin (use-modules (srfi srfi-26)) (mkdir %output) (chdir %output) (call-with-output-file "exe" (cut display "executable" <>)) (chmod "exe" 511) (symlink "exe" "symlink") (mkdir "subdir")))) (drv (build-expression->derivation %store "fixed-rec" builder #:hash-algo (quote sha256) #:hash (base32 "10k1lw41wyrjf9mxydi0is5nkpynlsvgslinics4ppir13g7d74p") #:recursive? #t))) (and (build-derivations %store (list drv)) (let* ((dir (derivation->output-path drv)) (exe (string-append dir "/exe")) (link (string-append dir "/symlink")) (subdir (string-append dir "/subdir"))) (and (executable-file? exe) (string=? "executable" (call-with-input-file exe get-string-all)) (string=? "exe" (readlink link)) (file-is-directory? subdir))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1078001712: Bad file descriptor" status: 1] a0cf300>)
Test begin:
  test-name: "build-expression->derivation uses recursive fixed-output"
  source-file: "tests/derivations.scm"
  source-line: 711
  source-form: (test-assert "build-expression->derivation uses recursive fixed-output" (let* ((builder (quote (call-with-output-file %output (lambda (port) (display "hello" port))))) (fixed (build-expression->derivation %store "small-fixed-rec" builder #:hash-algo (quote sha256) #:hash (base32 "0sg9f58l1jj88w6pdrfdpj5x9b1zrwszk84j81zvby36q9whhhqa") #:recursive? #t)) (in (derivation->output-path fixed)) (builder (quasiquote (begin (mkdir %output) (chdir %output) (symlink (unquote in) "symlink")))) (drv (build-expression->derivation %store "fixed-rec-user" builder #:inputs (quasiquote (("fixed" (unquote fixed))))))) (and (build-derivations %store (list drv)) (let ((out (derivation->output-path drv))) (string=? (readlink (string-append out "/symlink")) in)))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 48: Bad file descriptor" status: 1] a0e9270>)
Test begin:
  test-name: "build-expression->derivation with #:references-graphs"
  source-file: "tests/derivations.scm"
  source-line: 733
  source-form: (test-assert "build-expression->derivation with #:references-graphs" (let* ((input (add-text-to-store %store "foo" "hello" (list %bash %mkdir))) (builder (quote (copy-file "input" %output))) (drv (build-expression->derivation %store "references-graphs" builder #:references-graphs (quasiquote (("input" unquote input))))) (out (derivation->output-path drv))) (define (deps path . deps) (let ((count (length deps))) (string-append path "\n\n" (number->string count) "\n" (string-join (sort deps string<?) "\n") (if (zero? count) "" "\n")))) (and (build-derivations %store (list drv)) (equal? (call-with-input-file out get-string-all) (string-concatenate (map cdr (sort (map (lambda (p d) (cons p (apply deps p d))) (list input %bash %mkdir) (list (list %bash %mkdir) (quote ()) (quote ()))) (lambda (x y) (match x ((p1 . _) (match y ((p2 . _) (string<? p1 p2)))))))))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 2424880: Bad file descriptor" status: 1] a13bcf0>)
Test begin:
  test-name: "map-derivation"
  source-file: "tests/derivations.scm"
  source-line: 765
  source-form: (test-equal "map-derivation" "hello" (let* ((joke (package-derivation %store guile-1.8)) (good (package-derivation %store %bootstrap-guile)) (drv1 (build-expression->derivation %store "original-drv1" #f #:guile-for-build joke)) (drv2 (build-expression->derivation %store "original-drv2" (quote (call-with-output-file %output (lambda (p) (display "hello" p)))))) (drv3 (build-expression->derivation %store "drv-to-remap" (quote (let ((in (assoc-ref %build-inputs "in"))) (copy-file in %output))) #:inputs (quasiquote (("in" (unquote drv1)))) #:guile-for-build joke)) (drv4 (map-derivation %store drv3 (quasiquote (((unquote drv1) unquote drv2) ((unquote joke) unquote good))))) (out (derivation->output-path drv4))) (and (build-derivations %store (list (pk (quote remapped) drv4))) (call-with-input-file out get-string-all))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1835991088: Bad file descriptor" status: 1] 9d59180>)
  expected-value: "hello"
Test begin:
  test-name: "map-derivation, sources"
  source-file: "tests/derivations.scm"
  source-line: 788
  source-form: (test-equal "map-derivation, sources" "hello" (let* ((script1 (add-text-to-store %store "fail.sh" "exit 1")) (script2 (add-text-to-store %store "hi.sh" "echo -n hello > $out")) (bash-full (package-derivation %store (@ (gnu packages bash) bash))) (drv1 (derivation %store "drv-to-remap" (derivation->output-path bash-full) (quasiquote ("-e" (unquote script1))) #:inputs (quasiquote (((unquote bash-full)) ((unquote script1)))))) (drv2 (map-derivation %store drv1 (quasiquote (((unquote bash-full) unquote %bash) ((unquote script1) unquote script2))))) (out (derivation->output-path drv2))) (and (build-derivations %store (list (pk (quote remapped*) drv2))) (call-with-input-file out get-string-all))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1694498864: Bad file descriptor" status: 1] 9dc2f48>)
  expected-value: "hello"
Group end: derivations
# of expected passes      10
# of unexpected failures  26

[-- Attachment #1.4: gexp.log --]
[-- Type: text/plain, Size: 8693 bytes --]

%%%% Starting test gexp
Group begin: gexp
Test begin:
  test-name: "no refs"
  source-file: "tests/gexp.scm"
  source-line: 61
  source-form: (test-equal "no refs" (quote (display "hello!")) (let ((exp (gexp (display "hello!")))) (and (gexp? exp) (null? (gexp-inputs exp)) (gexp->sexp* exp))))
Test end:
  result-kind: pass
  actual-value: (display "hello!")
  expected-value: (display "hello!")
Test begin:
  test-name: "unquote"
  source-file: "tests/gexp.scm"
  source-line: 68
  source-form: (test-equal "unquote" (quote (display (quasiquote (foo (unquote (+ 2 3)))))) (let ((exp (gexp (display (quasiquote (foo (unquote (+ 2 3)))))))) (and (gexp? exp) (null? (gexp-inputs exp)) (gexp->sexp* exp))))
Test end:
  result-kind: pass
  actual-value: (display (quasiquote (foo (unquote (+ 2 3)))))
  expected-value: (display (quasiquote (foo (unquote (+ 2 3)))))
Test begin:
  test-name: "one input package"
  source-file: "tests/gexp.scm"
  source-line: 75
  source-form: (test-assert "one input package" (let ((exp (gexp (display (ungexp coreutils))))) (and (gexp? exp) (match (gexp-inputs exp) (((p "out")) (eq? p coreutils))) (equal? (quasiquote (display (unquote (derivation->output-path (package-derivation %store coreutils))))) (gexp->sexp* exp)))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "one input origin"
  source-file: "tests/gexp.scm"
  source-line: 85
  source-form: (test-assert "one input origin" (let ((exp (gexp (display (ungexp (package-source coreutils)))))) (and (gexp? exp) (match (gexp-inputs exp) (((o "out")) (eq? o (package-source coreutils)))) (equal? (quasiquote (display (unquote (derivation->output-path (package-source-derivation %store (package-source coreutils)))))) (gexp->sexp* exp)))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "same input twice"
  source-file: "tests/gexp.scm"
  source-line: 96
  source-form: (test-assert "same input twice" (let ((exp (gexp (begin (display (ungexp coreutils)) (display (ungexp coreutils)))))) (and (gexp? exp) (match (gexp-inputs exp) (((p "out")) (eq? p coreutils))) (let ((e (quasiquote (display (unquote (derivation->output-path (package-derivation %store coreutils))))))) (equal? (quasiquote (begin (unquote e) (unquote e))) (gexp->sexp* exp))))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "two input packages, one derivation, one file"
  source-file: "tests/gexp.scm"
  source-line: 108
  source-form: (test-assert "two input packages, one derivation, one file" (let* ((drv (build-expression->derivation %store "foo" (quote bar) #:guile-for-build (package-derivation %store %bootstrap-guile))) (txt (add-text-to-store %store "foo" "Hello, world!")) (exp (gexp (begin (display (ungexp coreutils)) (display (ungexp %bootstrap-guile)) (display (ungexp drv)) (display (ungexp txt)))))) (define (match-input thing) (match-lambda ((drv-or-pkg _ ...) (eq? thing drv-or-pkg)))) (and (gexp? exp) (= 4 (length (gexp-inputs exp))) (every (lambda (input) (find (match-input input) (gexp-inputs exp))) (list drv coreutils %bootstrap-guile txt)) (let ((e0 (quasiquote (display (unquote (derivation->output-path (package-derivation %store coreutils)))))) (e1 (quasiquote (display (unquote (derivation->output-path (package-derivation %store %bootstrap-guile)))))) (e2 (quasiquote (display (unquote (derivation->output-path drv))))) (e3 (quasiquote (display (unquote txt))))) (equal? (quasiquote (begin (unquote e0) (unquote e1) (unquote e2) (unquote e3))) (gexp->sexp* exp))))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "input list"
  source-file: "tests/gexp.scm"
  source-line: 136
  source-form: (test-assert "input list" (let ((exp (gexp (display (quote (ungexp (list %bootstrap-guile coreutils)))))) (guile (derivation->output-path (package-derivation %store %bootstrap-guile))) (cu (derivation->output-path (package-derivation %store coreutils)))) (and (lset= equal? (quasiquote (((unquote %bootstrap-guile) "out") ((unquote coreutils) "out"))) (gexp-inputs exp)) (equal? (quasiquote (display (quote ((unquote guile) (unquote cu))))) (gexp->sexp* exp)))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "input list splicing"
  source-file: "tests/gexp.scm"
  source-line: 149
  source-form: (test-assert "input list splicing" (let* ((inputs (list (list glibc "debug") %bootstrap-guile)) (outputs (list (derivation->output-path (package-derivation %store glibc) "debug") (derivation->output-path (package-derivation %store %bootstrap-guile)))) (exp (gexp (list (ungexp-splicing (cons (+ 2 3) inputs)))))) (and (lset= equal? (quasiquote (((unquote glibc) "debug") ((unquote %bootstrap-guile) "out"))) (gexp-inputs exp)) (equal? (gexp->sexp* exp) (quasiquote (list (unquote-splicing (cons 5 outputs))))))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "gexp->file"
  source-file: "tests/gexp.scm"
  source-line: 163
  source-form: (test-assert "gexp->file" (run-with-store %store (mlet* %store-monad ((exp -> (gexp (display (ungexp %bootstrap-guile)))) (guile (package-file %bootstrap-guile)) (sexp (gexp->sexp exp)) (drv (gexp->file "foo" exp)) (out -> (derivation->output-path drv)) (done (built-derivations (list drv))) (refs ((store-lift references) out))) (return (and (equal? sexp (call-with-input-file out read)) (equal? (list guile) refs)))) #:guile-for-build guile-for-build))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "gexp->derivation"
  source-file: "tests/gexp.scm"
  source-line: 174
  source-form: (test-assert "gexp->derivation" (run-with-store %store (mlet* %store-monad ((file (text-file "foo" "Hello, world!")) (exp -> (gexp (begin (mkdir (ungexp output)) (chdir (ungexp output)) (symlink (string-append (ungexp %bootstrap-guile) "/bin/guile") "foo") (symlink (ungexp file) (ungexp output "2nd"))))) (drv (gexp->derivation "foo" exp)) (out -> (derivation->output-path drv)) (out2 -> (derivation->output-path drv "2nd")) (done (built-derivations (list drv))) (refs ((store-lift references) out)) (refs2 ((store-lift references) out2)) (guile (package-file %bootstrap-guile "bin/guile"))) (return (and (string=? (readlink (string-append out "/foo")) guile) (string=? (readlink out2) file) (equal? refs (list (dirname (dirname guile)))) (equal? refs2 (list file))))) #:guile-for-build guile-for-build))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "gexp->derivation, composed gexps"
  source-file: "tests/gexp.scm"
  source-line: 198
  source-form: (test-assert "gexp->derivation, composed gexps" (run-with-store %store (mlet* %store-monad ((exp0 -> (gexp (begin (mkdir (ungexp output)) (chdir (ungexp output))))) (exp1 -> (gexp (symlink (string-append (ungexp %bootstrap-guile) "/bin/guile") "foo"))) (exp -> (gexp (begin (ungexp exp0) (ungexp exp1)))) (drv (gexp->derivation "foo" exp)) (out -> (derivation->output-path drv)) (done (built-derivations (list drv))) (guile (package-file %bootstrap-guile "bin/guile"))) (return (string=? (readlink (string-append out "/foo")) guile))) #:guile-for-build guile-for-build))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "gexp->script"
  source-file: "tests/gexp.scm"
  source-line: 214
  source-form: (test-assert "gexp->script" (run-with-store %store (mlet* %store-monad ((n -> (random (expt 2 50))) (exp -> (gexp (system* (string-append (ungexp %bootstrap-guile) "/bin/guile") "-c" (object->string (quote (display (expt (ungexp n) 2))))))) (drv (gexp->script "guile-thing" exp #:guile %bootstrap-guile)) (out -> (derivation->output-path drv)) (done (built-derivations (list drv)))) (let* ((pipe (open-input-pipe out)) (str (get-string-all pipe))) (return (and (zero? (close-pipe pipe)) (= (expt n 2) (string->number str)))))) #:guile-for-build guile-for-build))
Test end:
  result-kind: fail
  actual-value: #f
Test begin:
  test-name: "sugar"
  source-file: "tests/gexp.scm"
  source-line: 231
  source-form: (test-equal "sugar" (quote (gexp (foo (ungexp bar) (ungexp baz "out") (ungexp (chbouib 42)) (ungexp-splicing (list x y z))))) (quote (gexp (foo (ungexp bar) (ungexp baz "out") (ungexp (chbouib 42)) (ungexp-splicing (list x y z))))))
Test end:
  result-kind: pass
  actual-value: (gexp (foo (ungexp bar) (ungexp baz "out") (ungexp (chbouib 42)) (ungexp-splicing (list x y z))))
  expected-value: (gexp (foo (ungexp bar) (ungexp baz "out") (ungexp (chbouib 42)) (ungexp-splicing (list x y z))))
Group end: gexp
# of expected passes      12
# of unexpected failures  1

[-- Attachment #1.5: monads.log --]
[-- Type: text/plain, Size: 5908 bytes --]

%%%% Starting test monads
Group begin: monads
Test begin:
  test-name: "monad?"
  source-file: "tests/monads.scm"
  source-line: 51
  source-form: (test-assert "monad?" (and (every monad? %monads) (every (compose procedure? monad-bind) %monads) (every (compose procedure? monad-return) %monads)))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "left identity"
  source-file: "tests/monads.scm"
  source-line: 58
  source-form: (test-assert "left identity" (every (lambda (monad run) (let ((number (random 777))) (with-monad monad (define (f x) (return (* (#{1+}# number) 2))) (= (run (>>= (return number) f)) (run (f number)))))) %monads %monad-run))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "right identity"
  source-file: "tests/monads.scm"
  source-line: 70
  source-form: (test-assert "right identity" (every (lambda (monad run) (with-monad monad (let ((number (return (random 777)))) (= (run (>>= number return)) (run number))))) %monads %monad-run))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "associativity"
  source-file: "tests/monads.scm"
  source-line: 79
  source-form: (test-assert "associativity" (every (lambda (monad run) (with-monad monad (define (f x) (return (+ 1 x))) (define (g x) (return (* 2 x))) (let ((number (return (random 777)))) (= (run (>>= (>>= number f) g)) (run (>>= number (lambda (x) (>>= (f x) g)))))))) %monads %monad-run))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "lift"
  source-file: "tests/monads.scm"
  source-line: 93
  source-form: (test-assert "lift" (every (lambda (monad run) (let ((f (lift1 #{1+}# monad))) (with-monad monad (let ((number (random 777))) (= (run (>>= (return number) f)) (#{1+}# number)))))) %monads %monad-run))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "mlet* + text-file + package-file"
  source-file: "tests/monads.scm"
  source-line: 103
  source-form: (test-assert "mlet* + text-file + package-file" (run-with-store %store (mlet* %store-monad ((guile (package-file %bootstrap-guile "bin/guile")) (file (text-file "monadic" guile))) (return (equal? (call-with-input-file file get-string-all) guile))) #:guile-for-build (package-derivation %store %bootstrap-guile)))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "mlet* + derivation-expression"
  source-file: "tests/monads.scm"
  source-line: 114
  source-form: (test-assert "mlet* + derivation-expression" (run-with-store %store (mlet* %store-monad ((guile (package-file %bootstrap-guile "bin/guile")) (gdrv (package->derivation %bootstrap-guile)) (exp -> (quasiquote (let ((out (assoc-ref %outputs "out"))) (mkdir out) (symlink (unquote guile) (string-append out "/guile-rocks"))))) (drv (derivation-expression "rocks" exp #:inputs (quasiquote (("g" (unquote gdrv)))))) (out -> (derivation->output-path drv)) (built? (built-derivations (list drv)))) (return (and built? (equal? guile (readlink (string-append out "/guile-rocks")))))) #:guile-for-build (package-derivation %store %bootstrap-guile)))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 48: Bad file descriptor" status: 1] 9db7d98>)
Test begin:
  test-name: "text-file*"
  source-file: "tests/monads.scm"
  source-line: 132
  source-form: (test-assert "text-file*" (let ((references (store-lift references))) (run-with-store %store (mlet* %store-monad ((drv (package->derivation %bootstrap-guile)) (guile -> (derivation->output-path drv)) (file (text-file "bar" "This is bar.")) (text (text-file* "foo" %bootstrap-guile "/bin/guile " (quasiquote ((unquote %bootstrap-guile) "out")) "/bin/guile " drv "/bin/guile " file)) (done (built-derivations (list text))) (out -> (derivation->output-path text)) (refs (references out))) (return (and (lset= string=? refs (list guile file)) (equal? (call-with-input-file out get-string-all) (string-append guile "/bin/guile " guile "/bin/guile " guile "/bin/guile " file))))) #:guile-for-build (package-derivation %store %bootstrap-guile))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 878772272: Bad file descriptor" status: 1] 9b57348>)
Test begin:
  test-name: "mapm"
  source-file: "tests/monads.scm"
  source-line: 156
  source-form: (test-assert "mapm" (every (lambda (monad run) (with-monad monad (equal? (run (mapm monad (lift1 #{1+}# monad) (map return (iota 10)))) (map #{1+}# (iota 10))))) %monads %monad-run))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "sequence"
  source-file: "tests/monads.scm"
  source-line: 164
  source-form: (test-assert "sequence" (every (lambda (monad run) (let* ((input (iota 100)) (order (quote ()))) (define (frob i) (set! order (cons i order)) i) (and (equal? input (run (sequence monad (map (lift1 frob monad) input)))) (equal? order (reverse input))))) %monads %monad-run))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "listm"
  source-file: "tests/monads.scm"
  source-line: 183
  source-form: (test-assert "listm" (every (lambda (monad run) (run (with-monad monad (let ((lst (listm monad (return 1) (return 2) (return 3)))) (mlet monad ((lst lst)) (return (equal? (quote (1 2 3)) lst))))))) %monads %monad-run))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "anym"
  source-file: "tests/monads.scm"
  source-line: 193
  source-form: (test-assert "anym" (every (lambda (monad run) (eq? (run (with-monad monad (let ((lst (list (return 1) (return 2) (return 3)))) (anym monad (lambda (x) (and (odd? x) (quote odd!))) lst)))) (quote odd!))) %monads %monad-run))
Test end:
  result-kind: pass
  actual-value: #t
Group end: monads
# of expected passes      10
# of unexpected failures  2

[-- Attachment #1.6: packages.log --]
[-- Type: text/plain, Size: 15404 bytes --]

%%%% Starting test packages
Group begin: packages
Test begin:
  test-name: "package-field-location"
  source-file: "tests/packages.scm"
  source-line: 58
  source-form: (test-assert "package-field-location" (let () (define (goto port line column) (unless (and (= (port-column port) (- column 1)) (= (port-line port) (- line 1))) (unless (eof-object? (get-char port)) (goto port line column)))) (define read-at (match-lambda (($ <location> file line column) (call-with-input-file (search-path %load-path file) (lambda (port) (goto port line column) (read port)))))) (and (member (read-at (package-field-location %bootstrap-guile (quote name))) (let ((name (package-name %bootstrap-guile))) (list name (quasiquote (name (unquote name)))))) (member (read-at (package-field-location %bootstrap-guile (quote version))) (let ((version (package-version %bootstrap-guile))) (list version (quasiquote (version (unquote version)))))) (not (package-field-location %bootstrap-guile (quote does-not-exist))))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "package-field-location, relative file name"
  source-file: "tests/packages.scm"
  source-line: 85
  source-form: (test-equal "package-field-location, relative file name" (location-file (package-location %bootstrap-guile)) (with-fluids ((%file-port-name-canonicalization (quote absolute))) (location-file (package-field-location %bootstrap-guile (quote version)))))
Test end:
  result-kind: pass
  actual-value: "gnu/packages/bootstrap.scm"
  expected-value: "gnu/packages/bootstrap.scm"
Test begin:
  test-name: "package-transitive-inputs"
  source-file: "tests/packages.scm"
  source-line: 90
  source-form: (test-assert "package-transitive-inputs" (let* ((a (dummy-package "a")) (b (dummy-package "b" (propagated-inputs (quasiquote (("a" (unquote a))))))) (c (dummy-package "c" (inputs (quasiquote (("a" (unquote a))))))) (d (dummy-package "d" (propagated-inputs (quasiquote (("x" "something.drv")))))) (e (dummy-package "e" (inputs (quasiquote (("b" (unquote b)) ("c" (unquote c)) ("d" (unquote d)))))))) (and (null? (package-transitive-inputs a)) (equal? (quasiquote (("a" (unquote a)))) (package-transitive-inputs b)) (equal? (quasiquote (("a" (unquote a)))) (package-transitive-inputs c)) (equal? (package-propagated-inputs d) (package-transitive-inputs d)) (equal? (quasiquote (("b" (unquote b)) ("b/a" (unquote a)) ("c" (unquote c)) ("d" (unquote d)) ("d/x" "something.drv"))) (pk (quote x) (package-transitive-inputs e))))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "package-source-derivation, file"
  source-file: "tests/packages.scm"
  source-line: 111
  source-form: (test-assert "package-source-derivation, file" (let* ((file (search-path %load-path "guix.scm")) (package (package (inherit (dummy-package "p")) (source file))) (source (package-source-derivation %store (package-source package)))) (and (store-path? source) (valid-path? %store source) (equal? (call-with-input-file source get-bytevector-all) (call-with-input-file file get-bytevector-all)))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "package-source-derivation, store path"
  source-file: "tests/packages.scm"
  source-line: 122
  source-form: (test-assert "package-source-derivation, store path" (let* ((file (add-to-store %store "guix.scm" #t "sha256" (search-path %load-path "guix.scm"))) (package (package (inherit (dummy-package "p")) (source file))) (source (package-source-derivation %store (package-source package)))) (string=? file source)))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "package-source-derivation, indirect store path"
  source-file: "tests/packages.scm"
  source-line: 131
  source-form: (test-assert "package-source-derivation, indirect store path" (let* ((dir (add-to-store %store "guix-build" #t "sha256" (dirname (search-path %load-path "guix/build/utils.scm")))) (package (package (inherit (dummy-package "p")) (source (string-append dir "/utils.scm")))) (source (package-source-derivation %store (package-source package)))) (and (direct-store-path? source) (string-suffix? "utils.scm" source))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "package-source-derivation, snippet"
  source-file: "tests/packages.scm"
  source-line: 144
  source-form: (test-equal "package-source-derivation, snippet" "OK" (let* ((file (search-bootstrap-binary "guile-2.0.9.tar.xz" (%current-system))) (sha256 (call-with-input-file file port-sha256)) (fetch (lambda* (store url hash-algo hash #:optional name #:key system) (pk (quote fetch) url hash-algo hash name system) (add-to-store store (basename url) #f "sha256" url))) (source (bootstrap-origin (origin (method fetch) (uri file) (sha256 sha256) (patch-inputs (quasiquote (("tar" (unquote %bootstrap-coreutils&co)) ("xz" (unquote %bootstrap-coreutils&co)) ("patch" (unquote %bootstrap-coreutils&co))))) (patch-guile %bootstrap-guile) (modules (quote ((guix build utils)))) (imported-modules modules) (snippet (quote (begin (chmod "." 511) (symlink "guile" "guile-rocks") (copy-recursively "../share/guile/2.0/scripts" "scripts") (pk %build-inputs %outputs))))))) (package (package (inherit (dummy-package "with-snippet")) (source source) (build-system trivial-build-system) (inputs (quasiquote (("tar" (unquote (search-bootstrap-binary "tar" (%current-system)))) ("xz" (unquote (search-bootstrap-binary "xz" (%current-system))))))) (arguments (quasiquote (#:guile (unquote %bootstrap-guile) #:builder (let ((tar (assoc-ref %build-inputs "tar")) (xz (assoc-ref %build-inputs "xz")) (source (assoc-ref %build-inputs "source"))) (and (zero? (system* tar "xvf" source "--use-compress-program" xz)) (string=? "guile" (readlink "bin/guile-rocks")) (file-exists? "bin/scripts/compile.scm") (let ((out (assoc-ref %outputs "out"))) (call-with-output-file out (lambda (p) (display "OK" p))))))))))) (drv (package-derivation %store package)) (out (derivation->output-path drv))) (and (build-derivations %store (list (pk (quote snippet-drv) drv))) (call-with-input-file out get-string-all))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1769537584: Bad file descriptor" status: 1] 9629108>)
  expected-value: "OK"
Test begin:
  test-name: "return value"
  source-file: "tests/packages.scm"
  source-line: 203
  source-form: (test-assert "return value" (let ((drv (package-derivation %store (dummy-package "p")))) (and (derivation? drv) (file-exists? (derivation-file-name drv)))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "package-output"
  source-file: "tests/packages.scm"
  source-line: 208
  source-form: (test-assert "package-output" (let* ((package (dummy-package "p")) (drv (package-derivation %store package))) (and (derivation? drv) (string=? (derivation->output-path drv) (package-output %store package "out")))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "trivial"
  source-file: "tests/packages.scm"
  source-line: 215
  source-form: (test-assert "trivial" (let* ((p (package (inherit (dummy-package "trivial")) (build-system trivial-build-system) (source #f) (arguments (quasiquote (#:guile (unquote %bootstrap-guile) #:builder (begin (mkdir %output) (call-with-output-file (string-append %output "/test") (lambda (p) (display (quote (hello guix)) p))))))))) (d (package-derivation %store p))) (and (build-derivations %store (list d)) (let ((p (pk (quote drv) d (derivation->output-path d)))) (equal? (quote (hello guix)) (call-with-input-file (string-append p "/test") read))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1769537584: Bad file descriptor" status: 1] 97267c8>)
Test begin:
  test-name: "trivial with local file as input"
  source-file: "tests/packages.scm"
  source-line: 233
  source-form: (test-assert "trivial with local file as input" (let* ((i (search-path %load-path "ice-9/boot-9.scm")) (p (package (inherit (dummy-package "trivial-with-input-file")) (build-system trivial-build-system) (source #f) (arguments (quasiquote (#:guile (unquote %bootstrap-guile) #:builder (copy-file (assoc-ref %build-inputs "input") %output)))) (inputs (quasiquote (("input" (unquote i))))))) (d (package-derivation %store p))) (and (build-derivations %store (list d)) (let ((p (pk (quote drv) d (derivation->output-path d)))) (equal? (call-with-input-file p get-bytevector-all) (call-with-input-file i get-bytevector-all))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1701511216: Bad file descriptor" status: 1] 95bfbd0>)
Test begin:
  test-name: "trivial with source"
  source-file: "tests/packages.scm"
  source-line: 249
  source-form: (test-assert "trivial with source" (let* ((i (search-path %load-path "ice-9/boot-9.scm")) (p (package (inherit (dummy-package "trivial-with-source")) (build-system trivial-build-system) (source i) (arguments (quasiquote (#:guile (unquote %bootstrap-guile) #:builder (copy-file (assoc-ref %build-inputs "source") %output)))))) (d (package-derivation %store p))) (and (build-derivations %store (list d)) (let ((p (derivation->output-path d))) (equal? (call-with-input-file p get-bytevector-all) (call-with-input-file i get-bytevector-all))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1599602736: Bad file descriptor" status: 1] a235600>)
Test begin:
  test-name: "trivial with system-dependent input"
  source-file: "tests/packages.scm"
  source-line: 264
  source-form: (test-assert "trivial with system-dependent input" (let* ((p (package (inherit (dummy-package "trivial-system-dependent-input")) (build-system trivial-build-system) (source #f) (arguments (quasiquote (#:guile (unquote %bootstrap-guile) #:builder (let ((out (assoc-ref %outputs "out")) (bash (assoc-ref %build-inputs "bash"))) (zero? (system* bash "-c" (format #f "echo hello > ~a" out))))))) (inputs (quasiquote (("bash" (unquote (search-bootstrap-binary "bash" (%current-system))))))))) (d (package-derivation %store p))) (and (build-derivations %store (list d)) (let ((p (pk (quote drv) d (derivation->output-path d)))) (eq? (quote hello) (call-with-input-file p read))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1769537584: Bad file descriptor" status: 1] 9554630>)
Test begin:
  test-name: "search paths"
  source-file: "tests/packages.scm"
  source-line: 282
  source-form: (test-assert "search paths" (let* ((p (make-prompt-tag "return-search-paths")) (s (build-system (name "raw") (description "Raw build system with direct store access") (build (lambda* (store name source inputs #:key outputs system search-paths) search-paths)))) (x (list (search-path-specification (variable "GUILE_LOAD_PATH") (directories (quote ("share/guile/site/2.0")))) (search-path-specification (variable "GUILE_LOAD_COMPILED_PATH") (directories (quote ("share/guile/site/2.0")))))) (a (package (inherit (dummy-package "guile")) (build-system s) (native-search-paths x))) (b (package (inherit (dummy-package "guile-foo")) (build-system s) (inputs (quasiquote (("guile" (unquote a))))))) (c (package (inherit (dummy-package "guile-bar")) (build-system s) (inputs (quasiquote (("guile" (unquote a)) ("guile-foo" (unquote b)))))))) (let-syntax ((collect (syntax-rules () ((_ body ...) (call-with-prompt p (lambda () body ...) (lambda (k search-paths) search-paths)))))) (and (null? (collect (package-derivation %store a))) (equal? x (collect (package-derivation %store b))) (equal? x (collect (package-derivation %store c)))))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "package-cross-derivation"
  source-file: "tests/packages.scm"
  source-line: 317
  source-form: (test-assert "package-cross-derivation" (let ((drv (package-cross-derivation %store (dummy-package "p") "mips64el-linux-gnu"))) (and (derivation? drv) (file-exists? (derivation-file-name drv)))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "package-cross-derivation, trivial-build-system"
  source-file: "tests/packages.scm"
  source-line: 323
  source-form: (test-assert "package-cross-derivation, trivial-build-system" (let ((p (package (inherit (dummy-package "p")) (build-system trivial-build-system) (arguments (quote (#:builder (exit 1))))))) (let ((drv (package-cross-derivation %store p "mips64el-linux-gnu"))) (derivation? drv))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "package-cross-derivation, no cross builder"
  source-file: "tests/packages.scm"
  source-line: 330
  source-form: (test-assert "package-cross-derivation, no cross builder" (let* ((b (build-system (inherit trivial-build-system) (cross-build #f))) (p (package (inherit (dummy-package "p")) (build-system b)))) (guard (c ((package-cross-build-system-error? c) (eq? (package-error-package c) p))) (package-cross-derivation %store p "mips64el-linux-gnu") #f)))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "GNU Make, bootstrap"
  source-file: "tests/packages.scm"
  source-line: 342
  source-form: (test-assert "GNU Make, bootstrap" (let ((gnu-make (@@ (gnu packages base) gnu-make-boot0))) (and (package? gnu-make) (or (location? (package-location gnu-make)) (not (package-location gnu-make))) (let* ((drv (package-derivation %store gnu-make)) (out (derivation->output-path drv))) (and (build-derivations %store (list drv)) (file-exists? (string-append out "/bin/make")))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1835991088: Bad file descriptor" status: 1] 98a1660>)
Test begin:
  test-name: "fold-packages"
  source-file: "tests/packages.scm"
  source-line: 354
  source-form: (test-eq "fold-packages" hello (fold-packages (lambda (p r) (if (string=? (package-name p) "hello") p r)) #f))
Test end:
  result-kind: pass
  actual-value: #<package hello-2.9 gnu/packages/base.scm:53 94d29a0>
  expected-value: #<package hello-2.9 gnu/packages/base.scm:53 94d29a0>
Test begin:
  test-name: "find-packages-by-name"
  source-file: "tests/packages.scm"
  source-line: 361
  source-form: (test-assert "find-packages-by-name" (match (find-packages-by-name "hello") (((? (cut eq? hello <>))) #t) (wrong (pk (quote find-packages-by-name) wrong #f))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "find-packages-by-name with version"
  source-file: "tests/packages.scm"
  source-line: 366
  source-form: (test-assert "find-packages-by-name with version" (match (find-packages-by-name "hello" (package-version hello)) (((? (cut eq? hello <>))) #t) (wrong (pk (quote find-packages-by-name) wrong #f))))
Test end:
  result-kind: pass
  actual-value: #t
Group end: packages
# of expected passes      15
# of unexpected failures  6

[-- Attachment #1.7: store.log --]
[-- Type: text/plain, Size: 24512 bytes --]

%%%% Starting test store
Group begin: store
Test begin:
  test-name: "store-path-hash-part"
  source-file: "tests/store.scm"
  source-line: 58
  source-form: (test-equal "store-path-hash-part" "283gqy39v3g9dxjy26rynl0zls82fmcg" (store-path-hash-part (string-append (%store-prefix) "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7")))
Test end:
  result-kind: pass
  actual-value: "283gqy39v3g9dxjy26rynl0zls82fmcg"
  expected-value: "283gqy39v3g9dxjy26rynl0zls82fmcg"
Test begin:
  test-name: "store-path-hash-part #f"
  source-file: "tests/store.scm"
  source-line: 64
  source-form: (test-equal "store-path-hash-part #f" #f (store-path-hash-part (string-append (%store-prefix) "/foo/bar/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7")))
Test end:
  result-kind: pass
  actual-value: #f
  expected-value: #f
Test begin:
  test-name: "store-path-package-name"
  source-file: "tests/store.scm"
  source-line: 70
  source-form: (test-equal "store-path-package-name" "guile-2.0.7" (store-path-package-name (string-append (%store-prefix) "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7")))
Test end:
  result-kind: pass
  actual-value: "guile-2.0.7"
  expected-value: "guile-2.0.7"
Test begin:
  test-name: "store-path-package-name #f"
  source-file: "tests/store.scm"
  source-line: 76
  source-form: (test-equal "store-path-package-name #f" #f (store-path-package-name "/foo/bar/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7"))
Test end:
  result-kind: pass
  actual-value: #f
  expected-value: #f
Test begin:
  test-name: "direct-store-path?"
  source-file: "tests/store.scm"
  source-line: 81
  source-form: (test-assert "direct-store-path?" (and (direct-store-path? (string-append (%store-prefix) "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7")) (not (direct-store-path? (string-append (%store-prefix) "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7/bin/guile"))) (not (direct-store-path? (%store-prefix)))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "valid-path? live"
  source-file: "tests/store.scm"
  source-line: 93
  source-form: (test-assert "valid-path? live" (let ((p (add-text-to-store %store "hello" "hello, world"))) (valid-path? %store p)))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "valid-path? false"
  source-file: "tests/store.scm"
  source-line: 97
  source-form: (test-assert "valid-path? false" (not (valid-path? %store (string-append (%store-prefix) "/" (make-string 32 #\e) "-foobar"))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "valid-path? error"
  source-file: "tests/store.scm"
  source-line: 102
  source-form: (test-assert "valid-path? error" (with-store s (guard (c ((nix-protocol-error? c) #t)) (valid-path? s "foo") #f)))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "valid-path? recovery"
  source-file: "tests/store.scm"
  source-line: 108
  source-form: (test-assert "valid-path? recovery" (with-store s (let-syntax ((true-if-error (syntax-rules () ((_ exp) (guard (c ((nix-protocol-error? c) #t)) exp #f))))) (and (true-if-error (valid-path? s "foo")) (true-if-error (valid-path? s "bar")) (true-if-error (valid-path? s "baz")) (true-if-error (valid-path? s "chbouib")) (valid-path? s (add-text-to-store s "valid" "yeah"))))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "hash-part->path"
  source-file: "tests/store.scm"
  source-line: 125
  source-form: (test-assert "hash-part->path" (let ((p (add-text-to-store %store "hello" "hello, world"))) (equal? (hash-part->path %store (store-path-hash-part p)) p)))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "dead-paths"
  source-file: "tests/store.scm"
  source-line: 130
  source-form: (test-assert "dead-paths" (let ((p (add-text-to-store %store "random-text" (random-text)))) (member p (dead-paths %store))))
Test end:
  result-kind: pass
  actual-value: ("/home/nikita/guix/guix-savannah/test-tmp/store/z8pp09v5blb998dqkfl35q865qhsxg85-random-text" "/home/nikita/guix/guix-savannah/test-tmp/store/z8s2qipnmqzjmcfmf5bf16dhbgj5yryd-input.lock" "/home/nikita/guix/guix-savannah/test-tmp/store/zc25b4hj1smnk1n6y8vz4952bhbh947l-xcb-proto-1.7.1.tar.bz2-builder" "/home/nikita/guix/guix-savannah/test-tmp/store/zc3hdr8s2pn6ggwq38ab3nngp89lfpj8-small-fixed-rec-guile-builder" "/home/nikita/guix/guix-savannah/test-tmp/store/zc8y9538jh7s0zgbv5ym59fkhbyjf1rk-inputproto-2.2.tar.bz2-builder" "/home/nikita/guix/guix-savannah/test-tmp/store/zclqih0ykr3bw0xx9mchji6268hdjjmh-libxrender-0.9.7.drv" "/home/nikita/guix/guix-savannah/test-tmp/store/zcnkwlhm9z85dp5a22vj6096lmiizipy-Python-2.7.6.tar.xz-guile-builder" "/home/nikita/guix/guix-savannah/test-tmp/store/zhi6sz1n45kvg1ca3n8flpmqaf3si4as-readline-6.3.tar.xz.drv" "/home/nikita/guix/guix-savannah/test-tmp/store/zhk6widzr9fbalsv19pv58ih9mpiaagm-double.drv" "/home/nikita/guix/guix-savannah/test-tmp/store/zhmczkkaxabx6lgckgfk1nkplfnjahad-gdbm-1.11.drv" "/home/nikita/guix/guix-savannah/test-tmp/store/zi88mzyd8vv2wfbbwavbjj2d1fqw93rf-m4-1.4.17.tar.xz.drv" "/home/nikita/guix/guix-savannah/test-tmp/store/ziain09kpmz230fafz0jm7pskzi9x5l3-gmp-5.1.3-guile-builder" "/home/nikita/guix/guix-savannah/test-tmp/store/zja9rm74rms76zlj7j5jqbkd3ckpjpy7-sed-4.2.2-guile-builder" "/home/nikita/guix/guix-savannah/test-tmp/store/zk3qjjddk04cgg0121zpnc5icfnm0d6k-guile-2.0.9.tar.xz" "/home/nikita/guix/guix-savannah/test-tmp/store/zl3r4zlypwm4mipmd859jlbgp3ipvvn6-pkg-config-0.27.1-guile-builder" "/home/nikita/guix/guix-savannah/test-tmp/store/zlva1hpp2fvp62sdfsgf7x8j8i7a0yms-flex-2.5.37.tar.xz-guile-builder" "/home/nikita/guix/guix-savannah/test-tmp/store/zm15rai059j7jvnz1nld1h1x5l4yx95q-bison-2.7.1-guile-builder" "/home/nikita/guix/guix-savannah/test-tmp/store/znq6nhvws165km6anjcly72z1w3vm9c8-references-graphs.drv" "/home/nikita/guix/guix-savannah/test-tmp/store/znv7xr4mpfqdkgw7vw7jm8rhkgkki583-gc-7.4.0.tar.gz.drv" "/home/nikita/guix/guix-savannah/test-tmp/store/zp0mwmgyby3kni4y8knrcxdyjsr5b347-foo-builder" "/home/nikita/guix/guix-savannah/test-tmp/store/zq1fsldxk2mnkw3jy03zhlg80dlh04rf-glib-2.39.1.tar.xz.drv" "/home/nikita/guix/guix-savannah/test-tmp/store/zq7x0jfbbxrblxzjain0hlcw0s1f80il-xz-5.0.4.tar.gz.drv" "/home/nikita/guix/guix-savannah/test-tmp/store/zqdhvc9vviv1k4xbqvm3gzhk04amfzbi-libice-1.0.8-guile-builder" "/home/nikita/guix/guix-savannah/test-tmp/store/zqygrvaym020jj4gdkkd5n4rf2im7g79-cloog-0.18.0.tar.gz.drv" "/home/nikita/guix/guix-savannah/test-tmp/store/zrahpaf2gmnn56m6n7p4xmy8yhmqcakl-goo-guile-builder" "/home/nikita/guix/guix-savannah/test-tmp/store/zrdwfnkbmwaq8igbcqy0j4rxigfqja2a-readline-6.2.drv" "/home/nikita/guix/guix-savannah/test-tmp/store/zrkr440ps8nxwbgjjmbv2sr2mwcq90xf-libxau-1.0.7-guile-builder" "/home/nikita/guix/guix-savannah/test-tmp/store/zrqhgckwjnqr5p74m278h1jb9mzzlqf8-acl-2.2.51-guile-builder" "/home/nikita/guix/guix-savannah/test-tmp/store/zswhyql3nmpfc53l2qabgsnpr9psmhdr-glibc-bootstrap-0" "/home/nikita/guix/guix-savannah/test-tmp/store/zvxs0d0yx5xqgrfiz24lxc7b8rcazpl3-glibc-2.19.tar.xz.drv" "/home/nikita/guix/guix-savannah/test-tmp/store/zvza65bqm12n6rw5zd2pdjxa15vjbh6k-module-import-compiled" "/home/nikita/guix/guix-savannah/test-tmp/store/zw2c97rqj67hxmvqbacg3rd5qnp5va74-test-with-modules.drv" "/home/nikita/guix/guix-savannah/test-tmp/store/zysvl4i44wkfjl7a3zkfg42gjg6zdkzd-m4-1.4.17.tar.bz2.drv" "/home/nikita/guix/guix-savannah/test-tmp/store/zyv8f4crwrhwmhswa3n7ga74hgqzxgn0-libgc-7.4.0-guile-builder" "/home/nikita/guix/guix-savannah/test-tmp/store/zz7c5ck4713bpkrmiwlqpqkd4lapg3dd-emacs-24.3-guile-builder" "/home/nikita/guix/guix-savannah/test-tmp/store/zzalgfrjgyr4zg0xp1dzmriimggnm8v7-coreutils-8.22.tar.xz-guile-builder")
Test begin:
  test-name: "permanent root"
  source-file: "tests/store.scm"
  source-line: 151
  source-form: (test-assert "permanent root" (let* ((p (with-store store (let ((p (add-text-to-store store "random-text" (random-text)))) (add-permanent-root p) (add-permanent-root p) p)))) (and (member p (live-paths %store)) (begin (remove-permanent-root p) (->bool (member p (dead-paths %store)))))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "dead path can be explicitly collected"
  source-file: "tests/store.scm"
  source-line: 163
  source-form: (test-assert "dead path can be explicitly collected" (let ((p (add-text-to-store %store "random-text" (random-text) (quote ())))) (let-values (((paths freed) (delete-paths %store (list p)))) (and (equal? paths (list p)) (> freed 0) (not (file-exists? p))))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "references"
  source-file: "tests/store.scm"
  source-line: 171
  source-form: (test-assert "references" (let* ((t1 (add-text-to-store %store "random1" (random-text))) (t2 (add-text-to-store %store "random2" (random-text) (list t1)))) (and (equal? (list t1) (references %store t2)) (equal? (list t2) (referrers %store t1)) (null? (references %store t1)) (null? (referrers %store t2)))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "requisites"
  source-file: "tests/store.scm"
  source-line: 181
  source-form: (test-assert "requisites" (let* ((t1 (add-text-to-store %store "random1" (random-text) (quote ()))) (t2 (add-text-to-store %store "random2" (random-text) (list t1))) (t3 (add-text-to-store %store "random3" (random-text) (list t2))) (t4 (add-text-to-store %store "random4" (random-text) (list t1 t3)))) (define (same? x y) (and (= (length x) (length y)) (lset= equal? x y))) (and (same? (requisites %store t1) (list t1)) (same? (requisites %store t2) (list t1 t2)) (same? (requisites %store t3) (list t1 t2 t3)) (same? (requisites %store t4) (list t1 t2 t3 t4)))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "derivers"
  source-file: "tests/store.scm"
  source-line: 199
  source-form: (test-assert "derivers" (let* ((b (add-text-to-store %store "build" "echo $foo > $out" (quote ()))) (s (add-to-store %store "bash" #t "sha256" (search-bootstrap-binary "bash" (%current-system)))) (d (derivation %store "the-thing" s (quasiquote ("-e" (unquote b))) #:env-vars (quasiquote (("foo" unquote (random-text)))) #:inputs (quasiquote (((unquote b)) ((unquote s)))))) (o (derivation->output-path d))) (and (build-derivations %store (list d)) (equal? (query-derivation-outputs %store (derivation-file-name d)) (list o)) (equal? (valid-derivers %store o) (list (derivation-file-name d))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1835991088: Bad file descriptor" status: 1] 8cb5918>)
Test begin:
  test-name: "topologically-sorted, one item"
  source-file: "tests/store.scm"
  source-line: 215
  source-form: (test-assert "topologically-sorted, one item" (let* ((a (add-text-to-store %store "a" "a")) (b (add-text-to-store %store "b" "b" (list a))) (c (add-text-to-store %store "c" "c" (list b))) (d (add-text-to-store %store "d" "d" (list c))) (s (topologically-sorted %store (list d)))) (equal? s (list a b c d))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "topologically-sorted, several items"
  source-file: "tests/store.scm"
  source-line: 223
  source-form: (test-assert "topologically-sorted, several items" (let* ((a (add-text-to-store %store "a" "a")) (b (add-text-to-store %store "b" "b" (list a))) (c (add-text-to-store %store "c" "c" (list b))) (d (add-text-to-store %store "d" "d" (list c))) (s1 (topologically-sorted %store (list d a c b))) (s2 (topologically-sorted %store (list b d c a b d)))) (equal? s1 s2 (list a b c d))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "topologically-sorted, more difficult"
  source-file: "tests/store.scm"
  source-line: 232
  source-form: (test-assert "topologically-sorted, more difficult" (let* ((a (add-text-to-store %store "a" "a")) (b (add-text-to-store %store "b" "b" (list a))) (c (add-text-to-store %store "c" "c" (list b))) (d (add-text-to-store %store "d" "d" (list c))) (w (add-text-to-store %store "w" "w")) (x (add-text-to-store %store "x" "x" (list w))) (y (add-text-to-store %store "y" "y" (list x d))) (s1 (topologically-sorted %store (list y))) (s2 (topologically-sorted %store (list c y))) (s3 (topologically-sorted %store (cons y (references %store y))))) (let* ((x-then-d? (equal? (references %store y) (list x d)))) (and (equal? s1 (if x-then-d? (list w x a b c d y) (list a b c d w x y))) (equal? s2 (if x-then-d? (list a b c w x d y) (list a b c d w x y))) (lset= string=? s1 s3)))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "log-file, derivation"
  source-file: "tests/store.scm"
  source-line: 256
  source-form: (test-assert "log-file, derivation" (let* ((b (add-text-to-store %store "build" "echo $foo > $out" (quote ()))) (s (add-to-store %store "bash" #t "sha256" (search-bootstrap-binary "bash" (%current-system)))) (d (derivation %store "the-thing" s (quasiquote ("-e" (unquote b))) #:env-vars (quasiquote (("foo" unquote (random-text)))) #:inputs (quasiquote (((unquote b)) ((unquote s))))))) (and (build-derivations %store (list d)) (file-exists? (pk (log-file %store (derivation-file-name d)))))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1769537584: Bad file descriptor" status: 1] 88e7300>)
Test begin:
  test-name: "log-file, output file name"
  source-file: "tests/store.scm"
  source-line: 268
  source-form: (test-assert "log-file, output file name" (let* ((b (add-text-to-store %store "build" "echo $foo > $out" (quote ()))) (s (add-to-store %store "bash" #t "sha256" (search-bootstrap-binary "bash" (%current-system)))) (d (derivation %store "the-thing" s (quasiquote ("-e" (unquote b))) #:env-vars (quasiquote (("foo" unquote (random-text)))) #:inputs (quasiquote (((unquote b)) ((unquote s)))))) (o (derivation->output-path d))) (and (build-derivations %store (list d)) (file-exists? (pk (log-file %store o))) (string=? (log-file %store (derivation-file-name d)) (log-file %store o)))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1599602736: Bad file descriptor" status: 1] 88f81f8>)
Test begin:
  test-name: "no substitutes"
  source-file: "tests/store.scm"
  source-line: 283
  source-form: (test-assert "no substitutes" (let* ((s (open-connection)) (d1 (package-derivation s %bootstrap-guile (%current-system))) (d2 (package-derivation s %bootstrap-glibc (%current-system))) (o (map derivation->output-path (list d1 d2)))) (set-build-options s #:use-substitutes? #f) (and (not (has-substitutes? s (derivation-file-name d1))) (not (has-substitutes? s (derivation-file-name d2))) (null? (substitutable-paths s o)) (null? (substitutable-path-info s o)))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "substitute query"
  source-file: "tests/store.scm"
  source-line: 296
  source-form: (test-assert "substitute query" (let* ((s (open-connection)) (d (package-derivation s %bootstrap-guile (%current-system))) (o (derivation->output-path d)) (dir (and=> (getenv "GUIX_BINARY_SUBSTITUTE_URL") (compose uri-path string->uri)))) (call-with-output-file (string-append dir "/nix-cache-info") (lambda (p) (format p "StoreDir: ~a\nWantMassQuery: 0\n" (%store-prefix)))) (call-with-output-file (string-append dir "/" (store-path-hash-part o) ".narinfo") (lambda (p) (format p "StorePath: ~a\nURL: ~a\nCompression: none\nNarSize: 1234\nReferences: \nSystem: ~a\nDeriver: ~a~%" o (string-append dir "/example.nar") (%current-system) (basename (derivation-file-name d))))) (false-if-exception (delete-file (string-append (getenv "XDG_CACHE_HOME") "/guix/substitute-binary/" (store-path-hash-part o)))) (set-build-options s #:use-substitutes? #t) (and (has-substitutes? s o) (equal? (list o) (substitutable-paths s (list o))) (match (pk (quote spi) (substitutable-path-info s (list o))) (((? substitutable? s)) (and (string=? (substitutable-deriver s) (derivation-file-name d)) (null? (substitutable-references s)) (equal? (substitutable-nar-size s) 1234)))))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "substitute"
  source-file: "tests/store.scm"
  source-line: 339
  source-form: (test-assert "substitute" (let* ((s (open-connection)) (c (random-text)) (d (build-expression->derivation s "substitute-me" (quasiquote (call-with-output-file %output (lambda (p) (exit 1) (display (unquote c) p)))) #:guile-for-build (package-derivation s %bootstrap-guile (%current-system)))) (o (derivation->output-path d)) (dir (and=> (getenv "GUIX_BINARY_SUBSTITUTE_URL") (compose uri-path string->uri)))) (call-with-output-file (string-append dir "/nix-cache-info") (lambda (p) (format p "StoreDir: ~a\nWantMassQuery: 0\n" (%store-prefix)))) (call-with-output-file (string-append dir "/example.out") (lambda (p) (display c p))) (call-with-output-file (string-append dir "/example.nar") (lambda (p) (write-file (string-append dir "/example.out") p))) (call-with-output-file (string-append dir "/" (store-path-hash-part o) ".narinfo") (lambda (p) (format p "StorePath: ~a\nURL: ~a\nCompression: none\nNarSize: 1234\nNarHash: sha256:~a\nReferences: \nSystem: ~a\nDeriver: ~a~%" o "example.nar" (call-with-input-file (string-append dir "/example.nar") (compose bytevector->nix-base32-string sha256 get-bytevector-all)) (%current-system) (basename (derivation-file-name d))))) (set-build-options s #:use-substitutes? #t) (and (has-substitutes? s o) (build-derivations s (list d)) (equal? c (call-with-input-file o get-string-all)))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "substitute, corrupt output hash"
  source-file: "tests/store.scm"
  source-line: 390
  source-form: (test-assert "substitute, corrupt output hash" (let* ((s (open-connection)) (c "hello, world") (d (build-expression->derivation s "corrupt-substitute" (quasiquote (mkdir %output)) #:guile-for-build (package-derivation s %bootstrap-guile (%current-system)))) (o (derivation->output-path d)) (dir (and=> (getenv "GUIX_BINARY_SUBSTITUTE_URL") (compose uri-path string->uri)))) (call-with-output-file (string-append dir "/nix-cache-info") (lambda (p) (format p "StoreDir: ~a\nWantMassQuery: 0\n" (%store-prefix)))) (call-with-output-file (string-append dir "/example.out") (lambda (p) (display "The contents here do not match C." p))) (call-with-output-file (string-append dir "/example.nar") (lambda (p) (write-file (string-append dir "/example.out") p))) (call-with-output-file (string-append dir "/" (store-path-hash-part o) ".narinfo") (lambda (p) (format p "StorePath: ~a\nURL: ~a\nCompression: none\nNarSize: 1234\nNarHash: sha256:~a\nReferences: \nSystem: ~a\nDeriver: ~a~%" o "example.nar" (bytevector->nix-base32-string (sha256 (string->utf8 c))) (%current-system) (basename (derivation-file-name d))))) (set-build-options s #:use-substitutes? #t #:fallback? #f) (and (has-substitutes? s o) (guard (c ((nix-protocol-error? c) (pk (quote corrupt) c) (not (zero? (nix-protocol-error-status c))))) (build-derivations s (list d)) #f))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "substitute --fallback"
  source-file: "tests/store.scm"
  source-line: 448
  source-form: (test-assert "substitute --fallback" (let* ((s (open-connection)) (t (random-text)) (d (build-expression->derivation s "substitute-me-not" (quasiquote (call-with-output-file %output (lambda (p) (display (unquote t) p)))) #:guile-for-build (package-derivation s %bootstrap-guile (%current-system)))) (o (derivation->output-path d)) (dir (and=> (getenv "GUIX_BINARY_SUBSTITUTE_URL") (compose uri-path string->uri)))) (call-with-output-file (string-append dir "/nix-cache-info") (lambda (p) (format p "StoreDir: ~a\nWantMassQuery: 0\n" (%store-prefix)))) (call-with-output-file (string-append dir "/" (store-path-hash-part o) ".narinfo") (lambda (p) (format p "StorePath: ~a\nURL: ~a\nCompression: none\nNarSize: 1234\nNarHash: sha256:0mdqa9w1p6cmli6976v4wi0sw9r4p5prkj7lzfd1877wk11c9c73\nReferences: \nSystem: ~a\nDeriver: ~a~%" o "does-not-exist.nar" (%current-system) (basename (derivation-file-name d))))) (set-build-options s #:use-substitutes? #t) (and (has-substitutes? s o) (guard (c ((nix-protocol-error? c) (set-build-options s #:use-substitutes? #t #:fallback? #t) (and (build-derivations s (list d)) (equal? t (call-with-input-file o get-string-all))))) (build-derivations s (list d)) #f))))
Test end:
  result-kind: fail
  actual-value: #f
  actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1769537584: Bad file descriptor" status: 1] 89c4120>)
Test begin:
  test-name: "export/import several paths"
  source-file: "tests/store.scm"
  source-line: 498
  source-form: (test-assert "export/import several paths" (let* ((texts (unfold (cut >= <> 10) (lambda _ (random-text)) #{1+}# 0)) (files (map (cut add-text-to-store %store "text" <>) texts)) (dump (call-with-bytevector-output-port (cut export-paths %store files <>)))) (delete-paths %store files) (and (every (negate file-exists?) files) (let* ((source (open-bytevector-input-port dump)) (imported (import-paths %store source))) (and (equal? imported files) (every file-exists? files) (equal? texts (map (lambda (file) (call-with-input-file file get-string-all)) files)))))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "export/import paths, ensure topological order"
  source-file: "tests/store.scm"
  source-line: 518
  source-form: (test-assert "export/import paths, ensure topological order" (let* ((file0 (add-text-to-store %store "baz" (random-text))) (file1 (add-text-to-store %store "foo" (random-text) (list file0))) (file2 (add-text-to-store %store "bar" (random-text) (list file1))) (files (list file1 file2)) (dump1 (call-with-bytevector-output-port (cute export-paths %store (list file1 file2) <>))) (dump2 (call-with-bytevector-output-port (cute export-paths %store (list file2 file1) <>)))) (delete-paths %store files) (and (every (negate file-exists?) files) (bytevector=? dump1 dump2) (let* ((source (open-bytevector-input-port dump1)) (imported (import-paths %store source))) (and (equal? imported (list file1 file2)) (every file-exists? files) (equal? (list file0) (references %store file1)) (equal? (list file1) (references %store file2)))))))
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "import corrupt path"
  source-file: "tests/store.scm"
  source-line: 540
  source-form: (test-assert "import corrupt path" (let* ((text (random-text)) (file (add-text-to-store %store "text" text)) (dump (call-with-bytevector-output-port (cut export-paths %store (list file) <>)))) (delete-paths %store (list file)) (let* ((index (quotient (bytevector-length dump) 4)) (byte (bytevector-u8-ref dump index))) (bytevector-u8-set! dump index (logxor 255 byte))) (and (not (file-exists? file)) (guard (c ((nix-protocol-error? c) (pk (quote c) c) (and (not (zero? (nix-protocol-error-status c))) (string-contains (nix-protocol-error-message c) "corrupt")))) (let* ((source (open-bytevector-input-port dump)) (imported (import-paths %store source))) (pk (quote corrupt-imported) imported) #f)))))
Test end:
  result-kind: pass
  actual-value: 80
Test begin:
  test-name: "register-path"
  source-file: "tests/store.scm"
  source-line: 563
  source-form: (test-assert "register-path" (let ((file (string-append (%store-prefix) "/" (make-string 32 #\f) "-fake"))) (when (valid-path? %store file) (delete-paths %store (list file))) (false-if-exception (delete-file file)) (let ((ref (add-text-to-store %store "ref-of-fake" (random-text))) (drv (string-append file ".drv"))) (call-with-output-file file (cut display "This is a fake store item.\n" <>)) (register-path file #:references (list ref) #:deriver drv) (and (valid-path? %store file) (equal? (references %store file) (list ref)) (null? (valid-derivers %store file)) (null? (referrers %store file))))))
Test end:
  result-kind: pass
  actual-value: #t
Group end: store
# of expected passes      26
# of unexpected failures  4

[-- Attachment #1.8: test-suite.log --]
[-- Type: text/plain, Size: 24772 bytes --]

====================================
   GNU Guix 0.7: ./test-suite.log
====================================

# TOTAL: 29
# PASS:  21
# SKIP:  0
# XFAIL: 0
# FAIL:  8
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: tests/builders
====================

accepted connection from pid 1584, uid 1000
%%%% Starting test builders  (Writing full log to "builders.log")

;;; (hello-drv #<derivation /home/nikita/guix/guix-savannah/test-tmp/store/d17ljb3xz8vk7nnz0z1rdhq1gm1nva92-hello-2.8.drv => /home/nikita/guix/guix-savannah/test-tmp/store/wla8cw27ddynlhvna178h4m0h21annhj-hello-2.8 8dcc320>)
tests/builders.scm:85: FAIL gnu-build
# of expected passes      2
# of unexpected failures  1
@ build-started /home/nikita/guix/guix-savannah/test-tmp/store/6i936lkbbphhjg2j6w9xcs5d7b0z2nvb-hello-2.8.tar.gz.drv - i686-linux /home/nikita/guix/guix-savannah/test-tmp/var/log/guix/drvs/6i//936lkbbphhjg2j6w9xcs5d7b0z2nvb-hello-2.8.tar.gz.drv.bz2
starting download of `/home/nikita/guix/guix-savannah/test-tmp/store/x3j6gj03yplxni5szwdp86lpk6f06002-hello-2.8.tar.gz' from `http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz'...
\rLINKIFYFEdFeJDdaBDCDJDJbJFEIAbfHeeDeCcEfbFEceeJ	  9.4% of 681.1 KiB\rLINKIFYFEdFeJDdaBDCDJDJbJFEIAbfHeeDeCcEfbFEceeJ	 18.8% of 681.1 KiB\rLINKIFYFEdFeJDdaBDCDJDJbJFEIAbfHeeDeCcEfbFEceeJ	 28.2% of 681.1 KiB\rLINKIFYFEdFeJDdaBDCDJDJbJFEIAbfHeeDeCcEfbFEceeJ	 37.6% of 681.1 KiB\rLINKIFYFEdFeJDdaBDCDJDJbJFEIAbfHeeDeCcEfbFEceeJ	 47.0% of 681.1 KiB\rLINKIFYFEdFeJDdaBDCDJDJbJFEIAbfHeeDeCcEfbFEceeJ	 56.4% of 681.1 KiB\rLINKIFYFEdFeJDdaBDCDJDJbJFEIAbfHeeDeCcEfbFEceeJ	 65.8% of 681.1 KiB\rLINKIFYFEdFeJDdaBDCDJDJbJFEIAbfHeeDeCcEfbFEceeJ	 75.2% of 681.1 KiB\rLINKIFYFEdFeJDdaBDCDJDJbJFEIAbfHeeDeCcEfbFEceeJ	 84.6% of 681.1 KiB\rLINKIFYFEdFeJDdaBDCDJDJbJFEIAbfHeeDeCcEfbFEceeJ	 94.0% of 681.1 KiB\rLINKIFYFEdFeJDdaBDCDJDJbJFEIAbfHeeDeCcEfbFEceeJ	100.0% of 681.1 KiB
@ build-succeeded /home/nikita/guix/guix-savannah/test-tmp/store/6i936lkbbphhjg2j6w9xcs5d7b0z2nvb-hello-2.8.tar.gz.drv -
killing process 1591
75 operations

FAIL: tests/derivations
=======================

accepted connection from pid 1606, uid 1000
accepted connection from pid 1606, uid 1000
accepted connection from pid 1606, uid 1000
accepted connection from pid 1606, uid 1000
8 operations
4 operations
4 operations
%%%% Starting test derivations  (Writing full log to "derivations.log")
tests/derivations.scm:121: FAIL build derivation with 1 source
tests/derivations.scm:139: FAIL derivation with local file as input
tests/derivations.scm:172: FAIL fixed-output derivation
tests/derivations.scm:187: FAIL fixed-output derivation: output paths are equal
tests/derivations.scm:204: FAIL fixed-output derivation, recursive
tests/derivations.scm:221: FAIL derivation with a fixed-output input
tests/derivations.scm:255: FAIL multiple-output derivation
tests/derivations.scm:276: FAIL multiple-output derivation, non-alphabetic order

;;; (udrv #<derivation /home/nikita/guix/guix-savannah/test-tmp/store/kwyjagq5v2f6ckvcr21m6qnyyxhyxgmf-multiple-output-user.drv => /home/nikita/guix/guix-savannah/test-tmp/store/3x3pkv1av9i05qi30nlg9mbj9c4alz13-multiple-output-user 9e382a8>)
tests/derivations.scm:310: FAIL user of multiple-output derivation
tests/derivations.scm:343: FAIL derivation with #:references-graphs
tests/derivations.scm:402: FAIL build derivation with coreutils
tests/derivations.scm:432: FAIL build-expression->derivation without inputs
tests/derivations.scm:445: FAIL build-expression->derivation and max-silent-time
tests/derivations.scm:459: FAIL build-expression->derivation and timeout
tests/derivations.scm:479: FAIL derivation-prerequisites-to-build when outputs already present

;;; (() ("/home/nikita/guix/guix-savannah/test-tmp/store/57xz456d6c6x1sjwhk0g8vmgfqx5cc66-prereq-subst") () ())
tests/derivations.scm:551: FAIL build-expression->derivation with expression returning #f
tests/derivations.scm:566: FAIL build-expression->derivation with two outputs
tests/derivations.scm:585: FAIL build-expression->derivation with one input
tests/derivations.scm:618: FAIL build-expression->derivation with modules
tests/derivations.scm:633: FAIL build-expression->derivation: same fixed-output path
tests/derivations.scm:654: FAIL build-expression->derivation with a fixed-output input
tests/derivations.scm:685: FAIL build-expression->derivation produces recursive fixed-output
tests/derivations.scm:711: FAIL build-expression->derivation uses recursive fixed-output
tests/derivations.scm:733: FAIL build-expression->derivation with #:references-graphs

;;; (remapped #<derivation /home/nikita/guix/guix-savannah/test-tmp/store/26pl6m0nwl846dnl66gxmb1f30v489ml-drv-to-remap.drv => /home/nikita/guix/guix-savannah/test-tmp/store/f092142wzvixm61jgmy6y4h9ymnzwwm4-drv-to-remap 9e12550>)
tests/derivations.scm:765: FAIL map-derivation

;;; (remapped* #<derivation /home/nikita/guix/guix-savannah/test-tmp/store/pxhg2lgymq5mzick18a1fzv2a6hgfpzb-drv-to-remap.drv => /home/nikita/guix/guix-savannah/test-tmp/store/afk0xphhrc432gv02mn8i8symnx3hnzj-drv-to-remap 9ea3140>)
tests/derivations.scm:788: FAIL map-derivation, sources
# of expected passes      10
# of unexpected failures  26
killing process 1612
killing process 1613
killing process 1614
killing process 1615
killing process 1616
killing process 1617
killing process 1618
killing process 1619
killing process 1620
killing process 1621
killing process 1622
killing process 1623
substitute-binary: warning: authentication and authorization of substitutes disabled!
killing process 1647
substitute-binary: warning: authentication and authorization of substitutes disabled!
killing process 1671
substitute-binary: warning: authentication and authorization of substitutes disabled!
killing process 1714
substitute-binary: warning: authentication and authorization of substitutes disabled!
killing process 1738
killing process 1739
killing process 1740
@ build-started /home/nikita/guix/guix-savannah/test-tmp/store/rwi9cp89bidwqdq4fzjwsb598rl5g938-file-import.drv - i686-linux /home/nikita/guix/guix-savannah/test-tmp/var/log/guix/drvs/rw//i9cp89bidwqdq4fzjwsb598rl5g938-file-import.drv.bz2
@ build-succeeded /home/nikita/guix/guix-savannah/test-tmp/store/rwi9cp89bidwqdq4fzjwsb598rl5g938-file-import.drv -
killing process 1742
killing process 1743
killing process 1744
killing process 1745
killing process 1746
killing process 1747
killing process 1748
killing process 1749
461 operations

FAIL: tests/packages
====================

accepted connection from pid 1853, uid 1000
%%%% Starting test packages  (Writing full log to "packages.log")

;;; (x (("b" #<package b-0 tests/packages.scm:92 94e69a0>) ("b/a" #<package a-0 tests/packages.scm:91 94e69f8>) ("c" #<package c-0 tests/packages.scm:94 94e6948>) ("d" #<package d-0 tests/packages.scm:96 94e68f0>) ("d/x" "something.drv")))

;;; (fetch "./gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz" sha256 #vu8(183 87 205 70 191 19 236 172 131 251 142 149 95 181 0 150 172 45 23 187 97 12 168 235 129 111 41 48 42 0 168 70) #f "i686-linux")

;;; (snippet-drv #<derivation /home/nikita/guix/guix-savannah/test-tmp/store/1fk5dgy0g9qxhac60d1k3qpsgsmmq035-with-snippet-0.drv => /home/nikita/guix/guix-savannah/test-tmp/store/ppj4xyyxs0ksqv2yzrxn6b3wahlnz066-with-snippet-0 98f16e0>)
tests/packages.scm:144: FAIL package-source-derivation, snippet
tests/packages.scm:215: FAIL trivial
tests/packages.scm:233: FAIL trivial with local file as input
tests/packages.scm:249: FAIL trivial with source
tests/packages.scm:264: FAIL trivial with system-dependent input
tests/packages.scm:342: FAIL GNU Make, bootstrap
# of expected passes      15
# of unexpected failures  6
killing process 1859
killing process 1860
killing process 1861
killing process 1862
killing process 1863
killing process 1864
377 operations

FAIL: tests/store
=================

accepted connection from pid 1898, uid 1000
accepted connection from pid 1898, uid 1000
1 operations
accepted connection from pid 1898, uid 1000
6 operations
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/nikita/guix/guix-savannah/nix/scripts/list-runtime-roots
;;; compiled /home/nikita/guix/guix-savannah/test-tmp/var/1893/cache-1893/guile/ccache/2.0-LE-4-2.0/home/nikita/guix/guix-savannah/nix/scripts/list-runtime-roots.go
accepted connection from pid 1898, uid 1000
1 operations
accepted connection from pid 1898, uid 1000
accepted connection from pid 1898, uid 1000
accepted connection from pid 1898, uid 1000
accepted connection from pid 1898, uid 1000
accepted connection from pid 1898, uid 1000
finding garbage collector roots...
removing stale temporary roots file `/home/nikita/guix/guix-savannah/test-tmp/var/1893/temproots/1903'
determining live/dead paths...
finding garbage collector roots...
determining live/dead paths...
finding garbage collector roots...
determining live/dead paths...
finding garbage collector roots...
deleting unused links...
killing process 1915
killing process 1916
killing process 1917
substitute-binary: warning: authentication and authorization of substitutes disabled!
substitute-binary: warning: authentication and authorization of substitutes disabled!
substitute-binary: warning: authentication and authorization of substitutes disabled!
@ substituter-started /home/nikita/guix/guix-savannah/test-tmp/store/93mw5q5z40vy7bx5ih716qvw65z4jh0a-substitute-me /home/nikita/guix/guix-savannah/nix/scripts/substitute-binary
warning: authentication and authorization of substitutes disabled!
downloading `/home/nikita/guix/guix-savannah/test-tmp/store/93mw5q5z40vy7bx5ih716qvw65z4jh0a-substitute-me' from `file:/home/nikita/guix/guix-savannah/test-tmp/var/1893/substituter-data/example.nar' (0.0 MiB installed)...
\rfile:///.../example.nar	100.0% of 0.2 KiB@ substituter-succeeded /home/nikita/guix/guix-savannah/test-tmp/store/93mw5q5z40vy7bx5ih716qvw65z4jh0a-substitute-me
substitute-binary: warning: authentication and authorization of substitutes disabled!
@ substituter-started /home/nikita/guix/guix-savannah/test-tmp/store/01zv3jf92sxzrlb3k6x39nl1lc8ynffv-corrupt-substitute /home/nikita/guix/guix-savannah/nix/scripts/substitute-binary
warning: authentication and authorization of substitutes disabled!
downloading `/home/nikita/guix/guix-savannah/test-tmp/store/01zv3jf92sxzrlb3k6x39nl1lc8ynffv-corrupt-substitute' from `file:/home/nikita/guix/guix-savannah/test-tmp/var/1893/substituter-data/example.nar' (0.0 MiB installed)...
\rfile:///.../example.nar	100.0% of 0.1 KiB@ substituter-failed /home/nikita/guix/guix-savannah/test-tmp/store/01zv3jf92sxzrlb3k6x39nl1lc8ynffv-corrupt-substitute 0 hash mismatch in downloaded path `/home/nikita/guix/guix-savannah/test-tmp/store/01zv3jf92sxzrlb3k6x39nl1lc8ynffv-corrupt-substitute': expected 09ca7e4eaa6e8ae9c7d261167129184883644d07dfba7cbfbc4c8a2e08360d5b, got eab43a6a0a8b0933e64a8746ab52ca90e61e3c5b316c59ed77c171c2b7b3e902
substitute-binary: warning: authentication and authorization of substitutes disabled!
@ substituter-started /home/nikita/guix/guix-savannah/test-tmp/store/j1zybbqcipmzk89dih5lfv9klvnmhi28-substitute-me-not /home/nikita/guix/guix-savannah/nix/scripts/substitute-binary
warning: authentication and authorization of substitutes disabled!
downloading `/home/nikita/guix/guix-savannah/test-tmp/store/j1zybbqcipmzk89dih5lfv9klvnmhi28-substitute-me-not' from `file:/home/nikita/guix/guix-savannah/test-tmp/var/1893/substituter-data/does-not-exist.nar' (0.0 MiB installed)...
guix substitute-binary: error: open-file: No such file or directory: "/home/nikita/guix/guix-savannah/test-tmp/var/1893/substituter-data/does-not-exist.nar"
@ substituter-failed /home/nikita/guix/guix-savannah/test-tmp/store/j1zybbqcipmzk89dih5lfv9klvnmhi28-substitute-me-not 256 fetching path `/home/nikita/guix/guix-savannah/test-tmp/store/j1zybbqcipmzk89dih5lfv9klvnmhi28-substitute-me-not' failed with exit code 1
@ substituter-started /home/nikita/guix/guix-savannah/test-tmp/store/j1zybbqcipmzk89dih5lfv9klvnmhi28-substitute-me-not /home/nikita/guix/guix-savannah/nix/scripts/substitute-binary
warning: authentication and authorization of substitutes disabled!
downloading `/home/nikita/guix/guix-savannah/test-tmp/store/j1zybbqcipmzk89dih5lfv9klvnmhi28-substitute-me-not' from `file:/home/nikita/guix/guix-savannah/test-tmp/var/1893/substituter-data/does-not-exist.nar' (0.0 MiB installed)...
guix substitute-binary: error: open-file: No such file or directory: "/home/nikita/guix/guix-savannah/test-tmp/var/1893/substituter-data/does-not-exist.nar"
@ substituter-failed /home/nikita/guix/guix-savannah/test-tmp/store/j1zybbqcipmzk89dih5lfv9klvnmhi28-substitute-me-not 256 fetching path `/home/nikita/guix/5 operations
4 operations
7 operations
27 operations
5 operations
guix-savannah/test-tmp/store/j1zybbqcipmzk89dih5lfv9klvnmhi28-substitute-me-not' failed with exit code 1
killing process 2221
finding garbage collector roots...
deleting unused links...
finding garbage collector roots...
deleting unused links...
finding garbage collector roots...
deleting unused links...
finding garbage collector roots...
deleting unused links...
%%%% Starting test store  (Writing full log to "store.log")
tests/store.scm:199: FAIL derivers
tests/store.scm:256: FAIL log-file, derivation
tests/store.scm:268: FAIL log-file, output file name

;;; (spi (#<<substitutable> path: "/home/nikita/guix/guix-savannah/test-tmp/store/rrv50bvj6cp4zfvknjn5s2cqra6j3giw-guile-bootstrap-2.0" deriver: "/home/nikita/guix/guix-savannah/test-tmp/store/hmb24h1acglik6lyqp4ggj5zgqmxd1hw-guile-bootstrap-2.0.drv" refs: () dl-size: 0 nar-size: 1234>))

;;; (corrupt #<condition &nix-protocol-error [message: "some substitutes for the outputs of derivation `/home/nikita/guix/guix-savannah/test-tmp/store/yz25i3wid9psqr9l8l3xg2mcl3qdpwyr-corrupt-substitute.drv' failed (usually happens due to networking issues); try `--fallback' to build derivation from source " status: 1] 89ab1e0>)
tests/store.scm:448: FAIL substitute --fallback

;;; (c #<condition &nix-protocol-error [message: "signed hash doesn't match actual contents of imported archive; archive could be corrupt, or someone is trying to import a Trojan horse" status: 1] 88c3888>)
# of expected passes      26
# of unexpected failures  4
142 operations

FAIL: tests/monads
==================

accepted connection from pid 2301, uid 1000
%%%% Starting test monads  (Writing full log to "monads.log")
tests/monads.scm:114: FAIL mlet* + derivation-expression
tests/monads.scm:132: FAIL text-file*
# of expected passes      10
# of unexpected failures  2
killing process 2307
killing process 2308
192 operations

FAIL: tests/gexp
================

accepted connection from pid 2323, uid 1000
Unrecognized switch --no-auto-compiUsage: guile [OPTION]... [FILE]...
Evaluate code with Guile, interactively or from a script.

  [-s] FILE      load source code from FILE, and exit
  -c EXPR        evalute expression EXPR, and exit
  --             stop scanning arguments; run interactively

The above switches stop argument processing, and pass all
remaining arguments as the value of (command-line).
If FILE begins with `-' the -s switch is mandatory.

  -L DIRECTORY   add DIRECTORY to the front of the module load path
  -C DIRECTORY   like -L, but for compiled files
  -x EXTENSION   add EXTENSION to the front of the load extensions
  -l FILE        load source code from FILE
  -e FUNCTION    after reading script, apply FUNCTION to
                 command line arguments
  --language=LANG  change language; default: scheme
  -ds            do -s script at this point
  --debug        start with the "debugging" VM engine
  --no-debug     start with the normal VM engine (backtraces but
                 no breakpoints); default is --debug for interactive
                 use, but not for `-s' and `-c'.
  --auto-compile compile source files automatically
  --fresh-auto-compile  invalidate auto-compilation cache
  --no-auto-compile  disable automatic source file compilation;
                 default is to enable auto-compilation of source
                 files.
  --listen[=P]   listen on a local port or a path for REPL clients;
                 if P is not given, the default is local port 37146
  -q             inhibit loading of user init file
  --use-srfi=LS  load SRFI modules for the SRFIs in LS,
                 which is a list of numbers like "2,13,14"
  -h, --help     display this help and exit
  -v, --version  display version information and exit
  \              read arguments from following script lines

Report bugs to: bug-guile@gnu.org
GNU Guile home page: <http://www.gnu.org/software/guile/>
General help using GNU software: <http://www.gnu.org/gethelp/>
%%%% Starting test gexp  (Writing full log to "gexp.log")
tests/gexp.scm:214: FAIL gexp->script
# of expected passes      12
# of unexpected failures  1
348 operations

FAIL: tests/guix-package
========================

+ guix package --version
guix package (GNU Guix) 0.7
Copyright (C) 2014 the Guix authors
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
+ profile=t-profile-2838
+ rm -f t-profile-2838
+ trap 'rm "$profile" "$profile-"[0-9]* ; rm -rf t-home-2838' EXIT
+ guix package --bootstrap -e +
guix package: error: expression "+" does not evaluate to a package
+ true
+ guix package --bootstrap -p t-profile-2838 -i guile-bootstrap
accepted connection from pid 2848, uid 1000
The following package will be installed:
   guile-bootstrap-2.0	out	/home/nikita/guix/guix-savannah/test-tmp/store/rrv50bvj6cp4zfvknjn5s2cqra6j3giw-guile-bootstrap-2.0

substitute-binary: warning: authentication and authorization of substitutes disabled!
1 package in profile
+ test -L t-profile-2838
+ test -L t-profile-2838-1-link
+ test -f t-profile-2838/bin/guile
+ guix gc --list-live
++ readlink t-profile-2838-1-link
+ grep /home/nikita/guix/guix-savannah/test-tmp/store/xj1dfi04gbs454f86fdnv2cp1r8zmf7s-profile
accepted connection from pid 2873, uid 1000
finding garbage collector roots...
cannot read potential root `/home/nikita/guix/guix-savannah/test-tmp/var/2833/manifests'
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/nikita/guix/guix-savannah/nix/scripts/list-runtime-roots
;;; compiled /home/nikita/guix/guix-savannah/test-tmp/var/2833/cache-2833/guile/ccache/2.0-LE-4-2.0/home/nikita/guix/guix-savannah/nix/scripts/list-runtime-roots.go
determining live/dead paths...
/home/nikita/guix/guix-savannah/test-tmp/store/xj1dfi04gbs454f86fdnv2cp1r8zmf7s-profile
+ guix package --bootstrap -p t-profile-2838 -i guile-bootstrap
1 operations
accepted connection from pid 2880, uid 1000
nothing to be done
8 operations
+ test -L t-profile-2838
+ test -L t-profile-2838-1-link
+ test -f t-profile-2838-2-link
+ test -f t-profile-2838/bin/guile
+ guix package --search-paths -p t-profile-2838
++ guix package --search-paths -p t-profile-2838
++ wc -l
+ test 0 = 0
+ guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)'
+ boot_make='(@@ (gnu packages base) gnu-make-boot0)'
++ guix build -e '(@@ (gnu packages base) gnu-make-boot0)'
++ grep -v -e -debug
accepted connection from pid 2892, uid 1000
substitute-binary: warning: authentication and authorization of substitutes disabled!
The following derivations will be built:
   /home/nikita/guix/guix-savannah/test-tmp/store/f32md8fdc0q68jpcl4246ix36s4flxbj-make-boot0-4.0.drv
   /home/nikita/guix/guix-savannah/test-tmp/store/732ssfj15pszbc2kqkx9sbcq658g6rvy-make-4.0.tar.xz.drv
killing process 2998
guix build: error: build failed: closing file descriptor 1769537584: Bad file descriptor
80 operations
+ boot_make_drv=
+ rm t-profile-2838 t-profile-2838-1-link
+ rm -rf t-home-2838

FAIL: tests/guix-register
=========================

+ guix-register --version
guix-register (GNU Guix) 0.7
+ new_store=t-register-3255
+ closure=t-register-closure-3255
+ rm -rf t-register-3255
+ exit_hook=:
+ trap 'chmod -R +w t-register-3255 ; rm -rf t-register-3255 t-register-closure-3255 ; $exit_hook' EXIT
+ new_file=/home/nikita/guix/guix-savannah/test-tmp/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-guix-register-3255
+ echo 'Fake store file to test registration.'
+ guix-register
+ guile -c '
   (use-modules (guix store))
   (define s (open-connection))
   (exit (and (valid-path? s "/home/nikita/guix/guix-savannah/test-tmp/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-guix-register-3255")
              (null? (references s "/home/nikita/guix/guix-savannah/test-tmp/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-guix-register-3255"))
              (pair? (delete-paths s (list "/home/nikita/guix/guix-savannah/test-tmp/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-guix-register-3255")))))'
accepted connection from pid 3263, uid 1000
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/nikita/guix/guix-savannah/nix/scripts/list-runtime-roots
;;; compiled /home/nikita/guix/guix-savannah/test-tmp/var/3250/cache-3250/guile/ccache/2.0-LE-4-2.0/home/nikita/guix/guix-savannah/nix/scripts/list-runtime-roots.go
finding garbage collector roots...
cannot read potential root `/home/nikita/guix/guix-savannah/test-tmp/var/3250/manifests'
deleting `/home/nikita/guix/guix-savannah/test-tmp/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-guix-register-3255'
deleting `/home/nikita/guix/guix-savannah/test-tmp/store/trash'
deleting unused links...
note: currently hard linking saves -0.00 MiB
3 operations
+ mkdir -p t-register-3255//gnu/store
++ cd t-register-3255//gnu/store
++ pwd
+ new_store_dir=/home/nikita/guix/guix-savannah/t-register-3255/gnu/store
++ cd t-register-3255
++ pwd
+ new_store=/home/nikita/guix/guix-savannah/t-register-3255
++ guix build guile-bootstrap
accepted connection from pid 3270, uid 1000
substitute-binary: warning: authentication and authorization of substitutes disabled!
+ to_copy=/home/nikita/guix/guix-savannah/test-tmp/store/rrv50bvj6cp4zfvknjn5s2cqra6j3giw-guile-bootstrap-2.0
13 operations
+ cp -r /home/nikita/guix/guix-savannah/test-tmp/store/rrv50bvj6cp4zfvknjn5s2cqra6j3giw-guile-bootstrap-2.0 /home/nikita/guix/guix-savannah/t-register-3255/gnu/store
++ basename /home/nikita/guix/guix-savannah/test-tmp/store/rrv50bvj6cp4zfvknjn5s2cqra6j3giw-guile-bootstrap-2.0
+ copied=/home/nikita/guix/guix-savannah/t-register-3255/gnu/store/rrv50bvj6cp4zfvknjn5s2cqra6j3giw-guile-bootstrap-2.0
+ cat
+ guix-register -p /home/nikita/guix/guix-savannah/t-register-3255
+ guix-register --prefix /home/nikita/guix/guix-savannah/t-register-3255 t-register-closure-3255
+ NIX_IGNORE_SYMLINK_STORE=1
+ NIX_STORE_DIR=/home/nikita/guix/guix-savannah/t-register-3255/gnu/store
+ NIX_STATE_DIR=/home/nikita/guix/guix-savannah/t-register-3255/usr/local/var
+ NIX_LOG_DIR=/home/nikita/guix/guix-savannah/t-register-3255/usr/local/var/log/guix
+ NIX_DB_DIR=/home/nikita/guix/guix-savannah/t-register-3255/usr/local/var/guix/db
+ export NIX_IGNORE_SYMLINK_STORE NIX_STORE_DIR NIX_STATE_DIR NIX_LOG_DIR NIX_DB_DIR
+ subdaemon_pid=3300
+ exit_hook='kill 3300'
+ guix-daemon --disable-chroot
++ basename /home/nikita/guix/guix-savannah/test-tmp/store/rrv50bvj6cp4zfvknjn5s2cqra6j3giw-guile-bootstrap-2.0
+ final_name=/gnu/store/rrv50bvj6cp4zfvknjn5s2cqra6j3giw-guile-bootstrap-2.0
+ guile -c '
   (use-modules (guix store))
   (define s (open-connection))
   (exit (equal? (list "/home/nikita/guix/guix-savannah/t-register-3255/gnu/store/rrv50bvj6cp4zfvknjn5s2cqra6j3giw-guile-bootstrap-2.0") (dead-paths s)))'
accepted connection from pid 3302, uid 1000
finding garbage collector roots...
cannot read potential root `/home/nikita/guix/guix-savannah/t-register-3255/usr/local/var/manifests'
determining live/dead paths...
1 operations
+ type -P sqlite3
/usr/local/bin/sqlite3
+ echo 'select * from ValidPaths where path="/gnu/store/rrv50bvj6cp4zfvknjn5s2cqra6j3giw-guile-bootstrap-2.0";'
+ sqlite3 /home/nikita/guix/guix-savannah/t-register-3255/usr/local/var/guix/db/db.sqlite
SQLite header and source version mismatch
2011-11-01 00:52:41 c7c6050ef060877ebe77b41d959e9df13f8c9b5e
2013-09-03 17:11:13 7dd4968f235d6e1ca9547cda9cf3bd570e1609ef
+ chmod -R +w t-register-3255
+ rm -rf t-register-3255 t-register-closure-3255
+ kill 3300


[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-05-07 23:14                           ` Nikita Karetnikov
@ 2014-05-08 16:35                             ` Ludovic Courtès
  2014-05-11 14:52                               ` Nikita Karetnikov
  2014-09-02 21:04                               ` Ludovic Courtès
  0 siblings, 2 replies; 22+ messages in thread
From: Ludovic Courtès @ 2014-05-08 16:35 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: guix-devel

Nikita Karetnikov <nikita@karetnikov.org> skribis:

>> The SRFI-64 log files of the failing tests, plus test-suite.log.  Test
>> failures must not remain uncorrected!  ;-)
>
> Attached.

Thanks.

>> What Guile and libgc version is this, and what platform?
>
> 2.0.9; 1:7.1-8ubuntu0.12.04.1 (from Trisquel); i686.
>
>> Does the installation seem sane, basically?  Do ‘guix build’, ‘guix
>> package’ etc. work somehow, or not even?
>
> Turns out I can’t even build ‘hello’

Please say exactly why you “can’t”.

> (though the build succeeded in the logs).  I didn’t expect this
> because Guix had worked on this machine previously.  IIRC, I did the
> following: deleted ‘/gnu/store’ and ‘/usr/local/var/guix/*’, cloned,
> and ran ‘./bootstrap’ & co.

Why the hell do you keep deleting the store?  :-)

>> substitute-binary: warning: authentication and authorization of substitutes disabled!
>
> How can I enable them?  Are they specifically disabled for testing
> purposes?

Exactly, see test-env.in.

>> SQLite header and source version mismatch
>> 2011-11-01 00:52:41 c7c6050ef060877ebe77b41d959e9df13f8c9b5e
>> 2013-09-03 17:11:13 7dd4968f235d6e1ca9547cda9cf3bd570e1609ef
>
> This was discussed before and should be fixed by upgrading SQLite.

OK.  Can you report how things go one that is fixed?

> Test end:
>   result-kind: fail
>   actual-value: #f
>   actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1599602736: Bad file descriptor" status: 1] 8a62798>)

That one occurs many times.  I suspect this has to do with the daemon
features enabled by c0412fedf, though I don’t see which one.

Could you try to:

  1. Run ‘git show c0412fedf | patch -p1 -R’, and then confirm that the
     problem disappears.

  2. Run ‘git reset --hard’, edit config.h, and comment out the HAVE_
     macros corresponding to the functions listed in c0412fedf, one at a
     time.

     Alternately, you could strace guix-daemon to see where EBADF comes
     from.

     Or, even better, run guix-daemon in gdb, run ‘catch throw’, and get
     a backtrace of the thing that throws.

We can chat on IRC to help.

Thanks in advance,
Ludo’.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-05-08 16:35                             ` Ludovic Courtès
@ 2014-05-11 14:52                               ` Nikita Karetnikov
  2014-05-11 19:17                                 ` Ludovic Courtès
  2014-09-02 21:04                               ` Ludovic Courtès
  1 sibling, 1 reply; 22+ messages in thread
From: Nikita Karetnikov @ 2014-05-11 14:52 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1276 bytes --]

>>> Does the installation seem sane, basically?  Do ‘guix build’, ‘guix
>>> package’ etc. work somehow, or not even?

>> Turns out I can’t even build ‘hello’

> Please say exactly why you “can’t”.

Currently, it fails due to the “bad file descriptor” error.

> Why the hell do you keep deleting the store?  :-)

I want to make sure that ‘prefetch’ downloads all the needed tarballs.
Since I don’t use Guix on that machine, I delete the store each time
instead of using a different prefix.

>> SQLite header and source version mismatch
>> 2011-11-01 00:52:41 c7c6050ef060877ebe77b41d959e9df13f8c9b5e
>> 2013-09-03 17:11:13 7dd4968f235d6e1ca9547cda9cf3bd570e1609ef

>> This was discussed before and should be fixed by upgrading SQLite.

> OK.  Can you report how things go one that is fixed?

> 1. Run ‘git show c0412fedf | patch -p1 -R’, and then confirm that the
>    problem disappears.

> 2. Run ‘git reset --hard’, edit config.h, and comment out the HAVE_
>    macros corresponding to the functions listed in c0412fedf, one at a
>    time.

What would be a reliable way to run the testsuite after each of the
above steps?  Would ‘make clean && autoreconf -vfi && make && make
check’ be sufficient?

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-05-11 14:52                               ` Nikita Karetnikov
@ 2014-05-11 19:17                                 ` Ludovic Courtès
  2014-09-02 21:06                                   ` Ludovic Courtès
  0 siblings, 1 reply; 22+ messages in thread
From: Ludovic Courtès @ 2014-05-11 19:17 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: guix-devel

Nikita Karetnikov <nikita@karetnikov.org> skribis:

>>>> Does the installation seem sane, basically?  Do ‘guix build’, ‘guix
>>>> package’ etc. work somehow, or not even?
>
>>> Turns out I can’t even build ‘hello’
>
>> Please say exactly why you “can’t”.
>
> Currently, it fails due to the “bad file descriptor” error.

OK.

>> Why the hell do you keep deleting the store?  :-)
>
> I want to make sure that ‘prefetch’ downloads all the needed tarballs.
> Since I don’t use Guix on that machine, I delete the store each time
> instead of using a different prefix.

Ah, OK.

>>> SQLite header and source version mismatch
>>> 2011-11-01 00:52:41 c7c6050ef060877ebe77b41d959e9df13f8c9b5e
>>> 2013-09-03 17:11:13 7dd4968f235d6e1ca9547cda9cf3bd570e1609ef
>
>>> This was discussed before and should be fixed by upgrading SQLite.
>
>> OK.  Can you report how things go one that is fixed?
>
>> 1. Run ‘git show c0412fedf | patch -p1 -R’, and then confirm that the
>>    problem disappears.
>
>> 2. Run ‘git reset --hard’, edit config.h, and comment out the HAVE_
>>    macros corresponding to the functions listed in c0412fedf, one at a
>>    time.
>
> What would be a reliable way to run the testsuite after each of the
> above steps?  Would ‘make clean && autoreconf -vfi && make && make
> check’ be sufficient?

‘make check’ should be sufficient: it will rebuild ‘configure’, re-run
it, rebuild guix-daemon, etc.

Ludo’.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-05-08 16:35                             ` Ludovic Courtès
  2014-05-11 14:52                               ` Nikita Karetnikov
@ 2014-09-02 21:04                               ` Ludovic Courtès
  1 sibling, 0 replies; 22+ messages in thread
From: Ludovic Courtès @ 2014-09-02 21:04 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: guix-devel

ludo@gnu.org (Ludovic Courtès) skribis:

>> Test end:
>>   result-kind: fail
>>   actual-value: #f
>>   actual-error: (srfi-34 #<condition &nix-protocol-error [message: "closing file descriptor 1599602736: Bad file descriptor" status: 1] 8a62798>)
>
> That one occurs many times.  I suspect this has to do with the daemon
> features enabled by c0412fedf, though I don’t see which one.

(4 months later...)

I reproduced this EBADF thing with a 2.6.35 kernel on x86_64, and the
culprit turned out to be vfork: commenting out uses of vfork in the
daemon solved the problem.

That sort of ringed a bell, and indeed, Nix commit f794465c (Nov. 2012!)
disabled vfork for similar reasons.

So guix-daemon no longer uses vfork.

Ludo’.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-05-11 19:17                                 ` Ludovic Courtès
@ 2014-09-02 21:06                                   ` Ludovic Courtès
  2014-09-02 22:05                                     ` Nikita Karetnikov
  0 siblings, 1 reply; 22+ messages in thread
From: Ludovic Courtès @ 2014-09-02 21:06 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: guix-devel

BTW, I’ve been traveling lately, and I’ve really missed ‘guix prefetch’.

So if you have spare time to pour into it, or if someone else wants to
take it over, that’d be nice!

Ludo’.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Proposal: prefetch tarballs in a batch
  2014-09-02 21:06                                   ` Ludovic Courtès
@ 2014-09-02 22:05                                     ` Nikita Karetnikov
  0 siblings, 0 replies; 22+ messages in thread
From: Nikita Karetnikov @ 2014-09-02 22:05 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 300 bytes --]

> BTW, I’ve been traveling lately, and I’ve really missed ‘guix
> prefetch’.

Heh, that was the motivation.

> So if you have spare time to pour into it, or if someone else wants to
> take it over, that’d be nice!

I doubt so, unfortunately.  So please do take it over if you can.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2014-09-02 22:06 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-27 23:25 Proposal: prefetch tarballs in a batch Nikita Karetnikov
2014-03-28 13:23 ` Ludovic Courtès
2014-04-01 23:23   ` Nikita Karetnikov
2014-04-02 12:57     ` Ludovic Courtès
2014-04-02 22:37       ` Nikita Karetnikov
2014-04-03  7:24         ` Ludovic Courtès
2014-04-09 22:29           ` Nikita Karetnikov
2014-04-10  8:21             ` Ludovic Courtès
2014-04-12 20:19               ` Nikita Karetnikov
2014-04-12 22:44                 ` Ludovic Courtès
2014-04-24 21:20                   ` Nikita Karetnikov
2014-04-25 11:51                     ` Ludovic Courtès
2014-04-25 12:04                     ` Ludovic Courtès
2014-05-06 12:37                       ` Nikita Karetnikov
2014-05-06 20:02                         ` Ludovic Courtès
2014-05-07 23:14                           ` Nikita Karetnikov
2014-05-08 16:35                             ` Ludovic Courtès
2014-05-11 14:52                               ` Nikita Karetnikov
2014-05-11 19:17                                 ` Ludovic Courtès
2014-09-02 21:06                                   ` Ludovic Courtès
2014-09-02 22:05                                     ` Nikita Karetnikov
2014-09-02 21:04                               ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).