From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id EBlrNDHDzF47eAAA0tVLHw (envelope-from ) for ; Tue, 26 May 2020 07:20:17 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id uFQ2MDHDzF6RLwAA1q6Kng (envelope-from ) for ; Tue, 26 May 2020 07:20:17 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D1A04940C04 for ; Tue, 26 May 2020 07:20:16 +0000 (UTC) Received: from localhost ([::1]:37286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdTsk-0001WZ-HA for larch@yhetil.org; Tue, 26 May 2020 03:20:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdTsY-0001VN-F0 for bug-guix@gnu.org; Tue, 26 May 2020 03:20:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60551) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdTsY-00045x-4X for bug-guix@gnu.org; Tue, 26 May 2020 03:20:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jdTsY-0005kB-0R for bug-guix@gnu.org; Tue, 26 May 2020 03:20:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#41508: GHC retains references to Perl, GCC, and others Resent-From: Ricardo Wurmus Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 26 May 2020 07:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41508 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 41508@debbugs.gnu.org Received: via spool by 41508-submit@debbugs.gnu.org id=B41508.159047754522007 (code B ref 41508); Tue, 26 May 2020 07:20:01 +0000 Received: (at 41508) by debbugs.gnu.org; 26 May 2020 07:19:05 +0000 Received: from localhost ([127.0.0.1]:43864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdTrd-0005it-D9 for submit@debbugs.gnu.org; Tue, 26 May 2020 03:19:05 -0400 Received: from sender4-of-o52.zoho.com ([136.143.188.52]:21233) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdTra-0005iT-Lh for 41508@debbugs.gnu.org; Tue, 26 May 2020 03:19:04 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1590476849; cv=none; d=zohomail.com; s=zohoarc; b=VI+0eYR0AJ3N0j9ZhHLDZeFSd9CZUhjSWeLtBqTMFq1ZXHY24LP2gvNnxCFcAIUBwstrp/VotTja2fOoMIsPsG0QvG4f/F2O8qNpDoDHNnqxePMaw8Otv+hDLhesX2b5+rfyAxMLsc28bqFUSln+SaNlsJIvXVV3qmUnduP/lQ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590476849; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=wv3b+FQv7H2An/l9ZnkhHJl0amNtqBxDXtPu0h4SfDA=; b=Kli29oFurWCYVRcvocsVuweHDz75SpYkIT56it7+sLBnXX8IM8kMQRIx/EjomuyQ3mDpVZAdn8c3tKRfiJpHLkivc3HWwU3guG2szUremY0hTA+djr3qZcnhfJrjVqwiExUJkb9C35D5nLP6K54VTRckbOLSfOtK42SgcjpC18Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1590476849; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:To:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=wv3b+FQv7H2An/l9ZnkhHJl0amNtqBxDXtPu0h4SfDA=; b=WVW/f6OYUMZmsfxYGDg5LV/fcXGVzQ/tByghdOtClpYEl/r3fZu9a12ee9OPv8j2 lrTMjiOmS1mkcWRLgLOx61zOpvH9on8KFcRIOxOlCcpztaIp0QM6KS7okGVAzu2amoa BA/l9KdYKo66nDi1KXmZXRWMaAFqkbaeflNhmjXo= Received: from localhost (p54ad4c83.dip0.t-ipconnect.de [84.173.76.131]) by mx.zohomail.com with SMTPS id 1590476848061664.6994362168173; Tue, 26 May 2020 00:07:28 -0700 (PDT) References: <874ks5csql.fsf@elephly.net> User-agent: mu4e 1.4.4; emacs 26.3 From: Ricardo Wurmus In-reply-to: <874ks5csql.fsf@elephly.net> X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Date: Tue, 26 May 2020 09:07:24 +0200 Message-ID: <875zcjjhsj.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=elephly.net header.s=zoho header.b=WVW/f6OY; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: 1.99 X-TUID: SnJIBwBJ70H/ Ricardo Wurmus writes: > GHC installs a lib/settings file with references to build-time tools, > such as Perl, GCC, and others. > > I tried building with a phase that removed those references: > > (match (find-files (string-append (assoc-ref outputs "out") "/lib") > "settings") > ((settings) > (remove-store-references settings)) > (_ #f)) > > Unfortunately, this breaks all Haskell packages as GHC always first > tries to set up its build environment. Any Haskell package=E2=80=99s con= figure > phase fails as GHC fails to find GCC. > > It seems to me that the only way around this is to patch GHC to allow > looking up of GCC and Perl through environment variables, but perhaps > this is unrealistic. When I looked at that settings file again, I noticed that the LLVM tools are named without an absolute file name. So I patched it to refer to its tools by the basename (=E2=80=9Cgcc=E2=80=9D instead of =E2=80=9C/gnu/s= tore/=E2=80=A6/bin/gcc=E2=80=9D, etc) and that did the trick. --8<---------------cut here---------------start------------->8--- (substitute* (find-files (string-append (assoc-ref outputs "out") "/lib/= ") "settings") (("/gnu/store/.*/bin/(.*)" m program) program)) --8<---------------cut here---------------end--------------->8--- This means, however, that people who install GHC to compile things will need to also install gcc-toolchain (and perhaps perl), as GHC will try to invoke them. Not propagating these tools means that users of Haskell packages providing an executable (such as Pandoc) will benefit from a smaller package closure. Perhaps it would be better not to mess with the =E2=80=9Csettings=E2=80=9D = file and instead work on cutting references from Haskell packages to GHC itself. The main reason why Haskell packages retain references to GHC is due to the set of Haskell packages that GHC provides. If we could separate GHC from the set of core packages it provides then Haskell packages could reference the packages they depend on without also dragging in GHC itself. --=20 Ricardo