<div dir="ltr"><div><div><div>Please see this issue on the Stack issue tracker:<br><br><a href="https://github.com/commercialhaskell/stack/issues/793">https://github.com/commercialhaskell/stack/issues/793</a><br><br></div>The summary is:<br><br></div>* `export LANG=en_US.UTF-8` or equivalent<br></div>* The next GHC release is already patched so that this won't be necessary<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 20, 2015 at 1:19 PM, Nicola Gigante <span dir="ltr"><<a href="mailto:nicola.gigante@gmail.com" target="_blank">nicola.gigante@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all<br>
<br>
I’m sorry if this is not the right list to ask, I was unsure.<br>
<br>
I’m having problems compiling a project with stack on a Gentoo machine.<br>
I only have shell access to the machine, so I don’t have too much info about it,<br>
but the admin assured me that everything is up to date.<br>
<br>
I’ve upgraded to the latest stack, but the problem was also present with 0.1.4.<br>
While doing stack build on my project with resolver lts 3.10 I get the following<br>
strange error:<br>
<br>
----------------------------------------------------------------------------------------------<br>
--  While building package transformers-base-0.4.4 using:<br>
      /home/gigabytes/.stack/setup-exe-cache/setup-Simple-Cabal-1.22.4.0-x86_64-linux-ghc-7.10.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/ build --ghc-options " -ddump-hi -ddump-to-file"<br>
    Process exited with code: ExitFailure 1<br>
    Logs have been written to: /home/gigabytes/<a href="http://gigabytes.it/.stack-work/logs/transformers-base-0.4.4.log" rel="noreferrer" target="_blank">gigabytes.it/.stack-work/logs/transformers-base-0.4.4.log</a><br>
<br>
    Configuring transformers-base-0.4.4...<br>
    Building transformers-base-0.4.4...<br>
    Preprocessing library transformers-base-0.4.4...<br>
    [1 of 1] Compiling Control.Monad.Base ( src/Control/Monad/Base.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/Control/Monad/Base.o )<br>
<br>
    src/Control/Monad/Base.hs:22:1: Warning:<br>
        The import of `Data.Monoid' is redundant<br>
          except perhaps to import instances from `Data.Monoid'<br>
        To import instances alone, use: import Data.Monoid()<br>
<br>
    src/Control/Monad/Base.hs:24:1: Warning:<br>
        The import of `Control.Applicative' is redundant<br>
          except perhaps to import instances from `Control.Applicative'<br>
        To import instances alone, use: import Control.Applicative()<br>
    .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/src/Control/Monad/Base.dump-hi: commitBuffer: invalid argument (invalid character)<br>
----------------------------------------------------------------------------------------------<br>
<br>
<br>
Note that the warnings are not stopping the compile process themselves, but they somehow trigger the last error which kills the compiler.<br>
<br>
Stack is using the system-installed GHC here, which is version 7.10.2 (of course, otherwise stack wouldn’t have selected it).<br>
Maybe the system-wide compiler wasn’t installed properly (I doubt it, since the admin told me<br>
he uses a Gentoo package manager which is written in haskell and everything works well).<br>
So I’ve tried installing a stack-local GHC version, but I get a sanity check error:<br>
<br>
----------------------------------------------------------------------------------------------<br>
The GHC located at /home/gigabytes/.stack/programs/x86_64-linux/ghc-7.10.2/bin/ghc failed to compile a sanity check. Please see:<br>
<br>
    <a href="https://github.com/commercialhaskell/stack/blob/release/doc/install_and_upgrade.md" rel="noreferrer" target="_blank">https://github.com/commercialhaskell/stack/blob/release/doc/install_and_upgrade.md</a><br>
<br>
for more information. Exception was:<br>
Running /home/gigabytes/.stack/programs/x86_64-linux/ghc-7.10.2/bin/ghc /tmp/stack-sanity-check22752/Main.hs -no-user-package-db exited with ExitFailure 1<br>
[1 of 1] Compiling Main             ( /tmp/stack-sanity-check22752/Main.hs, /tmp/stack-sanity-check22752/Main.o )<br>
Linking /tmp/stack-sanity-check22752/Main ...<br>
<br>
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/stack-sanity-check22752/Main.o: relocation R_X86_64_32S against `stg_bh_upd_frame_info' can not be used when making a shared object; recompile with -fPIC<br>
/tmp/stack-sanity-check22752/Main.o: error adding symbols: Bad value<br>
collect2: error: ld returned 1 exit status<br>
----------------------------------------------------------------------------------------------<br>
<br>
<br>
So to recap:<br>
- The system-wide ghc crashes compiling transformers-base-0.4.4<br>
- The stack-local ghc does not pass a sanity check<br>
<br>
<br>
On an OS X machine, the project compiles and work very well with the same<br>
stack and ghc versions and the same LTS, so I suppose this has to do with<br>
Gentoo.<br>
<br>
Any ideas?<br>
<br>
Thank you,<br>
Nicola<br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div><br></div>