Subject: bug#32131: closed (Re: bug#32131: ghc fails to compile packages when installed into profile)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 22 Sep 2023 16:46:02 +0000

Your bug report

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

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
32131: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32131
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#32131: ghc fails to compile packages when installed into profile
From: Simon Tournier <[email-masked]>
To: Anonymous <[email-masked]>
Cc: [email-masked]
Date: Fri, 22 Sep 2023 18:13:33 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

This old bug #32131,

    https://issues.guix.gnu.org/issue/32131

is not a bug.  It is because gcc-toolchain is missing.

On Wed, 11 Jul 2018 at 22:12, Anonymous <[email-masked]> wrote:
> 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

--8<---------------cut here---------------start------------->8---
$ echo 'main=return()' > test.hs

$ guix shell -C ghc gcc-toolchain -- ghc test.hs
[1 of 1] Compiling Main             ( test.hs, test.o )
Linking test ...

$ ./test
--8<---------------cut here---------------end--------------->8---

Closing.  Let me know if I am missing something.

Cheers,
simon

Subject: ghc fails to compile packages when installed into profile
From: Anonymous <[email-masked]>
To: [email-masked]
Date: Wed, 11 Jul 2018 22:12:54 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

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.