unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#48944: haskell build-system cannot build pcg-random
@ 2021-06-10  8:45 Philip Munksgaard
  2021-06-10 16:26 ` zimoun
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Philip Munksgaard @ 2021-06-10  8:45 UTC (permalink / raw)
  To: 48944

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

I've used `guix import hackage pcg-random` to create the attached pcg-random.scm. When trying to build it using `guix build -f pcg-random.scm`, I get the following error:

starting phase `configure'
running "runhaskell Setup.hs" with command "configure" and parameters ("--prefix=/gnu/store/s5fjjd04x0n5f5dr9rgaf963nfqwf3dz-ghc-pcg-random-0.1.3.7" "--libdir=/gnu/store/s5fjjd04x0n5f5dr9rgaf963nfqwf3dz-ghc-pcg-random-0.1.3.7/lib" "--docdir=/gnu/store/s5fjjd04x0n5f5dr9rgaf963nfqwf3dz-ghc-pcg-random-0.1.3.7/share/doc/ghc-pcg-random-0.1.3.7" "--libsubdir=$compiler/$pkg-$version" "--package-db=/tmp/guix-build-ghc-pcg-random-0.1.3.7.drv-0/package.conf.d" "--global" "--enable-tests" "--enable-shared" "--enable-executable-dynamic" "--ghc-option=-fPIC" "--ghc-option=-optl=-Wl,-rpath=/gnu/store/s5fjjd04x0n5f5dr9rgaf963nfqwf3dz-ghc-pcg-random-0.1.3.7/lib/$compiler/$pkg-$version")

Setup.hs:3:1: error:
    Could not find module ‘Distribution.Extra.Doctest’
    Perhaps you meant Distribution.Simple.Doctest (from Cabal-2.4.0.1)
    Use -v to see a list of the files searched for.
  |
3 | import Distribution.Extra.Doctest (defaultMainWithDoctests)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
command "runhaskell" "Setup.hs" "configure" "--prefix=/gnu/store/s5fjjd04x0n5f5dr9rgaf963nfqwf3dz-ghc-pcg-random-0.1.3.7" "--libdir=/gnu/store/s5fjjd04x0n5f5dr9rgaf963nfqwf3dz-ghc-pcg-random-0.1.3.7/lib" "--docdir=/gnu/store/s5fjjd04x0n5f5dr9rgaf963nfqwf3dz-ghc-pcg-random-0.1.3.7/share/doc/ghc-pcg-random-0.1.3.7" "--libsubdir=$compiler/$pkg-$version" "--package-db=/tmp/guix-build-ghc-pcg-random-0.1.3.7.drv-0/package.conf.d" "--global" "--enable-tests" "--enable-shared" "--enable-executable-dynamic" "--ghc-option=-fPIC" "--ghc-option=-optl=-Wl,-rpath=/gnu/store/s5fjjd04x0n5f5dr9rgaf963nfqwf3dz-ghc-pcg-random-0.1.3.7/lib/$compiler/$pkg-$version" failed with status 1
builder for `/gnu/store/7jkcigan6ygy42c3ivy9spfqh5pfx4qx-ghc-pcg-random-0.1.3.7.drv' failed with exit code 1
build of /gnu/store/7jkcigan6ygy42c3ivy9spfqh5pfx4qx-ghc-pcg-random-0.1.3.7.drv failed
View build log at '/var/log/guix/drvs/7j/kcigan6ygy42c3ivy9spfqh5pfx4qx-ghc-pcg-random-0.1.3.7.drv.bz2'.
guix build: error: build of `/gnu/store/7jkcigan6ygy42c3ivy9spfqh5pfx4qx-ghc-pcg-random-0.1.3.7.drv' failed

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

(use-modules (guix packages))
(use-modules (guix download))
(use-modules (guix build-system haskell))
(use-modules (guix licenses))
(use-modules (gnu packages))
(use-modules (gnu packages haskell))
(use-modules (gnu packages haskell-xyz))
(use-modules (gnu packages haskell-crypto))

