--- Begin Message ---
Subject: |
Importing haskell packages from hackage doesn't apply metadata revisions |
Date: |
Mon, 05 Jul 2021 16:09:31 +0200 |
User-agent: |
Cyrus-JMAP/3.5.0-alpha0-530-gd0c265785f-fm-20210616.002-gd0c26578 |
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
Description: Text Data
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#49418: Importing haskell packages from hackage doesn't apply metadata revisions |
Date: |
Wed, 07 Jul 2021 11:52:05 +0200 |
User-agent: |
Cyrus-JMAP/3.5.0-alpha0-531-g1160beca77-fm-20210705.001-g1160beca |
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.
--- End Message ---