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.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: "Philip Munksgaard" <philip <at> munksgaard.me>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#49418: closed (Importing haskell packages from hackage
 doesn't apply metadata revisions)
Date: Wed, 07 Jul 2021 09:53:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 07 Jul 2021 11:52:05 +0200
with message-id <affbe2ca-9725-448a-8e2d-943dfd851196 <at> www.fastmail.com>
and subject line Re: bug#49418: Importing haskell packages from hackage doesn't apply metadata revisions
has caused the debbugs.gnu.org bug report #49418,
regarding Importing haskell packages from hackage doesn't apply metadata revisions
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
49418: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=49418
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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 3 (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)]
[Message part 5 (message/rfc822, inline)]
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.


This bug report was last modified 3 years and 316 days ago.

Previous Next


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