(define-public ghc-cabal-doctest
  (package
    (name "ghc-cabal-doctest")
    (version "1.0.8")
    (source
      (origin
        (method url-fetch)
        (uri (string-append
               "https://hackage.haskell.org/package/cabal-doctest/cabal-doctest-"
               version
               ".tar.gz"))
        (sha256
          (base32
            "03if74imlhhk7m56nci5f1wclniwqdmwl4hl177040j1gnlac9i0"))))
    (build-system haskell-build-system)
    (arguments
      `(#:cabal-revision
        ("2"
         "05v1awad3d1wvc763xcgvxm4n6n7bs7byc6s14kdbw35zcaddlcb")))
    (home-page
      "https://github.com/phadej/cabal-doctest")
    (synopsis
      "A Setup.hs helper for doctests running")
    (description
      "Currently (beginning of 2017), there isn't @cabal doctest@ command. Yet, to properly work doctest needs plenty of configuration. This library provides the common bits for writing custom Setup.hs See <https://github.com/haskell/cabal/issues/2327 Cabal/2327> for the progress of @cabal doctest@, i.e. whether this library is obsolete.")
    (license bsd-3)))

(define-public ghc-pcg-random
  (package
    (name "ghc-pcg-random")
    (version "0.1.3.7")
    (source
      (origin
        (method url-fetch)
        (uri (string-append
               "https://hackage.haskell.org/package/pcg-random/pcg-random-"
               version
               ".tar.gz"))
        (sha256
          (base32
            "1l6jq5nvmg1ygk7i7g50s47p6qkh74p9avl1wbcxdl5m85lc5j76"))))
    (build-system haskell-build-system)
    (inputs
      `(("ghc-primitive" ,ghc-primitive)
        ("ghc-random" ,ghc-random)
        ("ghc-entropy" ,ghc-entropy)
        ("ghc-doctest" ,ghc-doctest)
        ("ghc-cabal-doctest" ,ghc-cabal-doctest)))
    (native-inputs
      `(("ghc-doctest" ,ghc-doctest)
        ("ghc-cabal-doctest" ,ghc-cabal-doctest)))
    (home-page
      "http://github.com/cchalmers/pcg-random")
    (synopsis
      "Haskell bindings to the PCG random number generator.")
    (description
      "PCG is a family of simple fast space-efficient statistically good algorithms for random number generation. Unlike many general-purpose RNGs, they are also hard to predict. . This library implements bindings to the standard C implementation. This includes the standard, unique, fast and single variants in the pcg family. There is a pure implementation that can be used as a generator with the random package as well as a faster primitive api that includes functions for generating common types. . The generators in this module are suitable for use in parallel but make sure threads don't share the same generator or things will go horribly wrong.")
    (license bsd-3)))

ghc-pcg-random

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

* bug#48944: haskell build-system cannot build pcg-random
  2021-06-10  8:45 bug#48944: haskell build-system cannot build pcg-random Philip Munksgaard
@ 2021-06-10 16:26 ` zimoun
  2021-07-01 16:28   ` Philip Munksgaard
  2021-06-23 21:54 ` John Kehayias via Bug reports for GNU Guix
  2022-04-06 13:40 ` bug#48944: Philip Munksgaard
  2 siblings, 1 reply; 5+ messages in thread
From: zimoun @ 2021-06-10 16:26 UTC (permalink / raw)
  To: Philip Munksgaard; +Cc: 48944

Hi,

On Thu, 10 Jun 2021 at 10:47, Philip Munksgaard <philip@munksgaard.me> wrote:

> Setup.hs:3:1: error:
>     Could not find module ‘Distribution.Extra.Doctest’
>     Perhaps you meant Distribution.Simple.Doctest (from Cabal-2.4.0.1)
>     Use -v to see a list of the files searched for.
>   |
> 3 | import Distribution.Extra.Doctest (defaultMainWithDoctests)
>   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I have not investigated more but I guess the issue is from the new
package ghc-cabal-doctest which is probably poorly configured.

All the best,
simon




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

* bug#48944: haskell build-system cannot build pcg-random
  2021-06-10  8:45 bug#48944: haskell build-system cannot build pcg-random Philip Munksgaard
  2021-06-10 16:26 ` zimoun
@ 2021-06-23 21:54 ` John Kehayias via Bug reports for GNU Guix
  2022-04-06 13:40 ` bug#48944: Philip Munksgaard
  2 siblings, 0 replies; 5+ messages in thread
From: John Kehayias via Bug reports for GNU Guix @ 2021-06-23 21:54 UTC (permalink / raw)
  To: 48944@debbugs.gnu.org

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

Hello,

I also see this error for building packages that need cabal-doctest, as the configure step needs the package database. There's actually some packages in guix that already modify the configure step to do this, like ghc-cairo: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/haskell-xyz.scm#n1465

As noted there, the package database should be passed to runhaskell itself, not just what it runs. This would allow other packages that need a module for configuring to work. Attached is a patch to modify haskell-build-system to do this, though not only for the configure command (seemed easiest to just do that for now). I'm submitting the patch with comments there about possible modifications.

I can confirm with this that pcg-random builds, as well as packages I've been trying that need cabal-doctest (note, I tested using guix's package of cabal-doctest, no need to add that as well).

Comments welcome here, especially as I'm pretty new to Haskell still and guix completely, or on patch submission (sending shortly).

John

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: runhaskell-add-pkgdb.patch --]
[-- Type: text/x-patch; name=runhaskell-add-pkgdb.patch, Size: 904 bytes --]

diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build-system.scm
index 28253ce2f0..be20f13e10 100644
--- a/guix/build/haskell-build-system.scm
+++ b/guix/build/haskell-build-system.scm
@@ -63,13 +63,14 @@
                      ((file-exists? "Setup.lhs")
                       "Setup.lhs")
                      (else
-                      #f))))
+                      #f)))
+        (pkgdb (string-append "-package-db=" %tmp-db-dir)))
     (if setup-file
         (begin
           (format #t "running \"runhaskell Setup.hs\" with command ~s \
 and parameters ~s~%"
                   command params)
-          (apply invoke "runhaskell" setup-file command params))
+          (apply invoke "runhaskell" pkgdb setup-file command params))
         (error "no Setup.hs nor Setup.lhs found"))))
 
 (define* (configure #:key outputs inputs tests? (configure-flags '())
-- 
2.32.0


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

* bug#48944: haskell build-system cannot build pcg-random
  2021-06-10 16:26 ` zimoun
@ 2021-07-01 16:28   ` Philip Munksgaard
  0 siblings, 0 replies; 5+ messages in thread
From: Philip Munksgaard @ 2021-07-01 16:28 UTC (permalink / raw)
  Cc: 48944

Hi John Kehayias,

The patch seems to work! What will it take for us to get it merged?

Best,
Philip




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

* bug#48944:
  2021-06-10  8:45 bug#48944: haskell build-system cannot build pcg-random Philip Munksgaard
  2021-06-10 16:26 ` zimoun
  2021-06-23 21:54 ` John Kehayias via Bug reports for GNU Guix
@ 2022-04-06 13:40 ` Philip Munksgaard
  2 siblings, 0 replies; 5+ messages in thread
From: Philip Munksgaard @ 2022-04-06 13:40 UTC (permalink / raw)
  To: 48944-done

Fixed by https://issues.guix.gnu.org/49199




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

end of thread, other threads:[~2022-04-06 13:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10  8:45 bug#48944: haskell build-system cannot build pcg-random Philip Munksgaard
2021-06-10 16:26 ` zimoun
2021-07-01 16:28   ` Philip Munksgaard
2021-06-23 21:54 ` John Kehayias via Bug reports for GNU Guix
2022-04-06 13:40 ` bug#48944: Philip Munksgaard

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).