unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: 41508@debbugs.gnu.org
Subject: bug#41508: GHC retains references to Perl, GCC, and others
Date: Tue, 26 May 2020 09:07:24 +0200	[thread overview]
Message-ID: <875zcjjhsj.fsf@elephly.net> (raw)
In-Reply-To: <874ks5csql.fsf@elephly.net>


Ricardo Wurmus <rekado@elephly.net> 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’s configure
> 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 (“gcc” instead of “/gnu/store/…/bin/gcc”, 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 “settings” 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.

-- 
Ricardo




      reply	other threads:[~2020-05-26  7:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-24 14:28 bug#41508: GHC retains references to Perl, GCC, and others Ricardo Wurmus
2020-05-26  7:07 ` Ricardo Wurmus [this message]

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=875zcjjhsj.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=41508@debbugs.gnu.org \
    /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 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).