all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: mikadoZero <mikadozero@yandex.com>
To: Tobias Geerinckx-Rice <me@tobias.gr>
Cc: 34850@debbugs.gnu.org
Subject: bug#34850: ghc compiling error
Date: Wed, 13 Mar 2019 21:27:54 -0400	[thread overview]
Message-ID: <tvg6s0rp.fsf@yandex.com> (raw)
In-Reply-To: <87tvg64chq.fsf@nckx>


Tobias Geerinckx-Rice writes:

> mikadoZero,
>
> mikadoZero wrote:
>> `guix describe`
>> guix fd4c7a0
>>     repository URL: https://git.savannah.gnu.org/git/guix.git
>>     branch: master
>>     commit: fd4c7a098a508c1de7a8513c0f3d88d5a0df12e7
>>
>> I have ghc in my system configuration file.  I have just done a pull
>> and
>> reconfigure.
>>
>> `which ghc`
>> /run/current-system/profile/bin/ghc
>>
>> I created a one line hello world program:
>>
>> ```haskell
>> main = putStrLn "hello, world"
>> ```
>>
>> Then I tried to compile it with ghc.  I get this error.
>>
>> `ghc Main`                      [1 of 1] Compiling Main
>> ( Main.hs, Main.o )
>> gcc: error trying to exec 'as': execvp: No such file or directory
>> `gcc' failed in phase `Assembler'. (Exit code: 1)
>>
>> I have tested compiling the same hello world program with the same
>> ghc
>> command and it works fine on a none Guix System.
>
> Does the other system have ‘as’ installed?  Install the
> ‘gcc-toolchain’ package that provides it and try again.
>
> Usually, this kind of error means that ghc needs to be patched to
> invoke ‘as’ from an absolute file name instead of searching
> $PATH. There may have been good reasons not to do this (such as
> closure size), or it might be an oversight.
>
> Kind regards,
>
> T G-R

Thank you for the suggestion to install `gcc-toolchain`.  It addresses
that error.  The next error I ran into was:

[1 of 1] Compiling Main             ( Main.hs, Main.o )
Linking Main ...

In file included from /gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/include
/errno.h:28:0: error:                                                              
    0,
                     from /gnu/store/8v1sn5ns7r5n02aip0b0ypyyzb2y1i1a-ghc-8.4.3/lib/
ghc-8.4.3/include/rts/OSThreads.h:28,                                              
                     from /gnu/store/8v1sn5ns7r5n02aip0b0ypyyzb2y1i1a-ghc-8.4.3/lib/
ghc-8.4.3/include/Rts.h:168,                                                       
                     from /tmp/ghc29485_0/ghc_4.c:1:

/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/include/bits/errno.h:26:26: e
rror:                                                                              
     fatal error: linux/errno.h: No such file or directory
   |
26 | # include <linux/errno.h>
   |                          ^
compilation terminated.
`gcc' failed in phase `C Compiler'. (Exit code: 1)


First I tried adding glibc to my system configuration and reconfiguration.
That did not work.

This is what got it to work.

* Create a user manifest that includes ghc, gcc-toolchain, glibc
* Run `guix package --manifest=manifest.scm`
* Add exports from package output to .zprofile
* `source .zprofile`

# Questions

I used package search to search for `as`.  I could not find it.  Thanks
to the tip from Tobias Geerinckx-Rice I know it is in `gcc-toolchain`.
But when I look at `gcc-toolchain` there is no mention of `as` the
program in the synopsis, description or dependencies.  Is there a better
way to search for a program that is part of a larger package like this?

ghc, gcc-toolchain and glibc needed to be in a user manifest.  When does
a package need to be in a user manifest for it to work?

gcc-toolchain and glibc in a user manifest where required as
dependencies for ghc.  Should this be noted in the ghc package
description?

  reply	other threads:[~2019-03-14  1:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-13 22:30 bug#34850: ghc compiling error mikadoZero
2019-03-13 22:48 ` Tobias Geerinckx-Rice
2019-03-14  1:27   ` mikadoZero [this message]
2023-09-22 16:09     ` Simon Tournier
2023-09-22 16:47       ` Simon Tournier

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

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

  git send-email \
    --in-reply-to=tvg6s0rp.fsf@yandex.com \
    --to=mikadozero@yandex.com \
    --cc=34850@debbugs.gnu.org \
    --cc=me@tobias.gr \
    /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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.