GNU bug report logs - #53655
haskell build system cannot build attoparsec

Previous Next

Package: guix;

Reported by: "Philip Munksgaard" <philip <at> munksgaard.me>

Date: Mon, 31 Jan 2022 10:35:01 UTC

Severity: normal

Done: "Philip Munksgaard" <philip <at> munksgaard.me>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53655 in the body.
You can then email your comments to 53655 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#53655; Package guix. (Mon, 31 Jan 2022 10:35:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Philip Munksgaard" <philip <at> munksgaard.me>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 31 Jan 2022 10:35:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Philip Munksgaard" <philip <at> munksgaard.me>
To: bug-guix <at> gnu.org
Subject: haskell build system cannot build attoparsec
Date: Mon, 31 Jan 2022 11:33:45 +0100
[Message part 1 (text/plain, inline)]
I'm trying to build a newer version of attoparsec than the one included in guix, namely version 0.14.4.

First of all, `guix import hackage -r attoparsec` fails, as far as I can tell because of the requirement to attoparsec-internal, with the following error:

```
$ guix import hackage -r attoparsec

Starting download of /tmp/guix-file.szLCRk
From https://hackage.haskell.org/package/attoparsec/attoparsec-0.14.4.tar.gz...
 ….14.4.tar.gz  157KiB                5.1MiB/s 00:00 [##################] 100.0%
Backtrace:
           7 (primitive-load "/home/munksgaard/.config/guix/current/…")
In guix/ui.scm:
   2209:7  6 (run-guix . _)
  2172:10  5 (run-guix-command _ . _)
In guix/scripts/import.scm:
   124:11  4 (guix-import . _)
In guix/scripts/import/hackage.scm:
   129:26  3 (guix-import-hackage . _)
In guix/import/utils.scm:
   504:23  2 (recursive-import _ #:repo->guix-package _ #:guix-name _ …)
In srfi/srfi-1.scm:
   586:17  1 (map1 (("attoparsec-internal" #f)))
In guix/import/utils.scm:
   492:33  0 (lookup-node "attoparsec-internal" #f)

guix/import/utils.scm:492:33: In procedure lookup-node:
Wrong number of values returned to continuation (expected 2)
```

`guix import hackage attoparsec` succeeds, but I have to manually remove the dependency on attoparsec-internal, resulting in this file:

```
(define-module (gnu packages futhark)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system haskell)
  #:use-module (guix licenses)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (gnu packages)
  #:use-module (gnu packages haskell)
  #:use-module (gnu packages haskell)
  #:use-module (gnu packages haskell-web)
  #:use-module (gnu packages haskell-xyz)
  #:use-module (gnu packages haskell-check)
  #:use-module (gnu packages haskell-crypto))

(package
  (name "ghc-attoparsec")
  (version "0.14.4")
  (source
    (origin
      (method url-fetch)
      (uri (hackage-uri "attoparsec" version))
      (sha256
        (base32 "0v4yjz4qi8bwhbyavqxlhsfb1iv07v10gxi64khmsmi4hvjpycrz"))))
  (build-system haskell-build-system)
  (inputs (list ghc-scientific))
  (native-inputs
    (list ghc-quickcheck
          ghc-quickcheck-unicode
          ghc-tasty
          ghc-tasty-quickcheck
          ghc-vector))
  (arguments
    `(#:cabal-revision
      ("1" "149ihklmwnl13mmixq6iq5gzggkgqwsqrjlg2fshqwwbvbd4nn3r")))
  (home-page "https://github.com/bgamari/attoparsec")
  (synopsis "Fast combinator parsing for bytestrings and text")
  (description
    "This package provides a fast parser combinator library, aimed particularly at
dealing efficiently with network protocols and complicated text/binary file
formats.")
  (license license:bsd-3))
