all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Kehayias via Guix-patches via <guix-patches@gnu.org>
To: 49199@debbugs.gnu.org
Subject: [bug#49199] [PATCH core-updates] add package-db to runhaskell (haskell-build-system)
Date: Wed, 23 Jun 2021 22:09:05 +0000	[thread overview]
Message-ID: <GMVhpmT-cIIS8fxdoEunZXx-wTfXa1TvInI4206RxKZrrdyYkv4bhgg7qt502kNulYAbvZdRcnpA7ft-zq88cOzBga-leAkk_Bzc8msPZ54=@protonmail.com> (raw)

[-- 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


             reply	other threads:[~2021-06-23 22:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-23 22:09 John Kehayias via Guix-patches via [this message]
2021-07-02  7:38 ` [bug#49199] Philip Munksgaard
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-04  0:47   ` 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='GMVhpmT-cIIS8fxdoEunZXx-wTfXa1TvInI4206RxKZrrdyYkv4bhgg7qt502kNulYAbvZdRcnpA7ft-zq88cOzBga-leAkk_Bzc8msPZ54=@protonmail.com' \
    --to=guix-patches@gnu.org \
    --cc=49199@debbugs.gnu.org \
    --cc=john.kehayias@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.