What does Cabal ExitFailure 127 mean? - haskell

When I try to install the "encoding" library, I get this failure, but I can't find any documentation to tell me what it means:
$ sudo cabal install encoding --global
Resolving dependencies...
cabal: Error: some packages failed to install:
encoding-0.6.6 failed during the configure step. The exception was:
ExitFailure 127
EDIT: With verbose logging, I have:
$ cabal install encoding --global -v
Reading available packages...
Resolving dependencies...
In order, the following would be installed:
encoding-0.6.6 (new package)
Extracting
/home/aditya/.cabal/packages/hackage.haskell.org/encoding/0.6.6/encoding-0.6.6.tar.gz
to /tmp/encoding-0.6.610687...
creating /tmp/encoding-0.6.610687/encoding-0.6.6/dist/setup
/tmp/encoding-0.6.610687/encoding-0.6.6/dist/setup/setup configure --verbose=2
--ghc --global --flags=newghc --flags=splitbase --constraint=HaXml ==1.22.5
--constraint=array ==0.3.0.2 --constraint=base ==4.3.1.0 --constraint=binary
==0.5.1.0 --constraint=bytestring ==0.9.1.10 --constraint=containers ==0.4.0.0
--constraint=extensible-exceptions ==0.1.1.2 --constraint=ghc ==7.0.3
--constraint=ghc-prim ==0.2.0.0 --constraint=mtl ==2.0.1.0
--constraint=regex-compat ==0.93.1
World file is already up to date.
cabal: Error: some packages failed to install:
encoding-0.6.6 failed during the configure step. The exception was:
ExitFailure 127
This still doesn't seem to tell me what C library dependency could be missing.

This typically means that C libraries were missing, that were required by the package (or one of its dependencies).
Turning on verbose logging should help.
$ cabal install encoding -v

Related

cabal install hsparql error

Im trying to install hsparql, cabal version 1.22.1.1
cabal install hsparql
gives
Could not find module `Network.URI'
It is a member of the hidden package `network-uri-2.6.0.1'.
Perhaps you need to add `network-uri' to the build-depends in your .cabal file.
Use -v to see a list of the files searched for.
Failed to install hsparql-0.2.5
cabal: Error: some packages failed to install:
hsparql-0.2.5 failed during the building phase. The exception was:
ExitFailure 1
but
cabal install network-uri
shows
All the requested packages are already installed:
network-uri-2.6.0.1
what could be the problem?

Trouble booting Haste

I'm having trouble running haste-boot --force --local (though the same thing also happens when booting the latest cabal version with plain haste-boot). It makes some progress, then fails out with
cabal: Error: some packages failed to install:
bytestring-0.10.4.1 failed during the building phase. The exception was:
ExitFailure 1
haste-lib-0.4 depends on bytestring-0.10.4.1 which failed to install
Command '/home/inaimathi/.cabal/bin/haste-inst' failed with error code 1
I've since manually installed bytestring-0.10.4.1 with cabal install so that:
~/projects/haste-compiler $ cabal install bytestring-0.10.4.1
Resolving dependencies...
All the requested packages are already installed:
bytestring-0.10.4.1
Use --reinstall if you want to reinstall anyway.
~/projects/haste-compiler $
but the haste version still isn't cooperating.
~/projects/haste-compiler $ haste-inst install bytestring-0.10.4.1 haste-inst install bytestring-0.10.4.1
Resolving dependencies...
In order, the following will be installed:
bytestring-0.10.4.1 (reinstall) changes: base-4.6.0.1 added, deepseq-1.4.0.0
added, integer-gmp-0.5.0.0 added
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Configuring bytestring-0.10.4.1...
Building bytestring-0.10.4.1...
Preprocessing library bytestring-0.10.4.1...
hastec: user error (Haste needs to be rebooted; please run haste-boot)
Failed to install bytestring-0.10.4.1
cabal: Error: some packages failed to install:
bytestring-0.10.4.1 failed during the building phase. The exception was:
ExitFailure 1
~/projects/haste-compiler $
Based on that error message, it looks like installing the appropriate bytestring version with haste-inst requires that I run haste-boot first, but haste-boot is failing because of an error related to installing bytestring.
Any ideas on what I can do here?
EDIT:
The relevant snippet seems to happen much earlier than the actual error in installation:
...
Data/ByteString/Internal.hs:212:10:
No instance for (Control.DeepSeq.GNFData
(GHC.Generics.Rep ByteString))
arising from a use of `Control.DeepSeq.$gdmrnf'
Possible fix:
add an instance declaration for
(Control.DeepSeq.GNFData (GHC.Generics.Rep ByteString))
In the expression: (Control.DeepSeq.$gdmrnf)
In an equation for `rnf': rnf = (Control.DeepSeq.$gdmrnf)
In the instance declaration for `NFData ByteString'
Failed to install bytestring-0.10.4.1
...
Edit 2: Jefffrey, the terminal session you requested would put this post above the 30000 character limit. Here's a pastebin link to it instead.

