Problems with Stack on Gentoo Linux

Hi all I’m sorry if this is not the right list to ask, I was unsure. I’m having problems compiling a project with stack on a Gentoo machine. I only have shell access to the machine, so I don’t have too much info about it, but the admin assured me that everything is up to date. I’ve upgraded to the latest stack, but the problem was also present with 0.1.4. While doing stack build on my project with resolver lts 3.10 I get the following strange error: ---------------------------------------------------------------------------------------------- -- While building package transformers-base-0.4.4 using: /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" Process exited with code: ExitFailure 1 Logs have been written to: /home/gigabytes/gigabytes.it/.stack-work/logs/transformers-base-0.4.4.log Configuring transformers-base-0.4.4... Building transformers-base-0.4.4... Preprocessing library transformers-base-0.4.4... [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 ) src/Control/Monad/Base.hs:22:1: Warning: The import of `Data.Monoid' is redundant except perhaps to import instances from `Data.Monoid' To import instances alone, use: import Data.Monoid() src/Control/Monad/Base.hs:24:1: Warning: The import of `Control.Applicative' is redundant except perhaps to import instances from `Control.Applicative' To import instances alone, use: import Control.Applicative() .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/src/Control/Monad/Base.dump-hi: commitBuffer: invalid argument (invalid character) ---------------------------------------------------------------------------------------------- Note that the warnings are not stopping the compile process themselves, but they somehow trigger the last error which kills the compiler. Stack is using the system-installed GHC here, which is version 7.10.2 (of course, otherwise stack wouldn’t have selected it). Maybe the system-wide compiler wasn’t installed properly (I doubt it, since the admin told me he uses a Gentoo package manager which is written in haskell and everything works well). So I’ve tried installing a stack-local GHC version, but I get a sanity check error: ---------------------------------------------------------------------------------------------- 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: https://github.com/commercialhaskell/stack/blob/release/doc/install_and_upgr... for more information. Exception was: 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 [1 of 1] Compiling Main ( /tmp/stack-sanity-check22752/Main.hs, /tmp/stack-sanity-check22752/Main.o ) Linking /tmp/stack-sanity-check22752/Main ... /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 /tmp/stack-sanity-check22752/Main.o: error adding symbols: Bad value collect2: error: ld returned 1 exit status ---------------------------------------------------------------------------------------------- So to recap: - The system-wide ghc crashes compiling transformers-base-0.4.4 - The stack-local ghc does not pass a sanity check On an OS X machine, the project compiles and work very well with the same stack and ghc versions and the same LTS, so I suppose this has to do with Gentoo. Any ideas? Thank you, Nicola

Please see this issue on the Stack issue tracker:
https://github.com/commercialhaskell/stack/issues/793
The summary is:
* `export LANG=en_US.UTF-8` or equivalent
* The next GHC release is already patched so that this won't be necessary
On Tue, Oct 20, 2015 at 1:19 PM, Nicola Gigante
Hi all
I’m sorry if this is not the right list to ask, I was unsure.
I’m having problems compiling a project with stack on a Gentoo machine. I only have shell access to the machine, so I don’t have too much info about it, but the admin assured me that everything is up to date.
I’ve upgraded to the latest stack, but the problem was also present with 0.1.4. While doing stack build on my project with resolver lts 3.10 I get the following strange error:
---------------------------------------------------------------------------------------------- -- While building package transformers-base-0.4.4 using:
/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" Process exited with code: ExitFailure 1 Logs have been written to: /home/gigabytes/ gigabytes.it/.stack-work/logs/transformers-base-0.4.4.log
Configuring transformers-base-0.4.4... Building transformers-base-0.4.4... Preprocessing library transformers-base-0.4.4... [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 )
src/Control/Monad/Base.hs:22:1: Warning: The import of `Data.Monoid' is redundant except perhaps to import instances from `Data.Monoid' To import instances alone, use: import Data.Monoid()
src/Control/Monad/Base.hs:24:1: Warning: The import of `Control.Applicative' is redundant except perhaps to import instances from `Control.Applicative' To import instances alone, use: import Control.Applicative()
.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/src/Control/Monad/Base.dump-hi: commitBuffer: invalid argument (invalid character)
----------------------------------------------------------------------------------------------
Note that the warnings are not stopping the compile process themselves, but they somehow trigger the last error which kills the compiler.
Stack is using the system-installed GHC here, which is version 7.10.2 (of course, otherwise stack wouldn’t have selected it). Maybe the system-wide compiler wasn’t installed properly (I doubt it, since the admin told me he uses a Gentoo package manager which is written in haskell and everything works well). So I’ve tried installing a stack-local GHC version, but I get a sanity check error:
---------------------------------------------------------------------------------------------- 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:
https://github.com/commercialhaskell/stack/blob/release/doc/install_and_upgr...
for more information. Exception was: 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 [1 of 1] Compiling Main ( /tmp/stack-sanity-check22752/Main.hs, /tmp/stack-sanity-check22752/Main.o ) Linking /tmp/stack-sanity-check22752/Main ...
/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 /tmp/stack-sanity-check22752/Main.o: error adding symbols: Bad value collect2: error: ld returned 1 exit status
----------------------------------------------------------------------------------------------
So to recap: - The system-wide ghc crashes compiling transformers-base-0.4.4 - The stack-local ghc does not pass a sanity check
On an OS X machine, the project compiles and work very well with the same stack and ghc versions and the same LTS, so I suppose this has to do with Gentoo.
Any ideas?
Thank you, Nicola
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe

On 10/20/2015 06:30 AM, Michael Snoyman wrote:
Please see this issue on the Stack issue tracker:
https://github.com/commercialhaskell/stack/issues/793
The summary is:
* `export LANG=en_US.UTF-8` or equivalent * The next GHC release is already patched so that this won't be necessary
The LANG variable is set by your locale choice on Gentoo. If the admin is willing to mess with it, # eselect locale list should output something like, Available targets for the LANG variable: [1] C [2] en_US [3] en_US.iso88591 [4] en_US.utf8 * [5] POSIX [ ] (free form) and then # eselect locale set 4 Setting LANG to en_US.utf8 ... Run ". /etc/profile" to update the variable in your shell. will set it globally.

Il giorno 20 ott 2015, alle ore 12:30, Michael Snoyman
ha scritto: Please see this issue on the Stack issue tracker:
https://github.com/commercialhaskell/stack/issues/793 https://github.com/commercialhaskell/stack/issues/793
The summary is:
* `export LANG=en_US.UTF-8` or equivalent * The next GHC release is already patched so that this won't be necessary
Thank you all, you saved my day! Greetings, Nicola
participants (3)
-
Michael Orlitzky
-
Michael Snoyman
-
Nicola Gigante