unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#49199] [PATCH core-updates] add package-db to runhaskell (haskell-build-system)
@ 2021-06-23 22:09 John Kehayias via Guix-patches via
  2021-07-02  7:38 ` [bug#49199] Philip Munksgaard
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: John Kehayias via Guix-patches via @ 2021-06-23 22:09 UTC (permalink / raw)
  To: 49199

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

Hello,

This is a patch to fix issue #48944 as well as more broadly an issue of Haskell packages that need modules at the configure step. Currently the package database is not passed to runhaskell directly, which means runhaskell Setup.hs configure does not have outside modules available. This blocks packages that need things like cabal-doctest or gtk2hs-buildtools like ghc-cairo (which has a custom build process in the package currently, for this reason). Comments in ghc-cairo and for other packages with this need, suggest the change made in this patch.

The simplest change I saw was to make the package database passed to runhaskell on any command; not sure if this would be better for just configure. It may be possible to do this just passing the actual needed packages with -package-id, as suggested in https://github.com/tweag/rules_haskell/issues/1314 However, I have not tried that and seemed more complicated than needed. Also, I did not modify the message printed as it already has the package-db in params, but perhaps better to be clear the exact command being run?

I have built many Haskell packages with this change and it works well for me, fixing the reported issue and packages I'm building not yet in guix. Given this changes the build command for all Haskell packages, would be happy for other tests to be run.

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#49199]
  2021-06-23 22:09 [bug#49199] [PATCH core-updates] add package-db to runhaskell (haskell-build-system) John Kehayias via Guix-patches via
@ 2021-07-02  7:38 ` Philip Munksgaard
       [not found] ` <mie5S2mDg8BAAfnbQmJu49AGbAw28_havEVb0jfEwxFGnTDOC6PY49gWk1T8QH52x4pm3R2yuyv86zUUyfYeJITaZQ7XglaSQBrtlvpXSG4=@protonmail.com>
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Philip Munksgaard @ 2021-07-02  7:38 UTC (permalink / raw)
  To: 49199

This works for me. How can we get it merged?




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

* [bug#49199] [PATCH core-updates] add package-db to runhaskell (haskell-build-system)
       [not found] ` <mie5S2mDg8BAAfnbQmJu49AGbAw28_havEVb0jfEwxFGnTDOC6PY49gWk1T8QH52x4pm3R2yuyv86zUUyfYeJITaZQ7XglaSQBrtlvpXSG4=@protonmail.com>
@ 2021-07-04  0:47   ` John Kehayias via Guix-patches via
  0 siblings, 0 replies; 5+ messages in thread
From: John Kehayias via Guix-patches via @ 2021-07-04  0:47 UTC (permalink / raw)
  To: 49199@debbugs.gnu.org

I don't know, I'm rather new here :-) We'll need one of the main devs I guess to do it? The patch I submitted was actually from the master branch, but haskell-build-system is identical in core-updates if I'm reading the git log correctly. But I'm happy to do more testing on the core-updates branch.




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

* [bug#49199] [PATCH core-updates] add package-db to runhaskell (haskell-build-system)
  2021-06-23 22:09 [bug#49199] [PATCH core-updates] add package-db to runhaskell (haskell-build-system) John Kehayias via Guix-patches via
  2021-07-02  7:38 ` [bug#49199] Philip Munksgaard
       [not found] ` <mie5S2mDg8BAAfnbQmJu49AGbAw28_havEVb0jfEwxFGnTDOC6PY49gWk1T8QH52x4pm3R2yuyv86zUUyfYeJITaZQ7XglaSQBrtlvpXSG4=@protonmail.com>
@ 2021-07-05 16:17 ` John Kehayias via Guix-patches via
  2021-07-20 22:22 ` bug#49199: " Ricardo Wurmus
  3 siblings, 0 replies; 5+ messages in thread
From: John Kehayias via Guix-patches via @ 2021-07-05 16:17 UTC (permalink / raw)
  To: 49199@debbugs.gnu.org

Looks like you (and me) have run into several of these problems that could be revised with some fixes to haskell-build-system and the hackage importer. On #guix it was discussed having a branch to try out these changes and leverage the CI to see what breaks on making changes to the build system, ghc version, etc.

We'll need someone to create and let us push there, not sure who to ask or how to get started on that...




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

* bug#49199: [PATCH core-updates] add package-db to runhaskell (haskell-build-system)
  2021-06-23 22:09 [bug#49199] [PATCH core-updates] add package-db to runhaskell (haskell-build-system) John Kehayias via Guix-patches via
                   ` (2 preceding siblings ...)
  2021-07-05 16:17 ` John Kehayias via Guix-patches via
@ 2021-07-20 22:22 ` Ricardo Wurmus
  3 siblings, 0 replies; 5+ messages in thread
From: Ricardo Wurmus @ 2021-07-20 22:22 UTC (permalink / raw)
  To: 49199-done; +Cc: John Kehayias

Hi,

I made a commit out of the diff and pushed it to wip-haskell, 
which is based on core-updates.

-- 
Ricardo




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

end of thread, other threads:[~2021-07-20 22:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23 22:09 [bug#49199] [PATCH core-updates] add package-db to runhaskell (haskell-build-system) John Kehayias via Guix-patches via
2021-07-02  7:38 ` [bug#49199] Philip Munksgaard
     [not found] ` <mie5S2mDg8BAAfnbQmJu49AGbAw28_havEVb0jfEwxFGnTDOC6PY49gWk1T8QH52x4pm3R2yuyv86zUUyfYeJITaZQ7XglaSQBrtlvpXSG4=@protonmail.com>
2021-07-04  0:47   ` [bug#49199] [PATCH core-updates] add package-db to runhaskell (haskell-build-system) John Kehayias via Guix-patches via
2021-07-05 16:17 ` John Kehayias via Guix-patches via
2021-07-20 22:22 ` bug#49199: " Ricardo Wurmus

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