<div dir="ltr">If I have a file<br><div class="gmail_quote"><div dir="ltr"><div><div><div><div><div><div><div><div><div><br></div><font face="monospace">> module Lib where<br></font></div><font face="monospace"></font></div><font face="monospace">> import Control.Lens<br></font></div><font face="monospace">> data Foo = Foo</font><font face="monospace"> { _x :: Int</font><font face="monospace"> , _y :: Int</font><font face="monospace"> }</font><br></div></div><font face="monospace"></font></div><font face="monospace">> makeLenses ''Foo<br><span style="font-family:sans-serif"><br></span></font></div>and I compile with `<span style="font-family:monospace">stack build</span>`, it works fine.<br></div><div><font face="monospace"><span style="font-family:sans-serif">But if I add `<span style="font-family:monospace">llvm-general</span>` to build-depends, and I run `<span style="font-family:monospace">stack build</span>`, I get<br><br><font face="monospace">> [1 of 1] Compiling Lib              ( Lib.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Lib.o )<br>> <command line>: can't load .so/.DLL for: /usr/lib/libcurses.so (-lncursesw: cannot open shared object file: No such file or directory)<br>> <br>> --  While building package bug-test-0.1.0.0 using:<br>>       /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"<br>>     Process exited with code: ExitFailure 1<br><span style="font-family:sans-serif"><br></span></font></span></font></div><div><font face="monospace"><span style="font-family:sans-serif"><font face="monospace"><span style="font-family:sans-serif">I've made a tiny test case here: <a href="https://git.io/v6MVv" target="_blank">https://git.io/v6MVv</a><br></span></font></span></font></div><div><font face="monospace"><span style="font-family:sans-serif"><font face="monospace"><span style="font-family:sans-serif">If I symlink `<span style="font-family:monospace">/usr/lub/libcurses.so</span>` to `<span style="font-family:monospace">/usr/lub/libncursesw.so</span>` (as suggested at <a href="https://git.io/v6MV8" target="_blank">https://git.io/v6MV8</a> and <a href="https://ghc.haskell.org/trac/ghc/ticket/9237" target="_blank">https://ghc.haskell.org/trac/ghc/ticket/9237</a>), I get</span><br><br>> [1 of 1] Compiling Lib              ( Lib.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Lib.o )<br>> <br>> --  While building package bug-test-0.1.0.0 using:<br>>       /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"<br>>     Process exited with code: ExitFailure (-11)<br><br></font></span></font></div><div><font face="monospace"><span style="font-family:sans-serif"><font face="monospace"><span style="font-family:sans-serif">(There's no "can't load..." line and the exit code is different)</span><br><span style="font-family:sans-serif"><br></span></font></span></font></div><div><font face="monospace"><span style="font-family:sans-serif"><font face="monospace"><span style="font-family:sans-serif">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?</span><br></font></span></font></div><font face="monospace"><span style="font-family:sans-serif"></span></font></div></div></div>