Cabal-Install lost the informative qualities of its build output - haskell

I suspect this is either a problem with ghc or cabal-install:
I used to get build information in such a format:
Resolving dependencies...
Configuring ltk-0.8.0.6...
Building ltk-0.8.0.6...
Preprocessing library ltk-0.8.0.6...
[ 1 of 12] Compiling Graphics.UI.Frame.Panes ( src/Graphics/UI/Frame/Panes.hs, dist/build/Graphics/UI/Frame/Panes.o )
[ 2 of 12] Compiling Graphics.UI.Editor.Parameters ( src/Graphics/UI/Editor/Parameters.hs, dist/build/Graphics/UI/Editor/Parameters.o )
[ 3 of 12] Compiling Control.Event ( src/Control/Event.hs, dist/build/Control/Event.o )
[ 4 of 12] Compiling MyMissing ( src/MyMissing.hs, dist/build/MyMissing.o )
[ 5 of 12] Compiling Graphics.UI.Editor.Basics ( src/Graphics/UI/Editor/Basics.hs, dist/build/Graphics/UI/Editor/Basics.o )
[ 6 of 12] Compiling Graphics.UI.Editor.MakeEditor ( src/Graphics/UI/Editor/MakeEditor.hs, dist/build/Graphics/UI/Editor/MakeEditor.o )
[ 7 of 12] Compiling Text.PrinterParser ( src/Text/PrinterParser.hs, dist/build/Text/PrinterParser.o )
However, now I get this type of build output:
Configuring binary-shared-0.8.3...
Configuring cairo-0.12.5.1...
Building binary-shared-0.8.3...
Building cairo-0.12.5.1...
Installed binary-shared-0.8.3
Configuring ghc-paths-0.1.0.9...
Building ghc-paths-0.1.0.9...
Installed ghc-paths-0.1.0.9
Configuring glib-0.12.5.0...
As you can see, cabal-install or ghc, whichever is causing the problem, seems to be inducing undesirable laconism now. According to my cabal config, I am running at a default verbosity level of 1. Is there some configuration option that could have caused this particular behavior? In other words, how can I restore the original behavior? Version 1.18.0.2

Thanks to #Michael Snoyman for pointing out that configuring a jobs parameter or explicitly passing it as a -j flag will redirect much of the information that pertains to build output to a text file. More information is available here.

Related

Compiling Haskell to JavaScript using GHCJS and Haskell Stack

