Patchwork Circular dependencies in gnu/packages, weird error message

login
register
mail settings
Submitter Danny Milosavljevic
Date Nov. 4, 2016, 9:26 p.m.
Message ID <20161104222622.2dac6487@scratchpost.org>
Download mbox | patch
Permalink /patch/17205/
State New
Headers show

Comments

Danny Milosavljevic - Nov. 4, 2016, 9:26 p.m.
Hi Ludo,

On Fri, 04 Nov 2016 15:37:52 +0100
ludo@gnu.org (Ludovic Courtès) wrote:
> You should now be able to add #:use-module (gnu packages cross-base) in
> admin.scm.

Yes. However, now I get

In unknown file:
   ?: 18 [primitive-load "/x/home/dannym/src/guix/scripts/guix"]
In guix/ui.scm:
1220: 17 [run-guix-command package "-i" ...]
In ice-9/boot-9.scm:
 157: 16 [catch srfi-34 #<procedure 1eb57a0 at guix/ui.scm:426:2 ()> ...]
 157: 15 [catch system-error ...]
In guix/scripts/package.scm:
 898: 14 [#<procedure 1eb57c0 at guix/scripts/package.scm:886:4 ()>]
 865: 13 [process-actions #<build-daemon 256.15 1ebea40> (# # # # ...)]
In guix/ui.scm:
 706: 12 [show-manifest-transaction # # # ...]
In srfi/srfi-1.scm:
 601: 11 [map #<procedure upgrade-string (name old-version new-version output item)> ...]
In guix/ui.scm:
 664: 10 [upgrade-string "sunxi-tools" "1.4.1" ...]
In guix/packages.scm:
1141: 9 [package-output # # "out" ...]
 793: 8 [cache! #<weak-key-hash-table 189ae40 169/223> # # ...]
1099: 7 [thunk]
 793: 6 [cache! #<weak-key-hash-table 189ab40 172/223> # # ...]
 894: 5 [thunk]
In ice-9/eval.scm:
 387: 4 [eval # #]
 387: 3 [eval # #]
 387: 2 [eval # #]
 387: 1 [eval # #]
In unknown file:
   ?: 0 [struct-ref #<syntax-transformer glibc> 1]

ERROR: In procedure struct-ref:
ERROR: In procedure struct-ref: Wrong type argument in position 1 (expecting struct): #<syntax-transformer glibc>

with:
Ludovic Courtès - Nov. 6, 2016, 5:36 p.m.
Danny Milosavljevic <dannym@scratchpost.org> skribis:

> diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
> index 1d577c7..44ab171 100644
> --- a/gnu/packages/admin.scm
> +++ b/gnu/packages/admin.scm
> @@ -43,6 +43,8 @@
>    #:use-module (guix build-system trivial)
>    #:use-module (gnu packages)
>    #:use-module (gnu packages base)
> +  #:use-module (gnu packages cross-base)
> +;  #:use-module ((gnu packages cross-base) #:select (cross-gcc cross-binutils cross-libc))

Never use #:select for (gnu packages …) modules.

> -     `(("pkg-config" ,pkg-config)))
> +     `(("pkg-config" ,pkg-config)
> +       ("cross-binutils" ,(cross-binutils "arm-linux-gnueabihf"))
> +       ("cross-gcc" ,(cross-gcc "arm-linux-gnueabihf" #:libc (cross-libc "arm-linux-gnueabihf")))

‘cross-gcc’ doesn’t have a #:libc parameter.  Should be

   (let ((triplet "arm-linux-gnueabihf"))
     (cross-gcc triplet
                (cross-binutils triplet)
                (cross-libc triplet)))

HTH!

Ludo’.
Danny Milosavljevic - Nov. 6, 2016, 8:50 p.m.
Hi Ludo,

On Sun, 06 Nov 2016 18:36:34 +0100
ludo@gnu.org (Ludovic Courtès) wrote:
> Danny Milosavljevic <dannym@scratchpost.org> skribis:
> 
> > diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
> > index 1d577c7..44ab171 100644
> > --- a/gnu/packages/admin.scm
> > +++ b/gnu/packages/admin.scm
> > @@ -43,6 +43,8 @@
> >    #:use-module (guix build-system trivial)
> >    #:use-module (gnu packages)
> >    #:use-module (gnu packages base)
> > +  #:use-module (gnu packages cross-base)
> > +;  #:use-module ((gnu packages cross-base) #:select (cross-gcc cross-binutils cross-libc))  
> 
> Never use #:select for (gnu packages …) modules.
> 
> > -     `(("pkg-config" ,pkg-config)))
> > +     `(("pkg-config" ,pkg-config)
> > +       ("cross-binutils" ,(cross-binutils "arm-linux-gnueabihf"))
> > +       ("cross-gcc" ,(cross-gcc "arm-linux-gnueabihf" #:libc (cross-libc "arm-linux-gnueabihf")))  
> 
> ‘cross-gcc’ doesn’t have a #:libc parameter.  Should be
> 
>    (let ((triplet "arm-linux-gnueabihf"))
>      (cross-gcc triplet
>                 (cross-binutils triplet)
>                 (cross-libc triplet)))

Okay, thanks!

After I did that, the error message doesn't change, though:

Backtrace:
In guix/ui.scm:
1220: 19 [run-guix-command package "-i" ...]
In ice-9/boot-9.scm:
 157: 18 [catch srfi-34 #<procedure 197dfe0 at guix/ui.scm:426:2 ()> ...]
 157: 17 [catch system-error #<procedure 5b09750 at ice-9/eval.scm:416:20 ()> ...]
In ice-9/eval.scm:
 481: 16 [lp (#<fluid 47> #<fluid 32>) (#<build-daemon 256.15 5b06740> #t)]
 481: 15 [lp (#<fluid 32>) (#t)]
 481: 14 [lp (#<fluid 30>) (#)]
 432: 13 [eval # #]
In guix/ui.scm:
 706: 12 [show-manifest-transaction # # # ...]
In srfi/srfi-1.scm:
 601: 11 [map #<procedure upgrade-string (name old-version new-version output item)> ...]
In guix/ui.scm:
 664: 10 [upgrade-string "sunxi-tools" "1.4.1" ...]
In guix/packages.scm:
1141: 9 [package-output # # "out" ...]
 793: 8 [cache! #<weak-key-hash-table 13daa20 169/223> # # ...]
1099: 7 [thunk]
 793: 6 [cache! #<weak-key-hash-table 13da720 172/223> # # ...]
 894: 5 [thunk]
In ice-9/eval.scm:
 387: 4 [eval # #]
 387: 3 [eval # #]
 387: 2 [eval # #]
 387: 1 [eval # #]
In unknown file:
   ?: 0 [struct-ref #<syntax-transformer glibc> 1]

ERROR: In procedure struct-ref:
ERROR: In procedure struct-ref: Wrong type argument in position 1 (expecting struct): #<syntax-transformer glibc>

Chunks I used:

+  #:use-module (gnu packages cross-base)
...
+  (let ((triplet "arm-linux-gnueabihf"))
+    (package
+      (name "sunxi-tools")
+      (version "1.4.1")
+      (source
+       (origin
+         (method url-fetch)
+         (uri (string-append "https://github.com/linux-sunxi/"
+                             "sunxi-tools/archive/v" version ".tar.gz"))
+         (sha256
+          (base32 "06qd2b4dlzbmzfy4q9n8v5rkkbmgcfdbv4nkkcp4nysi10k7cpfs"))
+         (modules '((guix build utils)))
+         (snippet
+          ;; Remove binaries contained in the tarball which are only for the
+          ;; target and can be regenerated anyway.
+          '(delete-file-recursively "bin"))
+         (file-name (string-append name "-" version ".tar.gz"))))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)
+         ("cross-gcc" ,(cross-gcc triplet
+                         (cross-binutils triplet)
+                         (cross-libc triplet)))))
+      (inputs
+       `(("libusb" ,libusb)))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f ; no tests exist
+         #:make-flags (list (string-append "PREFIX="
+                                           (assoc-ref %outputs "out"))
+                            (string-append "CROSS_COMPILE="
+                                           ,triplet "-")
+                            "CC=gcc"
+                            "all")
+         #:phases
+         (modify-phases %standard-phases
+           (delete 'configure)
+           (replace 'install
+             (lambda* (#:key make-flags #:allow-other-keys)
+               (zero? (apply system* "make" "install-all" "install-misc"
+                                     make-flags)))))))
+      (home-page "https://github.com/linux-sunxi/sunxi-tools")
+      (synopsis "Hardware management tools for Allwinner computers")
+      (description "This package contains tools for Allwinner devices:
...")
+      (license license:gpl2+))))
Ludovic Courtès - Nov. 6, 2016, 9:29 p.m.
Danny Milosavljevic <dannym@scratchpost.org> skribis:

>  894: 5 [thunk]
> In ice-9/eval.scm:
>  387: 4 [eval # #]
>  387: 3 [eval # #]
>  387: 2 [eval # #]
>  387: 1 [eval # #]
> In unknown file:
>    ?: 0 [struct-ref #<syntax-transformer glibc> 1]
>
> ERROR: In procedure struct-ref:
> ERROR: In procedure struct-ref: Wrong type argument in position 1 (expecting struct): #<syntax-transformer glibc>

We lack source location info in the backtrace because some of the
relevant files have not been compiled (hence the ‘eval’ calls).  So I
don’t really know where this happens.

Does that still happen after ‘make clean-go && make’?

Alternately, could you send an exact (ideally reduced) patch to
reproduce?

Thanks,
Ludo’.
Danny Milosavljevic - Nov. 6, 2016, 10:06 p.m.
> Does that still happen after ‘make clean-go && make’?

No, it does work after that. Weird...

Thanks!

Patch

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 1d577c7..44ab171 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -43,6 +43,8 @@ 
   #:use-module (guix build-system trivial)
   #:use-module (gnu packages)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages cross-base)
+;  #:use-module ((gnu packages cross-base) #:select (cross-gcc cross-binutils cross-libc))
   #:use-module (gnu packages cyrus-sasl)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages readline)
@@ -1874,7 +1876,11 @@  Kerberos and Heimdal and FAST is supported with recent MIT Kerberos.")
         '(delete-file-recursively "bin"))
        (file-name (string-append name "-" version ".tar.gz"))))
     (native-inputs
-     `(("pkg-config" ,pkg-config)))
+     `(("pkg-config" ,pkg-config)
+       ("cross-binutils" ,(cross-binutils "arm-linux-gnueabihf"))
+       ("cross-gcc" ,(cross-gcc "arm-linux-gnueabihf" #:libc (cross-libc "arm-linux-gnueabihf")))
+       ;("cross-libc" ,(cross-libc "arm-linux-gnueabihf"))
+))
     (inputs
      `(("libusb" ,libusb)))
     (build-system gnu-build-system)
@@ -1882,7 +1888,7 @@  Kerberos and Heimdal and FAST is supported with recent MIT Kerberos.")
      `(#:tests? #f ; no tests exist
        #:make-flags (list (string-append "PREFIX="
                                          (assoc-ref %outputs "out"))
-                          "CROSS_COMPILE="
+                          "CROSS_COMPILE=arm-linux-gnueabihf-"