Cabal installation issues on Windows

I am having some issues installing packages on Windows using cabal. The following command:
cabal install ghc-mod
produces these errors
C:\temp> cabal install ghc-mod
Resolving dependencies...
Failed to install haskell-src-exts-1.15.0.1
cabal.exe: Error: some packages failed to install:
ghc-mod-4.1.3 depends on haskell-src-exts-1.15.0.1 which failed to install.
haskell-src-exts-1.15.0.1 failed while unpacking the package. The exception was:
C:\Users\...\AppData\Local\Temp\haskell-src-exts-1.15.0.1-55548\haskell-src- exts-1.15.0.1\dist-tmp:
MoveFileEx
"C:\\Users\\...\\AppData\\Local\\Temp\\haskell-src-exts-1.15.0.1-55548\\haskell-src-exts-1.15.0.1\\dist-tmp"
"C:\\Users\\...\\AppData\\Local\\Temp\\haskell-src-exts-1.15.0.1-55548\\haskell-src-exts-1.15.0.1\\dist":
permission denied (Acesso negado.)
hlint-1.9 depends on haskell-src-exts-1.15.0.1 which failed to install.
I have also tried:
cabal install haskell-src-exts
However I got the same error.
can someone help me?
UPDATE
Output error executing cabal install haskell-src-exts:
c:\> cabal install haskell-src-exts
Resolving dependencies...
Failed to install haskell-src-exts-1.15.0.1
cabal: Error: some packages failed to install:
haskell-src-exts-1.15.0.1 failed while unpacking the package. The exception was:
C:\Users\DIULLE~1\AppData\Local\Temp\haskell-src-exts-1.15.0.1-35992\haskell-src-exts-1.15.0.1\dist-tmp:
MoveFileEx
"C:\\Users\\DIULLE~1\\AppData\\Local\\Temp\\haskell-src-exts-1.15.0.1-35992\\haskell-src-exts-1.15.0.1\\dist-tmp"
"C:\\Users\\DIULLE~1\\AppData\\Local\\Temp\\haskell-src-exts-1.15.0.1-35992\\haskell-src-exts-1.15.0.1\\dist":
permission denied (Acesso negado.)
This has been a known bug for some time1, and seems to be fixed six days ago, so update your cabal2:
> cabal update
> cabal install cabal cabal-install
> cabal install ghc-mod
However, if you don't want to jump on the cabal-git-train, you can still unpack, configure and install packages by hand. This will prevent the behaviour, since it is triggered by moving temporary dictionaries and name clashes:
> cabal unpack haskell-src-exts
> cd haskell-src-exts*
> cabal configure
> cabal build
> cabal install
1: since the bug has been reported on 22nd Feb, it seems to affect all versions from >= 1.18.* to < 1.20.0.3.
2: make sure that you really run the new version.

Cabal installation issues

