all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#49418: Importing haskell packages from hackage doesn't apply metadata revisions
@ 2021-07-05 14:09 Philip Munksgaard
  2021-07-05 15:32 ` John Kehayias via Bug reports for GNU Guix
  0 siblings, 1 reply; 6+ messages in thread
From: Philip Munksgaard @ 2021-07-05 14:09 UTC (permalink / raw)
  To: 49418

[-- Attachment #1: Type: text/plain, Size: 2016 bytes --]

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/

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: integer-logarithms.scm --]
[-- Type: text/x-scheme; name="integer-logarithms.scm", Size: 2356 bytes --]

(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))

(define-public ghc-integer-logarithms
  (package
    (name "ghc-integer-logarithms")
    (version "1.0.3")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://hackage.haskell.org/package/"
                           "integer-logarithms/integer-logarithms-"
                           version ".tar.gz"))
       (sha256
        (base32
         "05pc5hws66csvcvfswlwcr2fplwn1lbssvwifjxkbbwqhq0n5qjs"))))
    (build-system haskell-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-before 'configure 'update-constraints
           (lambda _
             (substitute* "integer-logarithms.cabal"
               (("tasty >= 0\\.10 && < 1\\.1")
                "tasty >= 0.10 && < 1.2")))))))
    (native-inputs
     `(("ghc-quickcheck" ,ghc-quickcheck)
       ("ghc-smallcheck" ,ghc-smallcheck)
       ("ghc-tasty" ,ghc-tasty)
       ("ghc-tasty-hunit" ,ghc-tasty-hunit)
       ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)
       ("ghc-tasty-smallcheck" ,ghc-tasty-smallcheck)))
    (home-page "https://github.com/Bodigrim/integer-logarithms")
    (synopsis "Integer logarithms")
    (description
     "This package provides the following modules:
@code{Math.NumberTheory.Logarithms} and
@code{Math.NumberTheory.Powers.Integer} from the @code{arithmoi} package,
@code{GHC.Integer.Logarithms.Compat} and
@code{Math.NumberTheory.Power.Natural}, as well as some additional functions
in migrated modules.")
    (license license:expat)))

(define-public ghc-integer-logarithms-bootstrap
  (package
    (inherit ghc-integer-logarithms)
    (name "ghc-integer-logarithms-bootstrap")
    (arguments `(#:tests? #f
                 #:haskell ,ghc-8.8))
    (native-inputs '())
    (properties '((hidden? #t)))))

ghc-integer-logarithms-bootstrap

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-07-07 14:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-05 14:09 bug#49418: Importing haskell packages from hackage doesn't apply metadata revisions Philip Munksgaard
2021-07-05 15:32 ` John Kehayias via Bug reports for GNU Guix
2021-07-07  3:26   ` John Kehayias via Bug reports for GNU Guix
2021-07-07  5:58     ` Philip Munksgaard
2021-07-07  9:52       ` Philip Munksgaard
2021-07-07 14:37         ` John Kehayias via Bug reports for GNU Guix

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.