ghc-vis
ghc-vis copied to clipboard
Build fails on Windows, 32bit
Windows 8.1 64bit, Haskell Platform 2014.2.0.0 32bit.
Following the process from page installing-windows, the last step does not work:
cabal install ghc-vis --enable-shared --disable-library-profiling
Multiple errors Perhaps you haven't installed the "dyn" libraries for package base
(and other packages).
Trying without --enable-shared
:
cabal install ghc-vis --disable-library-profiling
completes without error. Perhaps the instructions should be updated.
Finally, after the message
Follow the instructions in the output of cabal install ghc-vis to setup the ghci script.
nothing is displayed.
Using the latest cabal-install
cabal-install version 1.20.0.3
using version 1.20.0.2 of the Cabal library
Perhaps, cabal hides the message.
I copied ghci
from .cabal-sandbox/i386-windows-ghc-7.8.3/ghc-vis-0.7.2.5
to ~/.ghci
and when running ghci
and the :vis
command, I am getting
Prelude> :vis
<interactive>:2:1: Not in scope: `GHC.Vis.vis'
because I have ghc-vis
installed in the cabal sandbox. How can this be used from the sandbox?
I installed ghc-vis
into my user space and it works. However, when getting inside another project which uses a Cabal sandbox, I am still getting
cabal repl
Prelude Main> :vis
<interactive>:4:1: Not in scope: `GHC.Vis.vis'
How to use ghc-vis
from inside a sandboxed project? This probably has something to do with using cabal repl
command instead of ghci
directly.
Thank you for the bug reports. I made an issue about cabal recently starting to hide these messages: https://github.com/haskell/cabal/issues/2154
I have updated the documentation as well.
To make ghc-vis work inside a cabal sandbox you have to install it there as well, by running cabal install ghc-vis --disable-library-profiling
inside the sandbox, which will unfortunately take a long time for each sandbox. Afterwards you can run it like this:
cabal repl
> :set -package ghc-vis
> :vis
I should make a note about this in the documentation.
Unfortunately, it does not work just issuing the last command only cabal install ghc-vis --disable-library-profiling
, you have to go through the whole procedure for each sandbox. Obviously, it's undesirable.
By default, when using cabal repl
, the GHCi is run only with dependencies of the current sandboxed package. Doing as you suggest above does not help - it complains that package ghc-vis cannot be satisfied (and -v
does not give any more information):
:set -package ghc-vis -v cannot satisfy -package ghc-vis (use -v for more information)
So, I found this answer
http://stackoverflow.com/a/24767649
Unfortunately, still this happens:
$ cabal repl --ghc-option='-package ghc-vis'
Preprocessing library MyLibrary...
GHCi, version 7.8.3: http://www.haskell.org/ghc/ :? for help
<command line>: cannot satisfy -package ghc-vis
(use -v for more information)
but at least I see that it tries both my sandboxed project (MyLibrary) and ghc-vis at the same time. Maybe there's some way to get it to work?
By default, when using cabal repl, the GHCi is run only with dependencies of the current sandboxed package. Doing as you suggest above does not help - it complains that package ghc-vis cannot be satisfied (and -v does not give any more information):
This is strange. It works for me on Linux. Are you sure ghc-vis was installed in that ghc-vis was installed in that sandbox? If so, then I'd guess the missing --enable-shared
is causing this problem, which is also strange, since it worked in older versions of GHC and still works on Linux.