cabal install cabal-install fails due "missing" installed-package - haskell

I just updated the haskel-plataform did a cabal update and was informed there is a new version of cabal-install that I should update to. So I do a cabal install cabal-install and get:
cabal: The following installed packages are broken because other packages they
depend on are missing. These broken packages must be rebuilt before they can
be used.
package random-1.0.1.1 is broken due to missing package
base-4.5.1.0-47f48c3ae7f8256a66a23e9dfe22eefc
cabal: Error: some packages failed to install:
cabal-install-1.16.0.2 failed during the configure step. The exception was:
ExitFailure 1
The thing is that If I do cabal install random, I see that that version of random is already installed:
=> cabal install random
Resolving dependencies...
All the requested packages are already installed:
random-1.0.1.1
I am at a loss at what is the problem or how to fix it

Related

cabal-install failed to install a version that depends on the same version

I'm completely new to Haskell and I'm trying to replicate the code.world environment locally, so I need to install codeworld-api so that I can import CodeWorld. The problem is that when I run cabal install codeworld-api, it fails, and the following errors occur:
cabal: Error: some packages failed to install:
codeworld-api-0.7.0-JVbla7smM91CfqAXV0vVqz depends on codeworld-api-0.7.0
which failed to install.
haskell-src-exts-1.23.1-Z8xb2tkymYIClPofvAOw3 failed during the configure
step. The exception was:
ExitFailure 1
haskell-src-meta-0.8.7-GrcU6O1imfWLP5hRNzLFKK depends on
haskell-src-meta-0.8.7 which failed to install.
haskell-tests-0.1.0.0-IkWvWTmkph53PXtIhZGNWg depends on haskell-tests-0.1.0.0
which failed to install.
reflex-0.8.1.0-5XPDDia7wXx4bpQRZBxYDv depends on reflex-0.8.1.0 which failed
to install.
I also tried to add codeworld-api in the build-depends section in .cabal, but nothing changes.
I've read this, but --allow-newer also does nothing.
I tried, with no success:
cabal update
cabal install Cabal cabal-install
cabal new-install codeworld-api
cabal new-build
codeworld-api also doesn't show up in ghc-pkg list.
I have no idea what's happening...
Platform info
Ubuntu 20.04
cabal-install version 2.4.0.0
Cabal library version 2.4.0.1
ghc version 8.6.5
Packages installed from apt:
ghc
ghc-doc
cabal-install

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?

cabal glib installation error

I try install install glib via cabal
evgeny#virtuos:~$ cabal install glib-0.13.0.7
Resolving dependencies...
Failed to install glib-0.13.0.7
cabal: Error: some packages failed to install:
glib-0.13.0.7 failed during the configure step. The exception was:
user error (The package 'glib' requires Cabal library version -any && >=1.18
but no suitable version is installed.)
evgeny#virtuos:~$ cabal --version
cabal-install version 1.20.0.3
using version 1.20.0.2 of the Cabal library
what's wrong?
OS: Ubuntu 14.10
Cabal 1.20.0.3
GHC: 7.6.3
Run cabal install cabal-install. Daniel Wagner's suggestion will most likely provide different results than cabal --version.

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.

Haskell cabal-install errors

I am having lots of problems with cabal-install:
1: Every time I do cabal update, it tells me to do cabal install cabal-install, so I do, and then when I do cabal update again, it says the same thing.
2: When I try to install ghc-mod from hackage, it gives me this error:
[username#arch ~]$ cabal install ghc-mod
In order, the following will be installed:
haskell-src-exts-1.14.0 (reinstall) changes: pretty-1.1.1.1 -> 1.1.1.0
hlint-1.8.55 (reinstall)
ghc-mod-3.1.4
setup: The program happy version >=1.17 is required but it could not be found.
ghc-mod-3.1.4 depends on haskell-src-exts-1.14.0 which failed to install.
haskell-src-exts-1.14.0 failed during the configure step.
hlint-1.8.55 depends on haskell-src-exts-1.14.0 which failed to install.
So the problem was The program happy version >=1.17 is required but it could not be found., so I installed happy 1.19.2 using cabal install happy without problems.
I tried cabal install ghc-mod again, same error, so I tried cabal install haskell-src-exts --reinstall --force-reinstalls. It gave me the following error:
[username#arch ~]$ cabal install haskell-src-exts --reinstall --force-reinstalls
Configuring haskell-src-exts-1.14.0...
setup: The program happy version >=1.17 is required but it could not be found.
Failed to install haskell-src-exts-1.14.0
cabal: Error: some packages failed to install:
haskell-src-exts-1.14.0 failed during the configure step. The exception was:
ExitFailure 1
Basically The program happy version >=1.17 is required but it could not be found.. So happy is the problem again?
I have also tried downloading the tar.gz files from hackage and using cabal install on the
.cabal file, also modified the .cabal file to ignore dependencies, still failed.
cabal install places executables in ~/.cabal/bin.
If you add it to your path, you will be able to use the new executables installed by cabal:
$ PATH=$HOME/.cabal/bin:$PATH
I encountered with same problem and I solved the problem with installing happy package(confusing package name). So install it with your package manager(apt-get, pacman etc) before install package with cabal. This should be fix the problem.

Resources