How can Haskell be compiled to Javascript using GHCJS and Haskell Stack?
I have the current version of Haksell Stack 1.5.1.
I can initialize a GHCJS project with this command: stack new ghcjsSetup ghcjs
Once in the project directory I try following the Stack documentation for GHCJS.
I create a stack.yaml file and edit it to match the example from the documentation so that is looks like this.
resolver: lts-7.19
compiler: ghcjs-0.2.1.9007019_ghc-8.0.1
compiler-check: match-exact
setup-info:
ghcjs:
source:
ghcjs-0.2.1.9007019_ghc-8.0.1:
url: http://ghcjs.tolysz.org/ghc-8.0-2017-02-05-lts-7.19-9007019.tar.gz
sha1: d2cfc25f9cda32a25a87d9af68891b2186ee52f9
Following the documentation further I try to install and boot GHCJS with this command:
stack setup
This command produces an output which ends with an error.
Preparing to install GHCJS to an isolated location.
This will not interfere with any system-level installation.
Preparing to download ghcjs-0.2.1.9007019_ghc-8.0.1 ...
Already downloaded.
Unpacking GHCJS into /home/u/.stack/programs/x86_64-linux/ghcjs-0.2.1.9007019_ghc-8.0.1/src/ ...
Setting up GHCJS build environment
Installing GHCJS (this will take a long time) ...
ghcjs-0.2.1.9007019: configure (lib + exe)
Package ghcjs uses a custom Cabal build, but does not use a custom-setup stanza
Using the explicit setup deps approach based on configuration
Strongly recommend fixing the package's cabal file
[1 of 2] Compiling Main ( /home/u/.stack/programs/x86_64-linux/ghcjs-0.2.1.9007019_ghc-8.0.1/src/Setup.hs, /home/u/.stack/programs/x86_64-linux/ghcjs-0.2.1.9007019_ghc-8.0.1/src/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/setup/Main.o )
[2 of 2] Compiling StackSetupShim ( /home/u/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /home/u/.stack/programs/x86_64-linux/ghcjs-0.2.1.9007019_ghc-8.0.1/src/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/setup/StackSetupShim.o )
Linking /home/u/.stack/programs/x86_64-linux/ghcjs-0.2.1.9007019_ghc-8.0.1/src/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/setup/setup ...
Configuring ghcjs-0.2.1.9007019...
ghcjs-0.2.1.9007019: build (lib + exe)
Preprocessing library ghcjs-0.2.1.9007019...
/home/u/.stack/programs/x86_64-linux/ghcjs-0.2.1.9007019_ghc-8.0.1/src/src/Compiler/JMacro/Base.hs:1:55: warning:
-XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS
/home/u/.stack/programs/x86_64-linux/ghcjs-0.2.1.9007019_ghc-8.0.1/src/src/Compiler/JMacro/QQ.hs:1:55: warning:
-XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS
[ 1 of 50] Compiling GHCJS.Prim.TH.Serialized ( lib/ghcjs-prim/GHCJS/Prim/TH/Serialized.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/GHCJS/Prim/TH/Serialized.o )
Because it is too long to post here I have excluded the middle of the output. Which includes lots of warning messages.
[49 of 50] Compiling Compiler.Program ( src/Compiler/Program.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/Compiler/Program.o )
[50 of 50] Compiling GHCJS ( src/GHCJS.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/GHCJS.o )
Preprocessing executable 'ghcjs' for ghcjs-0.2.1.9007019...
[1 of 1] Compiling Main ( src-bin/Main.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/ghcjs/ghcjs-tmp/Main.o )
Linking .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/ghcjs/ghcjs ...
Preprocessing executable 'ghcjs-boot' for ghcjs-0.2.1.9007019...
[1 of 1] Compiling Main ( src-bin/Boot.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/ghcjs-boot/ghcjs-boot-tmp/Main.o )
/home/u/.stack/programs/x86_64-linux/ghcjs-0.2.1.9007019_ghc-8.0.1/src/src-bin/Boot.hs:690:1: warning: [-Wtabs]
Tab character found here, and in three further locations.
Please use spaces instead.
Linking .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/ghcjs-boot/ghcjs-boot ...
Preprocessing executable 'ghcjs-pkg' for ghcjs-0.2.1.9007019...
[1 of 1] Compiling Main ( src-bin/Pkg.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/ghcjs-pkg/ghcjs-pkg-tmp/Main.o )
Linking .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/ghcjs-pkg/ghcjs-pkg ...
/usr/bin/ld: cannot find -ltinfo
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
-- While building package ghcjs-0.2.1.9007019 using:
/home/u/.stack/programs/x86_64-linux/ghcjs-0.2.1.9007019_ghc-8.0.1/src/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/setup/setup --builddir=.stack-work/dist/x86_64-linux/Cabal-1.24.0.0 build lib:ghcjs exe:ghcjs exe:ghcjs-boot exe:ghcjs-pkg exe:ghcjs-run exe:haddock-ghcjs exe:hsc2hs-ghcjs --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
"Linking .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/ghcjs-pkg/ghcjs-pkg ...
/usr/bin/ld: cannot find -ltinfo"
You are missing the libtinfo library which is part of ncurses. Depending on your environment try something like:
sudo apt-get install libtinfo-dev
As an aside, getting all the pieces that ghcjs needs to build successfully is tricky and not well documented as of September 2018. One might hope that as the project matures it will get easier to install, and that a binary package will be produced. Know that you are not the only person who has these issues. It takes some patience and trial-and-error to get ghcjs working right now.
Others have had success using nix, I did not.

Windows 8 ghc-mod installation fails

I'm trying to work on Haskell in IntelliJ IDEA on Windows 8.
I installed the latest Haskell plugin, and found that it requires ghc.exe, cabal.exe and ghc-mod.exe prepared. Haskell Platform (x64) originally contains ghc.exe and cabal.exe, so what I need in order to make the plugin work is ghc-mod.exe.
Just as many guides say, I tried installing it through cabal like this:
cabal install ghc-mod
It failed installing haskell-src-exts in the middle of the process, so I installed happy and tried the same command again. Then it succeeded to install src-exts, yet not ghc-mod. Cabal produced this error log:
Building ghc-mod-0.3.0...
Preprocessing executable 'ghc-mod' for ghc-mod-0.3.0...
[1 of 6] Compiling Param ( Param.hs, dist\dist-sandbox-67612b7f\build\ghc-mod\ghc-mod-tmp\Param.o )
[2 of 6] Compiling Lang ( Lang.hs, dist\dist-sandbox-67612b7f\build\ghc-mod\ghc-mod-tmp\Lang.o )
[3 of 6] Compiling List ( List.hs, dist\dist-sandbox-67612b7f\build\ghc-mod\ghc-mod-tmp\List.o )
[4 of 6] Compiling Check ( Check.hs, dist\dist-sandbox-67612b7f\build\ghc-mod\ghc-mod-tmp\Check.o )
[5 of 6] Compiling Browse ( Browse.hs, dist\dist-sandbox-67612b7f\build\ghc-mod\ghc-mod-tmp\Browse.o )
Browse.hs:41:72:
Not in scope: data constructor `ExplicitForall'
Perhaps you meant `ExplicitForAll' (imported from Language.Haskell.Exts.Extension)
This doesn't make sense to me at all. What can I do?

