[Haskell-cafe] Build error with llvm-general and lens

9 views
Skip to first unread message

HMPerson1

unread,
Aug 20, 2016, 3:23:03 PM8/20/16
to haskel...@haskell.org
If I have a file

> module Lib where
> import Control.Lens
> data Foo = Foo { _x :: Int , _y :: Int }
> makeLenses ''Foo

and I compile with `stack build`, it works fine.
But if I add `llvm-general` to build-depends, and I run `stack build`, I get

> [1 of 1] Compiling Lib              ( Lib.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Lib.o )
> <command line>: can't load .so/.DLL for: /usr/lib/libcurses.so (-lncursesw: cannot open shared object file: No such file or directory)
>
> --  While building package bug-test-0.1.0.0 using:
>       /home/user/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.5.0 build lib:bug-test --ghc-options " -ddump-hi -ddump-to-file"
>     Process exited with code: ExitFailure 1

I've made a tiny test case here: https://git.io/v6MVv
If I symlink `/usr/lub/libcurses.so` to `/usr/lub/libncursesw.so` (as suggested at https://git.io/v6MV8 and https://ghc.haskell.org/trac/ghc/ticket/9237), I get

> [1 of 1] Compiling Lib              ( Lib.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Lib.o )
>
> --  While building package bug-test-0.1.0.0 using:
>       /home/user/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.5.0 build lib:bug-test --ghc-options " -ddump-hi -ddump-to-file"
>     Process exited with code: ExitFailure (-11)

(There's no "can't load..." line and the exit code is different)

As a workaround, I can separate the lens instances into a separate library, but I would like to avoid doing so if possible. How can I fix this?

Brandon Allbery

unread,
Aug 20, 2016, 3:51:44 PM8/20/16
to HMPerson1, haskel...@haskell.org
On Sat, Aug 20, 2016 at 3:22 PM, HMPerson1 <hmpe...@gmail.com> wrote:
>     Process exited with code: ExitFailure (-11)

Uhhh... that looks like you managed to segfault ghc. What version of ghc is this? (And what version of stack? I think newer ones report this slightly better.)

--
brandon s allbery kf8nh                               sine nomine associates
allb...@gmail.com                                  ball...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

HMPerson1

unread,
Aug 20, 2016, 4:03:16 PM8/20/16
to Brandon Allbery, haskel...@haskell.org
On Sat, Aug 20, 2016 at 3:51 PM Brandon Allbery <allb...@gmail.com> wrote:
On Sat, Aug 20, 2016 at 3:22 PM, HMPerson1 <hmpe...@gmail.com> wrote:
>     Process exited with code: ExitFailure (-11)

Uhhh... that looks like you managed to segfault ghc. What version of ghc is this? (And what version of stack? I think newer ones report this slightly better.)

$ stack --version
Version 1.1.2 x86_64 hpack-0.14.1

$ stack ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 7.10.3
Reply all
Reply to author
Forward
0 new messages