Subject: bug#32131: ghc fails to compile packages when installed into profile

From: [email-masked] (Ludovic Courtès)
Date: Thu, 12 Jul 2018 17:58:55 +0200

Hello,

Anonymous <[email-masked]> skribis:

> This bug can be reproduced by doing
>
>     guix package -i ghc
>     echo 'main=return()' > test.hs
>     ghc test.hs
>
> The expected output is that the program will be compiled, but instead
> we get the error message
>
>     gcc: error trying to exec 'as': execvp: No such file or directory
>     `gcc' failed in phase `C Compiler'. (Exit code: 1)
>
> The error is caused, of course, by as not being found in the
> path. Interestingly, though, the error occurs in gcc, which fails to
> find as. The general path for compiling things with gcc is to use
> gcc-toolchain, which brings as and others into the profile, but as ghc
> calls gcc directly (with no gcc-toolchain), ghc fails to actually
> compile anything.

Indeed.  Does running:

  guix package -i glibc binutils ld-wrapper

help?

Regardless I agree that it should just work.

Thanks for reporting the issue,
Ludo’.