Subject: bug#49418: closed (Re: bug#49418: Importing haskell packages from hackage doesn't apply metadata revisions)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 07 Jul 2021 09:53:02 +0000

Your bug report

#49418: Importing haskell packages from hackage doesn't apply metadata revisions

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
49418: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=49418
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#49418: Importing haskell packages from hackage doesn't apply metadata revisions
From: "Philip Munksgaard" <[email-masked]>
To: "John Kehayias" <[email-masked]>, "[email-masked]" <[email-masked]>
Date: Wed, 07 Jul 2021 11:52:05 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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.

Subject: Importing haskell packages from hackage doesn't apply metadata revisions
From: "Philip Munksgaard" <[email-masked]>
To: [email-masked]
Date: Mon, 05 Jul 2021 16:09:31 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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/