```

When trying to build this file however, I get the following error:

```
running "runhaskell Setup.hs" with command "register" and parameters ("--gen-pkg-config=/gnu/store/25ql0xsjqf0alrvy6hmpw6gzirzbqfmv-ghc-attoparsec-0.14.4/ghc-attoparsec-0.14.4.conf")
error: in phase 'register': uncaught exception:
system-error "fport_read" "~A" ("Is a directory") (21)
phase `register' failed after 0.5 seconds
Backtrace:
          11 (primitive-load "/gnu/store/01ry4yp98silvy0mfwgn8c77fxz…")
In guix/build/gnu-build-system.scm:
    906:2 10 (gnu-build #:source _ #:outputs _ #:inputs _ #:phases . #)
In ice-9/boot-9.scm:
  1752:10  9 (with-exception-handler _ _ #:unwind? _ # _)
In srfi/srfi-1.scm:
    634:9  8 (for-each #<procedure 7ffff404a920 at guix/build/gnu-b…> …)
In ice-9/boot-9.scm:
  1752:10  7 (with-exception-handler _ _ #:unwind? _ # _)
In guix/build/gnu-build-system.scm:
   927:23  6 (_)
In guix/build/haskell-build-system.scm:
   244:23  5 (register #:name _ #:system _ #:inputs _ #:outputs _)
In ice-9/ports.scm:
   433:17  4 (call-with-input-file _ _ #:binary _ #:encoding _ # _)
In ice-9/rdelim.scm:
   160:18  3 (read-string _)
In unknown file:
           2 (read-char #<input: /gnu/store/25ql0xsjqf0alrvy6hmpw6gz…>)
In ice-9/boot-9.scm:
  1685:16  1 (raise-exception _ #:continuable? _)
  1685:16  0 (raise-exception _ #:continuable? _)
```

