GNU bug report logs - #49418
Importing haskell packages from hackage doesn't apply metadata revisions

Previous Next

Package: guix;

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

Date: Mon, 5 Jul 2021 14:11: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 49418 in the body.
You can then email your comments to 49418 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#49418; Package guix. (Mon, 05 Jul 2021 14:11: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, 05 Jul 2021 14:11: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: Importing haskell packages from hackage doesn't apply metadata revisions
Date: Mon, 05 Jul 2021 16:09:31 +0200
[Message part 1 (text/plain, inline)]
The hackage store of haskell packages allows maintainers to update package metadata directly on hackage without updating the associated archive of a package. For instance, the cabal file of the integer-logarithms package version 1.0.3 [0] has been updated since 1.0.3 was published, relaxing the constraints on some dependencies[1]. This means that, if I try to build the attached integer-logarithms.scm (created from guix import hackage integer-logarithms and modified to use ghc-8.8) I get the following error:

```
Setup.hs: Encountered missing or private dependencies:
base >=4.3 && <4.13

command "runhaskell" "Setup.hs" "configure" "--prefix=/gnu/store/lssajarfg1vr6xbhi5dfvnn3xs01v3bz-ghc-integer-logarithms-bootstrap-1.0.3" "--libdir=/gnu/store/lssajarfg1vr6xbhi5dfvnn3xs01v3bz-ghc-integer-logarithms-bootstrap-1.0.3/lib" "--docdir=/gnu/store/lssajarfg1vr6xbhi5dfvnn3xs01v3bz-ghc-integer-logarithms-bootstrap-1.0.3/share/doc/ghc-integer-logarithms-bootstrap-1.0.3" "--libsubdir=$compiler/$pkg-$version" "--package-db=/tmp/guix-build-ghc-integer-logarithms-bootstrap-1.0.3.drv-0/package.conf.d" "--global" "--enable-shared" "--enable-executable-dynamic" "--ghc-option=-fPIC" "--ghc-option=-optl=-Wl,-rpath=/gnu/store/lssajarfg1vr6xbhi5dfvnn3xs01v3bz-ghc-integer-logarithms-bootstrap-1.0.3/lib/$compiler/$pkg-$version" failed with status 1
builder for `/gnu/store/pwdhhwp6d6b5g5pgik9y6ml5g1d8fxf5-ghc-integer-logarithms-bootstrap-1.0.3.drv' failed with exit code 1
build of /gnu/store/pwdhhwp6d6b5g5pgik9y6ml5g1d8fxf5-ghc-integer-logarithms-bootstrap-1.0.3.drv failed
```

In ghc 8.8 the base version is 4.13, and the updated cabal file for integer-logarithms amends the constrants to allow that version.

The solution might be to use `cabal get` to download the archive instead of downloading the .tar.gz directly, or manually amending the cabal file after downloading.

0: https://hackage.haskell.org/package/integer-logarithms-1.0.3
1: https://hackage.haskell.org/package/integer-logarithms-1.0.3/revisions/
[integer-logarithms.scm (text/x-scheme, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#49418; Package guix. (Mon, 05 Jul 2021 15:33:02 GMT) Full text and rfc822 format available.

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

From: John Kehayias <john.kehayias <at> protonmail.com>
To: "49418 <at> debbugs.gnu.org" <49418 <at> debbugs.gnu.org>
Subject: Importing haskell packages from hackage doesn't apply metadata
 revisions
Date: Mon, 05 Jul 2021 15:32:50 +0000
I've run into the same problem, seems like fetching the revised cabal file would be the best bet. (In the meantime I've modified package definitions to make the metadata changes, but that is manual and certainly should be automated by import.)




Information forwarded to bug-guix <at> gnu.org:
bug#49418; Package guix. (Wed, 07 Jul 2021 03:27:02 GMT) Full text and rfc822 format available.

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

From: John Kehayias <john.kehayias <at> protonmail.com>
To: "49418 <at> debbugs.gnu.org" <49418 <at> debbugs.gnu.org>
Subject: Re: Importing haskell packages from hackage doesn't apply metadata
 revisions
Date: Wed, 07 Jul 2021 03:26:22 +0000
Actually, this does exist in the Haskell build system in Guix, but seems to be undocumented and not used by the importer. You can add the following to the arguments (in the bootstrap package in this case) to use a metadata revision:

#:cabal-revision ("2" "0a6j3313vz7n7dn8abddyib4jggblaq89f87ib4imdwjxjajbm33")

The hash is from running guix hash file (where file = 2.cabal in this case, downloaded from Hackage). This should be part of the importer, to specify a revision or by default grab the latest, I would say.

(and I'm guessing you know this is packaged in guix as integer-logarithms, without the "ghc-" prefix for some reason; not the only package like that I've noticed)




Information forwarded to bug-guix <at> gnu.org:
bug#49418; Package guix. (Wed, 07 Jul 2021 06:00:02 GMT) Full text and rfc822 format available.

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

From: "Philip Munksgaard" <philip <at> munksgaard.me>
To: "John Kehayias" <john.kehayias <at> protonmail.com>,
 "49418 <at> debbugs.gnu.org" <49418 <at> debbugs.gnu.org>
Subject: Re: bug#49418: Importing haskell packages from hackage doesn't apply metadata revisions
Date: Wed, 07 Jul 2021 07:58:55 +0200
On Wed, 7 Jul 2021, at 05:26, John Kehayias via Bug reports for GNU Guix wrote:
> Actually, this does exist in the Haskell build system in Guix, but 
> seems to be undocumented and not used by the importer. You can add the 
> following to the arguments (in the bootstrap package in this case) to 
> use a metadata revision:
> 
> #:cabal-revision ("2" "0a6j3313vz7n7dn8abddyib4jggblaq89f87ib4imdwjxjajbm33")
> 
> The hash is from running guix hash file (where file = 2.cabal in this 
> case, downloaded from Hackage). This should be part of the importer, to 
> specify a revision or by default grab the latest, I would say.
> 
> (and I'm guessing you know this is packaged in guix as 
> integer-logarithms, without the "ghc-" prefix for some reason; not the 
> only package like that I've noticed)
> 

Ah yes, good catch! I agree that the fix should be to amend the importer, such that it finds out about these revisions and automatically uses the latest one.




Reply sent to "Philip Munksgaard" <philip <at> munksgaard.me>:
You have taken responsibility. (Wed, 07 Jul 2021 09:53:02 GMT) Full text and rfc822 format available.

Notification sent to "Philip Munksgaard" <philip <at> munksgaard.me>:
bug acknowledged by developer. (Wed, 07 Jul 2021 09:53:02 GMT) Full text and rfc822 format available.

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

From: "Philip Munksgaard" <philip <at> munksgaard.me>
To: "John Kehayias" <john.kehayias <at> protonmail.com>,
 "49418-done <at> debbugs.gnu.org" <49418-done <at> debbugs.gnu.org>
Subject: Re: bug#49418: Importing haskell packages from hackage doesn't apply metadata revisions
Date: Wed, 07 Jul 2021 11:52:05 +0200
On Wed, 7 Jul 2021, at 07:58, Philip Munksgaard wrote:
> On Wed, 7 Jul 2021, at 05:26, John Kehayias via Bug reports for GNU Guix wrote:
> > Actually, this does exist in the Haskell build system in Guix, but 
> > seems to be undocumented and not used by the importer. You can add the 
> > following to the arguments (in the bootstrap package in this case) to 
> > use a metadata revision:
> > 
> > #:cabal-revision ("2" "0a6j3313vz7n7dn8abddyib4jggblaq89f87ib4imdwjxjajbm33")
> > 
> > The hash is from running guix hash file (where file = 2.cabal in this 
> > case, downloaded from Hackage). This should be part of the importer, to 
> > specify a revision or by default grab the latest, I would say.
> > 
> > (and I'm guessing you know this is packaged in guix as 
> > integer-logarithms, without the "ghc-" prefix for some reason; not the 
> > only package like that I've noticed)
> > 
> 
> Ah yes, good catch! I agree that the fix should be to amend the 
> importer, such that it finds out about these revisions and 
> automatically uses the latest one.

Actually, upon closer inspection, that's exactly what it does! Instead of actually using the importer in my original example (as I claimed), I had actually just modified the code from gnu/packages/haskell-xyz.scm. Doing a fresh import correctly picks up that there is a new revision of the cabal file and produces the right derivation. I'll close this issue.




Information forwarded to bug-guix <at> gnu.org:
bug#49418; Package guix. (Wed, 07 Jul 2021 14:38:01 GMT) Full text and rfc822 format available.

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

From: John Kehayias <john.kehayias <at> protonmail.com>
To: Philip Munksgaard <philip <at> munksgaard.me>
Cc: "49418-done <at> debbugs.gnu.org" <49418-done <at> debbugs.gnu.org>
Subject: Re: bug#49418: Importing haskell packages from hackage doesn't apply
 metadata revisions
Date: Wed, 07 Jul 2021 14:37:42 +0000
Yes, I noticed that later too on some packages I'm working on. Glad you got it sorted out.

Still should be documented somewhere, I guess under the build systems.




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

This bug report was last modified 2 years and 258 days ago.

Previous Next


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