Error installing websockets package for Haskell in Cygwin

I'm trying to install a package to the Haskell Platform in Cygwin. It requires the websockets package, for which the most recent version is 0.9.0.1.
My command looks like:
cabal install websockets
And I get the following error message during the build (it downloads fine):
Resolving dependencies...
Configuring websockets-0.9.0.1...
Building websockets-0.9.0.1...
Failed to install websockets-0.9.0.1
Last 10 lines of the build log ( C:\Users\username\AppData\Roaming\cabal\logs\websockets-0.9.0.1.log ):
Building websockets-0.9.0.1...
Preprocessing library websockets-0.9.0.1...
[ 1 of 11] Compiling Network.WebSockets.Hybi13.Mask ( src\Network\WebSockets\Hybi13\Mask.hs, dist\build\Network\WebSockets\Hybi13\Mask.o )
[ 2 of 11] Compiling Network.WebSockets.Http ( src\Network\WebSockets\Http.hs, dist\build\Network\WebSockets\Http.o )
[ 3 of 11] Compiling Network.WebSockets.Types ( src\Network\WebSockets\Types.hs, dist\build\Network\WebSockets\Types.o )
[ 4 of 11] Compiling Network.WebSockets.Stream ( src\Network\WebSockets\Stream.hs, dist\build\Network\WebSockets\Stream.o )
src\Network\WebSockets\Stream.hs:24:57:
Module `Network.Socket.ByteString.Lazy' does not export `sendAll'
cabal.exe: Error: some packages failed to install:
websockets-0.9.0.1 failed during the building phase. The exception was:
ExitFailure 1
I have a default install of Cygwin x64 and Haskell Platform x64 on Windows 7 Pro x64. Is there a workaround to this? Or am I missing some configuration?
I have the same cabal update issue mentioned at http://www.haskell.org/pipermail/beginners/2010-June/004357.html, where my updated cabal version is not being used (I keep getting notified about a newer version), but the install command keeps saying the new version installed fine. I'm not sure if that has something to do with this...
I did not find an actual answer for why the most current version of websockets won't build, but what fixed my issue is installing an older version of websockets.
cabal install websockets-0.8.6.2

GUI programming in Haskell - installation problems on Ubuntu

is there a GUI package that is still up-to-date?
I tried installing both wxHaskell and gtk2hs today and both fail on dependencies I just cannot solve (wxHaskell cannot find some wxWidget libs and while trying the glade tutorial gtk2hs fails on a missing pkg-config libglade2-0 I installed too).
I guess it's just some problem with me not understanding the linux/cabal/package install things good enough but is there a up-to-date tutorial how to get started (install) some GUI lib for Haskell somewhere around?
Here are the errors:
carsten#Carsten-VirtualBox:~$ cabal install glade
Resolving dependencies...
[1 of 2] Compiling SetupWrapper ( /tmp/glade-0.12.1-12934/glade-0.12.1/SetupWrapper.hs, /tmp/glade-0.12.1-12934/glade-0.12.1/dist/setup/SetupWrapper.o )
[2 of 2] Compiling Main ( /tmp/glade-0.12.1-12934/glade-0.12.1/Setup.hs, /tmp/glade-0.12.1-12934/glade-0.12.1/dist/setup/Main.o )
Linking /tmp/glade-0.12.1-12934/glade-0.12.1/dist/setup/setup ...
[1 of 2] Compiling Gtk2HsSetup ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o )
[2 of 2] Compiling Main ( SetupMain.hs, dist/setup-wrapper/Main.o )
Linking dist/setup-wrapper/setup ...
Configuring glade-0.12.1...
setup: The pkg-config package libglade-2.0 version >=2.0.0 is required but it
could not be found.
cabal: Error: some packages failed to install:
glade-0.12.1 failed during the configure step. The exception was:
ExitFailure 1
and
carsten#Carsten-VirtualBox:~$ cabal install wxc
Resolving dependencies...
[1 of 1] Compiling Main ( /tmp/wxc-0.90.0.4-13078/wxc-0.90.0.4/Setup.hs, /tmp/wxc-0.90.0.4-13078/wxc-0.90.0.4/dist/setup/Main.o )
Linking /tmp/wxc-0.90.0.4-13078/wxc-0.90.0.4/dist/setup/setup ...
Configuring wxc-0.90.0.4...
Warning: No config found to match: /usr/bin/wx-config --version=2.9 --version-full
in /usr/lib/x86_64-linux-gnu/wx/config
If you require this configuration, please install the desired
library build. If this is part of an automated configuration
test and no other errors occur, you may safely ignore it.
You may use wx-config --list to see all configs available in
the default prefix.
setup: failed
cabal: Error: some packages failed to install:
wxc-0.90.0.4 failed during the configure step. The exception was:
ExitFailure 1
This is really frustrating me - maybe someone can help me here - thank you!
I am running 12.04 and everything works fine for me.
Are you sure you have libglade2-dev installed ? That should fix it.
Coming from ArchLinux i had the same problem at first when i didn't know there were separate dev libraries, i don't remember having to do this in arch.