I've attached the entire build log.
[q4j1fa750jn3jks5xpf5lqd4pnxkk9-ghc-attoparsec-0.14.4.drv.gz (application/gzip, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#53655; Package guix. (Wed, 23 Feb 2022 10:13:01 GMT) Full text and rfc822 format available.

Message #8 received at 53655 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Philip Munksgaard <philip <at> munksgaard.me>, 53655 <at> debbugs.gnu.org
Subject: Re: bug#53655: haskell build system cannot build attoparsec
Date: Wed, 23 Feb 2022 11:02:31 +0100
Hi,

Thanks for he report.

It is 2 different issues; therefore I propose to keep them separated.

On Mon, 31 Jan 2022 at 11:33, "Philip Munksgaard" <philip <at> munksgaard.me> wrote:

> ```
> $ guix import hackage -r attoparsec

[...]

>
> guix/import/utils.scm:492:33: In procedure lookup-node:
> Wrong number of values returned to continuation (expected 2)
> ```

This one is about the importer.  I think it comes from the current
cabal.scm parser; not able to deal with:

--8<---------------cut here---------------start------------->8---
-- We need to test and benchmark these modules,
-- but do not want to expose them to end users
library attoparsec-internal
  hs-source-dirs: internal
  build-depends: array,

[...]

library
  build-depends: array,
[...]
                 attoparsec-internal
--8<---------------cut here---------------end--------------->8---

Could you open another bug report for that?



Let focus on this one…

> When trying to build this file however, I get the following error:
>
> ```
> running "runhaskell Setup.hs" with command "register" and parameters ("--gen-pkg-config=/gnu/store/25ql0xsjqf0alrvy6hmpw6gzirzbqfmv-ghc-attoparsec-0.14.4/ghc-attoparsec-0.14.4.conf")
> error: in phase 'register': uncaught exception:
> ```

…for this bug report.  Hum, I do not know how where the error comes
from.


Cheers,
simon





Information forwarded to bug-guix <at> gnu.org:
bug#53655; Package guix. (Wed, 23 Feb 2022 11:07:01 GMT) Full text and rfc822 format available.

Message #11 received at 53655 <at> debbugs.gnu.org (full text, mbox):

From: "Philip Munksgaard" <philip <at> munksgaard.me>
To: zimoun <zimon.toutoune <at> gmail.com>, 53655 <at> debbugs.gnu.org
Subject: Re: bug#53655: haskell build system cannot build attoparsec
Date: Wed, 23 Feb 2022 12:06:08 +0100
On Wed, 23 Feb 2022, at 11:02, zimoun wrote:
> It is 2 different issues; therefore I propose to keep them separated.

Yes, I agree, sorry for the confusion. 

> Let focus on this one…
>
>> When trying to build this file however, I get the following error:
>>
>> ```
>> running "runhaskell Setup.hs" with command "register" and parameters ("--gen-pkg-config=/gnu/store/25ql0xsjqf0alrvy6hmpw6gzirzbqfmv-ghc-attoparsec-0.14.4/ghc-attoparsec-0.14.4.conf")
>> error: in phase 'register': uncaught exception:
>> ```
>
> …for this bug report.  Hum, I do not know how where the error comes
> from.
>

And yes, this is indeed the issue I'm mostly concerned about.  It seems like `/gnu/store/25ql0xsjqf0alrvy6hmpw6gzirzbqfmv-ghc-attoparsec-0.14.4/ghc-attoparsec-0.14.4.conf` is expected to be a file, while it is in fact a directory. I'm not sure what that means or why it is important though.




Information forwarded to bug-guix <at> gnu.org:
bug#53655; Package guix. (Wed, 23 Feb 2022 11:27:02 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Philip Munksgaard" <philip <at> munksgaard.me>
To: "John Kehayias" <bug-guix <at> gnu.org>
Subject: Re: bug#53655: haskell build system cannot build attoparsec
Date: Wed, 23 Feb 2022 12:25:36 +0100
On Wed, 23 Feb 2022, at 12:06, Philip Munksgaard wrote:
> And yes, this is indeed the issue I'm mostly concerned about.  It seems 
> like 
> `/gnu/store/25ql0xsjqf0alrvy6hmpw6gzirzbqfmv-ghc-attoparsec-0.14.4/ghc-attoparsec-0.14.4.conf` 
> is expected to be a file, while it is in fact a directory. I'm not sure 
> what that means or why it is important though.

Upon further investigation, it seems like the `register` function in `guix/build/haskell-build-system.scm` assumes that running `runhaskell Setup.hs register --gen-pkg-config=...` will at most result in a single configuration file, while the documentation for `--gen-pkg-config` clearly states that it is also possible that it results in a directory[0].

The relevant section states:

> This option outputs a directory if the package requires multiple registrations: this can occur if internal/convenience libraries are used. These configuration file names are sorted so that they can be registered in order.

I think we need to amend `haskell-build-system.scm` to be able to handle such cases.

0: https://downloads.haskell.org/cabal/Cabal-3.0.0.0/doc/users-guide/installing-packages.html#cmdoption-setup-register-gen-pkg-config




Information forwarded to bug-guix <at> gnu.org:
bug#53655; Package guix. (Wed, 23 Feb 2022 13:58:01 GMT) Full text and rfc822 format available.

Message #17 received at 53655 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Philip Munksgaard <philip <at> munksgaard.me>
Cc: 53655 <at> debbugs.gnu.org
Subject: Re: bug#53655: haskell build system cannot build attoparsec
Date: Wed, 23 Feb 2022 14:57:07 +0100
Hi,

On Wed, 23 Feb 2022 at 12:27, Philip Munksgaard <philip <at> munksgaard.me> wrote:

> The relevant section states:
>
> > This option outputs a directory if the package requires multiple registrations: this can occur if internal/convenience libraries are used. These configuration file names are sorted so that they can be registered in order.
>
> 0: https://downloads.haskell.org/cabal/Cabal-3.0.0.0/doc/users-guide/installing-packages.html#cmdoption-setup-register-gen-pkg-config

Thanks.  Indeed, it may be the issue.


> I think we need to amend `haskell-build-system.scm` to be able to handle such cases.

Well, such change is a core-updates change because it will rebuild the
world.  Let see if in the meantime, the attoparsec package could be
patched.


Cheers,
simon




Information forwarded to bug-guix <at> gnu.org:
bug#53655; Package guix. (Wed, 06 Apr 2022 19:29:02 GMT) Full text and rfc822 format available.

Message #20 received at 53655 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: "Philip Munksgaard" <philip <at> munksgaard.me>
Cc: 53655 <at> debbugs.gnu.org
Subject: Re: bug#53655: haskell build system cannot build attoparsec
Date: Wed, 06 Apr 2022 21:27:57 +0200
Hi,

On Mon, 31 Jan 2022 at 11:33, "Philip Munksgaard" <philip <at> munksgaard.me> wrote:

> ```
> (define-module (gnu packages futhark)
>   #:use-module (guix packages)
>   #:use-module (guix download)
>   #:use-module (guix build-system haskell)
>   #:use-module (guix licenses)
>   #:use-module (guix git-download)
>   #:use-module ((guix licenses) #:prefix license:)
>   #:use-module (gnu packages)
>   #:use-module (gnu packages haskell)
>   #:use-module (gnu packages haskell)
>   #:use-module (gnu packages haskell-web)
>   #:use-module (gnu packages haskell-xyz)
>   #:use-module (gnu packages haskell-check)
>   #:use-module (gnu packages haskell-crypto))
>
> (package
>   (name "ghc-attoparsec")
>   (version "0.14.4")
>   (source
>     (origin
>       (method url-fetch)
>       (uri (hackage-uri "attoparsec" version))
>       (sha256
>         (base32 "0v4yjz4qi8bwhbyavqxlhsfb1iv07v10gxi64khmsmi4hvjpycrz"))))
>   (build-system haskell-build-system)
>   (inputs (list ghc-scientific))
>   (native-inputs
>     (list ghc-quickcheck
>           ghc-quickcheck-unicode
>           ghc-tasty
>           ghc-tasty-quickcheck
>           ghc-vector))
>   (arguments
>     `(#:cabal-revision
>       ("1" "149ihklmwnl13mmixq6iq5gzggkgqwsqrjlg2fshqwwbvbd4nn3r")))
>   (home-page "https://github.com/bgamari/attoparsec")
>   (synopsis "Fast combinator parsing for bytestrings and text")
>   (description
>     "This package provides a fast parser combinator library, aimed particularly at
> dealing efficiently with network protocols and complicated text/binary file
> formats.")
>   (license license:bsd-3))
> ```
>
> When trying to build this file however, I get the following error:

This part is now fixed by <https://issues.guix.gnu.org/54729#2>.  But it
is a core-updates change so the fix will land master at the next
cycle... who knows when. ;-)

For the other issue about the importer, I suggest to close this one and
reopen an issue.


Cheers,
simon




Reply sent to "Philip Munksgaard" <philip <at> munksgaard.me>:
You have taken responsibility. (Thu, 07 Apr 2022 08:25:02 GMT) Full text and rfc822 format available.

Notification sent to "Philip Munksgaard" <philip <at> munksgaard.me>:
bug acknowledged by developer. (Thu, 07 Apr 2022 08:25:02 GMT) Full text and rfc822 format available.

Message #25 received at 53655-done <at> debbugs.gnu.org (full text, mbox):

From: "Philip Munksgaard" <philip <at> munksgaard.me>
To: zimoun <zimon.toutoune <at> gmail.com>
Cc: 53655-done <at> debbugs.gnu.org
Subject: Re: bug#53655: haskell build system cannot build attoparsec
Date: Thu, 07 Apr 2022 10:23:48 +0200
A patch has been submitted for the second part of this issue [0] and a new issue has been created for the first part [1]. I'm therefore closing this issue.

0: https://issues.guix.gnu.org/54729
1: https://issues.guix.gnu.org/54760

On Wed, 6 Apr 2022, at 21:27, zimoun wrote:
> Hi,
>
> On Mon, 31 Jan 2022 at 11:33, "Philip Munksgaard" <philip <at> munksgaard.me> wrote:
>
>> ```
>> (define-module (gnu packages futhark)
>>   #:use-module (guix packages)
>>   #:use-module (guix download)
>>   #:use-module (guix build-system haskell)
>>   #:use-module (guix licenses)
>>   #:use-module (guix git-download)
>>   #:use-module ((guix licenses) #:prefix license:)
>>   #:use-module (gnu packages)
>>   #:use-module (gnu packages haskell)
>>   #:use-module (gnu packages haskell)
>>   #:use-module (gnu packages haskell-web)
>>   #:use-module (gnu packages haskell-xyz)
>>   #:use-module (gnu packages haskell-check)
>>   #:use-module (gnu packages haskell-crypto))
>>
>> (package
>>   (name "ghc-attoparsec")
>>   (version "0.14.4")
>>   (source
>>     (origin
>>       (method url-fetch)
>>       (uri (hackage-uri "attoparsec" version))
>>       (sha256
>>         (base32 "0v4yjz4qi8bwhbyavqxlhsfb1iv07v10gxi64khmsmi4hvjpycrz"))))
>>   (build-system haskell-build-system)
>>   (inputs (list ghc-scientific))
>>   (native-inputs
>>     (list ghc-quickcheck
>>           ghc-quickcheck-unicode
>>           ghc-tasty
>>           ghc-tasty-quickcheck
>>           ghc-vector))
>>   (arguments
>>     `(#:cabal-revision
>>       ("1" "149ihklmwnl13mmixq6iq5gzggkgqwsqrjlg2fshqwwbvbd4nn3r")))
>>   (home-page "https://github.com/bgamari/attoparsec")
>>   (synopsis "Fast combinator parsing for bytestrings and text")
>>   (description
>>     "This package provides a fast parser combinator library, aimed particularly at
>> dealing efficiently with network protocols and complicated text/binary file
>> formats.")
>>   (license license:bsd-3))
>> ```
>>
>> When trying to build this file however, I get the following error:
>
> This part is now fixed by <https://issues.guix.gnu.org/54729#2>.  But it
> is a core-updates change so the fix will land master at the next
> cycle... who knows when. ;-)
>
> For the other issue about the importer, I suggest to close this one and
> reopen an issue.
>
>
> Cheers,
> simon




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 05 May 2022 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 350 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.