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
Related
I'm trying to download the HERMIT tool using the command cabal install hermit.
I dowloaded Haskell using GHCup. If I try to install with GHC 9.2.5 (recommended version by GHCup), I get errors like the following:
src\Text\PrettyPrint\MarkedHughesPJ.hs:487:43: error:
Ambiguous occurrence `<>'
It could refer to
either `Prelude.<>',
imported from `Prelude' at src\Text\PrettyPrint\MarkedHughesPJ.hs:33:8-38
(and originally defined in `GHC.Base')
or `Text.PrettyPrint.MarkedHughesPJ.<>',
defined at src\Text\PrettyPrint\MarkedHughesPJ.hs:629:3
|
487 | go y (z:zs) = (y <> p) : go z zs
| ^^
cabal-3.6.2.0.exe: Failed to build marked-pretty-1.1.2.1 (which is required by
exe:hermit from hermit-0.7.1.0). See the build log above for details.
Given that the tool is pretty old, my suspicion is that it should work with an older GHC version. GHCup list gives me versions from 7.10.3 till 9.4.4.
If I run with GHC 7.10.3, I get a different kind of error:
Failed to build kure-2.18.6.
Build log (
C:\cabal\logs\ghc-7.10.3\kure-2.18.6-b07c497f3357de591e4a4906067e2a1c674021a6.log
):
Preprocessing library for kure-2.18.6..
Building library for kure-2.18.6..
Language\KURE\BiTransform.hs:41:8:
Could not find module `Control.Monad.Fail'
It is a member of the hidden package `fail-4.9.0.0#JWbBevols3d7TkSXAGkvyg'.
Perhaps you need to add `fail' to the build-depends in your .cabal file.
Use -v to see a list of the files searched for.
cabal-3.6.2.0.exe: Failed to build kure-2.18.6 (which is required by
exe:hermit from hermit-1.0.1). See the build log above for details.
Very weird, since GHC 7.10.3 is recommended?
So, having no other options, I continued exploring versions. For GHC 8.0.2, I got yet another error:
Failed to build kure-2.18.6.
Build log (
C:\cabal\logs\ghc-8.0.2\kure-2.18.6-0171a393aff229af835cd303562178192d2a6c3c.log
):
Preprocessing library for kure-2.18.6..
Building library for kure-2.18.6..
[ 1 of 15] Compiling Language.KURE.Combinators.Monad ( Language\KURE\Combinators\Monad.hs, dist\build\Language\KURE\Combinators\Monad.o )
[ 2 of 15] Compiling Language.KURE.MonadCatch ( Language\KURE\MonadCatch.hs, dist\build\Language\KURE\MonadCatch.o )
[ 3 of 15] Compiling Language.KURE.Transform ( Language\KURE\Transform.hs, dist\build\Language\KURE\Transform.o )
Language\KURE\Transform.hs:241:42: error:
Not in scope: type constructor or class `Semigroup'
cabal-3.6.2.0.exe: Failed to build kure-2.18.6 (which is required by
exe:hermit from hermit-0.7.1.0). See the build log above for details.
I even tried installing on a virtual machine on the latest Ubuntu (my host PC is Windows 11), but I was stuck with the same kind of errors.
What should i try next? How to set a GHC in GHCup which is not listed anymore as availible? (an older GHC version may be the answer). Since I get this text back:
PS C:\Users\broland> ghcup install ghc 7.8.4
[ Info ] downloading: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.7.yaml as file C:\ghcup\cache\ghcup-0.0.7.yaml
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
[ Warn ] New ghc version available. To upgrade, run 'ghcup install ghc 9.4.4'
[ Warn ] New cabal version available. To upgrade, run 'ghcup install cabal 3.8.1.0'
[ Warn ] New stack version available. To upgrade, run 'ghcup install stack 2.9.3'
[ Info ] verifying digest of: gs.exe
[ Error ] Unable to find a download for the requested version/distro.
[ Error ] Also check the logs in C:\ghcup\logs
PS: I would like to stick to GHCup because it makes handling dependencies easy, I also tried downloading binary packages and that way I got stuck in another error...
I just started to learn haskell few days ago. I install ghc version 8.10.2 and cabal version is
cabal-install version 3.2.0.0
compiled using version 3.2.0.0 of the Cabal library
I am try to install the graphics library for further practicing haskell. I tried to install three libraries(OpenGL, gloss etc). All three required OpenGLRaw 3.3.4.0 and all three fails due to this libarary. The log file of fail is below
Preprocessing library for OpenGLRaw-3.3.4.0..
Building library for OpenGLRaw-3.3.4.0..
[ 1 of 617] Compiling Graphics.GL.Groups ( src\Graphics\GL\Groups.hs, dist\build\Graphics\GL\Groups.o )
[ 2 of 617] Compiling Graphics.GL.Types ( src\Graphics\GL\Types.hs, dist\build\Graphics\GL\Types.o )
ghc.exe: could not execute: C:/GitLabRunner/builds/2WeHDSFP/0/ghc/ghc/inplace/mingw/bin/ld.exe
I'm trying to install c2hs with cabal install c2hs.
I created ~/.cabal/bin to install the binary beforehand.
With the command cabal install c2hs to get the errors.
src/Control/StateTrans.hs:77:1: Warning:
Module `Prelude' does not export `catch'
[ 3 of 26] Compiling Data.Errors ( src/Data/Errors.hs, dist/build/c2hs/c2hs-tmp/Data/Errors.o )
[ 4 of 26] Compiling Data.Attributes ( src/Data/Attributes.hs, dist/build/c2hs/c2hs-tmp/Data/Attributes.o )
[ 5 of 26] Compiling Text.Lexers ( src/Text/Lexers.hs, dist/build/c2hs/c2hs-tmp/Text/Lexers.o )
[ 6 of 26] Compiling Control.StateBase ( src/Control/StateBase.hs, dist/build/c2hs/c2hs-tmp/Control/StateBase.o )
[ 7 of 26] Compiling Data.NameSpaces ( src/Data/NameSpaces.hs, dist/build/c2hs/c2hs-tmp/Data/NameSpaces.o )
[ 8 of 26] Compiling C2HS.C.Attrs ( src/C2HS/C/Attrs.hs, dist/build/c2hs/c2hs-tmp/C2HS/C/Attrs.o )
[ 9 of 26] Compiling C2HS.C.Builtin ( src/C2HS/C/Builtin.hs, dist/build/c2hs/c2hs-tmp/C2HS/C/Builtin.o )
[10 of 26] Compiling Paths_c2hs ( dist/build/autogen/Paths_c2hs.hs, dist/build/c2hs/c2hs-tmp/Paths_c2hs.o )
dist/build/autogen/Paths_c2hs.hs:21:13: Not in scope: `catch'
dist/build/autogen/Paths_c2hs.hs:22:13: Not in scope: `catch'
dist/build/autogen/Paths_c2hs.hs:23:14: Not in scope: `catch'
dist/build/autogen/Paths_c2hs.hs:24:17: Not in scope: `catch'
cabal: Error: some packages failed to install:
c2hs-0.16.5 failed during the building phase. The exception was:
ExitFailure 1
What is wrong with the installation? The ghc version is 7.6.3.
The install worked for me right now, on my Ubuntu box, so I can say for sure that c2hs isn't broken for everyone right now.
I think you might have version issues.... Try
cabal update
and try the install again.
In particular-
The function Prelude.catch was moved to Control.Exception.catch recently, see https://ghc.haskell.org/trac/ghc/ticket/4865. I downloaded the c2hs sources (using cabal unpack c2hs), and looked at what headers Paths_c2hs.hs needs (this seems to be the file with the import problems). This is what the imports section contained-
import qualified Control.Exception as Exception
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude
(Paths_c2hs.hs is autogenerated, so I had to build it first).
Indeed, it was using Control.Exception. Because this is a module in base, you should have it, and probably just have out of date/mismatched packages. (In fact, my file's line numbers don't match your error message line numbers above- This is another indication we are using different versions, and I believe mine is up to date :) .)
Although I think that the "cabal update" will fix the problem, if not, try looking in these two places-
Does Control.Exception.catch exist in your base modules? Just try to compile an empty program with an dummy reference to catch, like this-
import Control.Exception
x = catch
main = undefined
Does your autogenerated Paths_c2hs.hs point to the correct catch function. Just use cabal to unpack, configure and build c2hs and then look at dist/build/autogen/Paths_c2hs.hs. (you will probably hit your error in the build phase, but given what you have shown above, it will happen after the Paths_c2hs.hs creation).
The issue was that I installed two different versions of ghc on my mac: one from brew install ghc and the other from haskell platform.
I had to install the newest version of haskell platform, but before doing that I also needed to uninstall old version uninstall-hs only VERSION and brew unistall ghc.
After reinstalling the newest haskell platform, the compilation works fine.
https://github.com/haskell/cabal/issues/1137
How to install Haskell cabal tool for Haskell 7.6.1 on Mac OSX?
Other method can be using brew brew install haskell-platform.
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
It looks like most of the build is working but the actual install is failing.
A carefully place echo command reveals that this command is the one that is failing:
install_pkg "cabal-install"
This is the error I am receiving:
cleaning...
Linking Setup ...
Configuring cabal-install-1.17.0...
Building cabal-install-1.17.0...
Preprocessing library cabal-install-1.17.0...
[ 1 of 71] Compiling Distribution.Compat.FilePerms ( Distribution/Compat/FilePerms.hs, dist/build/Distribution/Compat/FilePerms.o )
[ 2 of 71] Compiling Distribution.Compat.Semaphore ( Distribution/Compat/Semaphore.hs, dist/build/Distribution/Compat/Semaphore.o )
Distribution/Compat/Semaphore.hs:12:26:
Module `Control.Exception' does not export `mask_'
Error during cabal-install bootstrap:
Building the cabal-install package failed
Here is the full transcript:
Checking installed packages for ghc-6.12.3...
Cabal is already installed and the version is ok.
transformers is already installed and the version is ok.
mtl is already installed and the version is ok.
deepseq is already installed and the version is ok.
text is already installed and the version is ok.
parsec is already installed and the version is ok.
network is already installed and the version is ok.
time is already installed and the version is ok.
HTTP is already installed and the version is ok.
zlib is already installed and the version is ok.
random is already installed and the version is ok.
stm is already installed and the version is ok.
===========================================
cleaning...
Linking Setup ...
Configuring cabal-install-1.17.0...
Building cabal-install-1.17.0...
Preprocessing library cabal-install-1.17.0...
[ 1 of 71] Compiling Distribution.Compat.FilePerms ( Distribution/Compat/FilePerms.hs, dist/build/Distribution/Compat/FilePerms.o )
[ 2 of 71] Compiling Distribution.Compat.Semaphore ( Distribution/Compat/Semaphore.hs, dist/build/Distribution/Compat/Semaphore.o )
Distribution/Compat/Semaphore.hs:12:26:
Module `Control.Exception' does not export `mask_'
Error during cabal-install bootstrap:
Building the cabal-install package failed
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.