Installing gtk2hs

I've installed gtk2hs-buildtools with no problem, but here's the output when I try to install gtk using 'cabal install gtk':
[gautam#gautam ~]$ cabal install gtk
Resolving dependencies...
[1 of 2] Compiling SetupWrapper ( /tmp/cairo-0.12.213784/cairo-0.12.2/SetupWrapper.hs, /tmp/cairo-0.12.213784/cairo-0.12.2/dist/setup/SetupWrapper.o )
[2 of 2] Compiling Main ( /tmp/cairo-0.12.213784/cairo-0.12.2/Setup.hs, /tmp/cairo-0.12.213784/cairo-0.12.2/dist/setup/Main.o )
Linking /tmp/cairo-0.12.213784/cairo-0.12.2/dist/setup/setup ...
[1 of 2] Compiling Gtk2HsSetup ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o )
[2 of 2] Compiling Main ( SetupMain.hs, dist/setup-wrapper/Main.o )
Linking dist/setup-wrapper/setup ...
Cannot find gtk2hsC2hs
Please install `gtk2hs-buildtools` first and check that the install directory is in your PATH (e.g. HOME/.cabal/bin).
[1 of 2] Compiling SetupWrapper ( /tmp/glib-0.12.213784/glib-0.12.2/SetupWrapper.hs, /tmp/glib-0.12.213784/glib-0.12.2/dist/setup/SetupWrapper.o )
[2 of 2] Compiling Main ( /tmp/glib-0.12.213784/glib-0.12.2/Setup.hs, /tmp/glib-0.12.213784/glib-0.12.2/dist/setup/Main.o )
Linking /tmp/glib-0.12.213784/glib-0.12.2/dist/setup/setup ...
[1 of 2] Compiling Gtk2HsSetup ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o )
[2 of 2] Compiling Main ( SetupMain.hs, dist/setup-wrapper/Main.o )
Linking dist/setup-wrapper/setup ...
Cannot find gtk2hsC2hs
Please install `gtk2hs-buildtools` first and check that the install directory is in your PATH (e.g. HOME/.cabal/bin).
cabal: Error: some packages failed to install:
cairo-0.12.2 failed during the configure step. The exception was:
ExitFailure 1
gio-0.12.2 depends on glib-0.12.2 which failed to install.
glib-0.12.2 failed during the configure step. The exception was:
ExitFailure 1
gtk-0.12.2 depends on glib-0.12.2 which failed to install.
pango-0.12.2 depends on glib-0.12.2 which failed to install.
[gautam#gautam ~]$
This problem occurs on both my Mac and in my Fedora VM. Does anybody know how to fix this? Thanks!
You need to add the path in which the Gtk2Hs build tools are stored to your $PATH environment variable, so that the build process can find them. On Linux, it's $HOME/.cabal/bin. On OS X, it's $HOME/Library/Haskell/bin (although that might just be if you're using the Haskell Platform — if that doesn't work, try $HOME/.cabal/bin).
To add a directory to your $PATH, run export PATH=directory:$PATH. You should probably add this to your shell's startup file (it depends on your shell and OS — probably either ~/.bashrc, ~/.profile or ~/.bash_profile). (You'll need to do so if you want to run any programs you install with cabal directly, anyway.)

Resources