I am having some issues installing packages using cabal. Issuing the following command:
> cabal install ghc-mod stylish-haskell haskell-docs hdevtools
produces these errors
Building yaml-0.8.8.3...
Preprocessing library yaml-0.8.8.3...
<command line>: cannot satisfy -package-id aeson-0.7.0.6-b19228a032fb34be4eef122
913c6e81a
(use -v for more information)
Failed to install yaml-0.8.8.3
cabal: Error: some packages failed to install:
ghc-mod-4.1.1 depends on haskell-src-exts-1.15.0.1 which failed to install.
haskell-docs-0.2.0.0 failed during the building phase. The exception was:
ExitFailure 1
haskell-src-exts-1.15.0.1 failed while unpacking the package. The exception
was:
C:\Users\Arnob\AppData\Local\Temp\haskell-src-exts-1.15.0.1-5840\haskell-src-ext
s-1.15.0.1\dist-tmp:
MoveFileEx
"C:\\Users\\Arnob\\AppData\\Local\\Temp\\haskell-src-exts-1.15.0.1-5840\\haskell
-src-exts-1.15.0.1\\dist-tmp"
"C:\\Users\\Arnob\\AppData\\Local\\Temp\\haskell-src-exts-1.15.0.1-5840\\haskell
-src-exts-1.15.0.1\\dist":
permission denied (Access is denied.)
hdevtools-0.1.0.5 depends on unix-2.7.0.1 which failed to install.
hlint-1.8.61 depends on haskell-src-exts-1.15.0.1 which failed to install.
stylish-haskell-0.5.10.0 depends on yaml-0.8.8.3 which failed to install.
unix-2.7.0.1 failed during the configure step. The exception was:
ExitFailure 1
yaml-0.8.8.3 failed during the building phase. The exception was:
ExitFailure 1
I have also tried installing the windows fork of hdevltools by running
> cabal install
on the cloned github repo. However this also produces errors.
As a last ditch effort, I tried changing the remote repo to "stackage", i.e.
remote-repo: stackage: http://www.stackage.org/stackage/44ea140bd97cbb0f6140d331f8f7f8667a637eda
but this did not help either.
All help is appreciated!
It looks like this is a Windows specific issue, where cabal cannot move some required files in the haskell-src-exts distribution (the issue is also seen in other packages, such as pandoc). This might be related to the issue reported here: https://github.com/haskell/cabal/issues/1698
I was able to get the haskell-src-exts package installed by doing the following:
> cabal unpack haskell-src-exts
> cd haskell-src-exts
> cabal install
Your problem is listed right in Cabal's error message:
MoveFileEx ... ...:
permission denied (Access is denied.)
So it seems you have a permission problem with your Windows installation (or at least your user temp folder), which is why Cabal stumbles.

How to reset Haskell package cache

