help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Haskell library packages - linker error


From: Timothy Sample
Subject: Re: Using Haskell library packages - linker error
Date: Mon, 07 Sep 2020 13:36:50 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Jakub Kądziołka <kuba@kadziolka.net> writes:

> On Mon, Sep 07, 2020 at 09:50:51AM -0400, Timothy Sample wrote:
>
>> GHC needs a special flag to link shared libraries.  We recently starting
>> building shared libraries for our Haskell packages.  The static ones are
>> still being built, but they go to a separate output.  I think you can
>> fix your problem in one of two ways:
>> 
>>     1. Pass the “-dynamic” flag to GHC (and maybe “-fPIC”);
>>     2. Use “ghc-ieee754:static”.
>
> ghc-ieee754:static doesn't seem to exist, [...]

Right.  It does exist, but it’s hidden from the Guix UI.  This is a
result of the finicky way the output is added.

> [...] but passing -dynamic does indeed work. The workaround also
> translates to Agda, with
>
> $ agda --ghc-flag=-dynamic --compile hello-world.agda

Cool.  That’s good to know.

> I'd really rather this wasn't necessary, though. I can already imagine
> having to figure out how to pass this flag to agda through build systems
> and editor plugins.

Absolutely.  I’ve done some of that work on our more complicated Haskell
packages, and it can get a little tricky.  To be honest, I’m not sure
how to move forward.  I know that Arch takes a similar approach to
packaging Haskell libraries, but I don’t know how they manage the
experience.

> On a related note, shouldn't it be possible to use agda without
> specifying ghc (and transitively, gcc) in your profile?

AIUI, this is following GCC.  GCC by itself doesn’t know how to find the
assembler, but the “gcc-toolchain” package manages this automatically.
Similarly, GHC doesn’t know how to find GCC, and Agda doesn’t know how
to find GHC.  We might need to make “ghc-toolchain” and “agda-toolchain”
packages (this has sorta been discussed before [1, 2]).

At the end of the day, our Haskell ecosystem is in need of some more
attention.  It’s really not far away from being nice, but it needs some
gentle nudges here and there.


-- Tim

[1] https://lists.gnu.org/archive/html/guix-devel/2018-08/msg00175.html
[2] https://lists.gnu.org/archive/html/guix-devel/2020-04/msg00318.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]