From patchwork Wed Jun 23 22:09:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kehayias X-Patchwork-Id: 30655 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1715327BC78; Wed, 23 Jun 2021 23:27:18 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 78E4A27BC81 for ; Wed, 23 Jun 2021 23:27:17 +0100 (BST) Received: from localhost ([::1]:44552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwBL2-0004FQ-Jr for patchwork@mira.cbaines.net; Wed, 23 Jun 2021 18:27:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwB4M-0002kr-H0 for guix-patches@gnu.org; Wed, 23 Jun 2021 18:10:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58690) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lwB4M-0004ga-4f for guix-patches@gnu.org; Wed, 23 Jun 2021 18:10:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lwB4L-0007JV-VM for guix-patches@gnu.org; Wed, 23 Jun 2021 18:10:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49199] [PATCH core-updates] add package-db to runhaskell (haskell-build-system) Resent-From: John Kehayias Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 23 Jun 2021 22:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49199 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49199@debbugs.gnu.org X-Debbugs-Original-To: "guix-patches@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.162448615828051 (code B ref -1); Wed, 23 Jun 2021 22:10:01 +0000 Received: (at submit) by debbugs.gnu.org; 23 Jun 2021 22:09:18 +0000 Received: from localhost ([127.0.0.1]:42003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwB3e-0007IN-HP for submit@debbugs.gnu.org; Wed, 23 Jun 2021 18:09:18 -0400 Received: from lists.gnu.org ([209.51.188.17]:59462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwB3c-0007IF-Dc for submit@debbugs.gnu.org; Wed, 23 Jun 2021 18:09:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwB3b-0002iO-VE for guix-patches@gnu.org; Wed, 23 Jun 2021 18:09:16 -0400 Received: from mail-0201.mail-europe.com ([51.77.79.158]:52910) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwB3Z-00048k-FW for guix-patches@gnu.org; Wed, 23 Jun 2021 18:09:15 -0400 Date: Wed, 23 Jun 2021 22:09:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1624486147; bh=YN4vnqp+2uYJmlPSI+k6y9Ku0EVdM8xPo46tVwlxMY4=; h=Date:To:From:Reply-To:Subject:From; b=rbfohS1JkkC1JaWM/vq1nLr37mbYSUddKmBiVU1R5F4HkWfu6kmLPvHzEOvnpaxl7 a8hPRdRojsmN7knSSiYvK8e2vwX+F+rSadVcnqB1V5DTDxBqAvuZDeb247tbC5Rwar bp9WtIhU07ooJNdoFzpTJu4ts2gNlJ5Trq23O4x8= Message-ID: MIME-Version: 1.0 Received-SPF: pass client-ip=51.77.79.158; envelope-from=john.kehayias@protonmail.com; helo=mail-0201.mail-europe.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Wed, 23 Jun 2021 18:26:58 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: John Kehayias X-ACL-Warn: , John Kehayias via Guix-patches X-Patchwork-Original-From: John Kehayias via Guix-patches via From: John Kehayias X-getmail-retrieved-from-mailbox: Patches 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 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