Using ghc-vis with current tools
I'm having a hell of a time (in a bad way) figuring how to get ghc-vis setup in a stack project.
Yeah, same here, it would be nice to have some updated instructions for stack!
After stack unpack ghc-vis; cd ghc-vis; stack init --solver; stack build I get the error:
svgcairo-0.13.1.0: configure
Progress: 1/2
-- While building package svgcairo-0.13.1.0 using:
/home/carlo/.stack/programs/x86_64-linux/ghc-7.10.3/bin/ghc --make -odir /tmp/stack19045/svgcairo-0.13.1.0/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/setup -hidir /tmp/stack19045/svgcairo-0.13.1.0/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/setup -i -i. -package=Cabal-1.22.5.0 -clear-package-db -global-package-db -package-db=/home/carlo/.stack/snapshots/x86_64-linux/lts-6.4/7.10.3/pkgdb /tmp/stack19045/svgcairo-0.13.1.0/Setup.hs -o /tmp/stack19045/svgcairo-0.13.1.0/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/setup/setup
Process exited with code: ExitFailure 1
Logs have been written to: /home/carlo/code/haskell/forks/ghc-vis-0.8/.stack-work/logs/svgcairo-0.13.1.0.log
/tmp/stack19045/svgcairo-0.13.1.0/Setup.hs:5:8:
Could not find module ‘Gtk2HsSetup’
Use -v to see a list of the files searched for.
Why is this happening? I tried also to stack build gtk2hs-buildtools in the project folder, but I get the same result.
https://github.com/gtk2hs/svgcairo/issues/3
Once this is fixed, I'll write something up on using ghc-vis in a Stack context.
Thanks @FranklinChen, that would be great.
OK, I've finally managed to compile ghc-vis using Stack with LTS 8.6 on macOS for GHC 8.0.2. But when I try to use it, it seg faults for me. Can anyone try this out on macOS or Linux? Try out my fork's ghc-8 branch: https://github.com/FranklinChen/ghc-vis/tree/ghc-8
Most likely ghc-heap-view has to be adapted to new data structures in recent GHC versions. There's a header in GHC that can be used for reference, but I don't remember the details.
No, ghc-heap-view is working fine. I found that the problem with the seg fault is purely a macOS problem, and I don't know how to fix it. However, it works fine on Linux, I finally verified.
It's working on Windows, too. It's like:
stack exec -- pacman -S mingw-w64-x86_64-pkg-config mingw-w64-x86_64-gtk3 mingw-w64-x86_64-gtk2 wget unzip
stack exec -- echo 'export PATH=/c/graphviz/bin:$PATH' >> ~/.bashrc
stack install gtk2hs-buildtools glib cairo pango gtk
git clone https://github.com/def-/ghc-vis.git
stack install
Last clone could be rewritten directly as stack install ghc-vis if the Hackage version is updated to the latest. Including https://github.com/def-/ghc-vis/pull/18