Deciding to learn Haskell, installed ghc on OS X via Homebrew (web binaries weren't downloading at the time).
All great, following along with Learn You a Haskell, but then decided to install some packages and see how things run.
cabal install clckwrks-cli was running fine until...
Public internet craps out half-way through install/build of a few projects.
Now, none of those programs will reinstall and in the case of clckwrks-cli, I get the following error:
$ cabal install clckwrks-cli --reinstall --force-reinstalls
Resolving dependencies...
Failed to install cipher-aes-0.2.6
Failed to install cipher-rc4-0.1.4
Failed to install cookie-0.4.0.1
Failed to install crypto-numbers-0.2.3
Configuring happstack-hsp-7.2.4...
Building happstack-hsp-7.2.4...
Preprocessing library happstack-hsp-7.2.4...
ghc: could not execute: hsx2hs
Failed to install happstack-hsp-7.2.4
Failed to install lifted-base-0.2.2.0
Failed to install publicsuffixlist-0.1
Failed to install pwstore-purehaskell-2.1.1
Configuring reform-hsp-0.2.4...
Building reform-hsp-0.2.4...
Preprocessing library reform-hsp-0.2.4...
ghc: could not execute: hsx2hs
Failed to install reform-hsp-0.2.4
Failed to install web-plugins-0.2.5
Failed to install wl-pprint-text-1.1.0.2
Failed to install xml-types-0.3.4
cabal: Error: some packages failed to install:
attoparsec-conduit-1.0.1.2 depends on lifted-base-0.2.2.0 which failed to
install.
authenticate-1.3.2.6 depends on xml-types-0.3.4 which failed to install.
blaze-builder-conduit-1.0.0 depends on lifted-base-0.2.2.0 which failed to
install.
cipher-aes-0.2.6 failed while unpacking the package. The exception was:
user error (data is not in tar format)
cipher-rc4-0.1.4 failed while unpacking the package. The exception was:
user error (data is not in tar format)
clckwrks-0.21.1 depends on xml-types-0.3.4 which failed to install.
clckwrks-cli-0.2.10 depends on xml-types-0.3.4 which failed to install.
conduit-1.0.14 depends on lifted-base-0.2.2.0 which failed to install.
cookie-0.4.0.1 failed while unpacking the package. The exception was:
user error (data is not in tar format)
cprng-aes-0.5.2 depends on cipher-aes-0.2.6 which failed to install.
crypto-numbers-0.2.3 failed while unpacking the package. The exception was:
user error (data is not in tar format)
crypto-pubkey-0.2.4 depends on crypto-numbers-0.2.3 which failed to install.
fb-0.14.11 depends on publicsuffixlist-0.1 which failed to install.
happstack-authenticate-0.10.10 depends on xml-types-0.3.4 which failed to
install.
happstack-hsp-7.2.4 failed during the building phase. The exception was:
ExitFailure 1
hsx-jmacro-7.3.4 depends on wl-pprint-text-1.1.0.2 which failed to install.
http-conduit-1.9.6 depends on publicsuffixlist-0.1 which failed to install.
jmacro-0.6.8 depends on wl-pprint-text-1.1.0.2 which failed to install.
lifted-base-0.2.2.0 failed while unpacking the package. The exception was:
user error (data is not in tar format)
monad-logger-0.3.4.0 depends on lifted-base-0.2.2.0 which failed to install.
publicsuffixlist-0.1 failed while unpacking the package. The exception was:
user error (data is not in tar format)
pwstore-purehaskell-2.1.1 failed while unpacking the package. The exception
was:
user error (data is not in tar format)
reform-hsp-0.2.4 failed during the building phase. The exception was:
ExitFailure 1
resourcet-0.4.10 depends on lifted-base-0.2.2.0 which failed to install.
tls-1.1.5 depends on crypto-numbers-0.2.3 which failed to install.
tls-extra-0.6.6 depends on crypto-numbers-0.2.3 which failed to install.
web-plugins-0.2.5 failed while unpacking the package. The exception was:
user error (data is not in tar format)
wl-pprint-text-1.1.0.2 failed while unpacking the package. The exception was:
user error (data is not in tar format)
xml-conduit-1.1.0.9 depends on xml-types-0.3.4 which failed to install.
xml-types-0.3.4 failed while unpacking the package. The exception was:
user error (data is not in tar format)
zlib-conduit-1.0.0 depends on lifted-base-0.2.2.0 which failed to install.
Same issue with a few other projects that suffered same network outage mid-install.
Loving the language so far, NOT the package management :(
Cabal sandboxes are frequently recommended for development but work well for trying out some package quickly. If anything goes wrong they are easily disposable and don't affect any other packages you have already installed. Here is what I would do to try out clckwrks-cli (BTW, if you want to just try out any package you might to choose another package with less dependencies).
$ cd /path/to/sandboxes
$ cabal get clckwrks-cli
$ cd clckwrks-cli-<version>
$ cabal sandbox init
$ cabal install --only-dependencies -j<N> # N is the number of CPU cores
At this point you can type cabal run to run the executable installed by the package (which it'll probably be at ./dist/build/bin/), cabal test for running tests, or cabal repl in order to run a ghci session with the sandboxes packages available.
If anything goes wrong you can revert back the sandbox by typing cabal sandbox delete and cabal clean. When you are done you can safely remove the sandbox without affecting other packages.
Here is what worked for me in the past
For a package $f, do
ghc-pkg.exe unregister --global --force $f
ghc-pkg.exe recache
According to its documentation, ghc-pkg.exe unregister "unregisters a package" and recache "regenerate the package database cache". --global needs to be used if the package in question was installed in system directories.
In case the database is severely damaged, I would delete the user or system cabal directory and reinstall packages that I had. I usually do this by cabal install one or several of the application libraries that I use, and let cabal reinstall the dependencies. Note: the cabal directory depends on the OS and version of GHC.
ghc-pkg unregister --force clckwrks-cli
I was having trouble with unordered-containers-0.2.5.1 and deleting the file:
~/.cabal/packages/hackage.haskell.org/unordered-containers/0.2.5.1/unordered-containers-0.2.5.1.tar.gz
fixed the problem for me. (i.e. the error cabal: data is not in tar format)

Resources