Haskell Cabal update won't work - "Local and remote files match" - haskell

I did "cabal update", bumped the version number on my project, and then did "cabal update" again...
>cabal update
Downloading the latest package list from hackage.haskell.org
Skipping download: Local and remote files match.
^ The cabal respository changed but the update won't appear without a ~5 minutes delay.
>cabal --version
cabal-install version 1.22.6.0
using version 1.22.5.0 of the Cabal library
>ghci --version
The Glorious Glasgow Haskell Compilation System, version 7.10.3
>ver
Microsoft Windows [Version 10.0.10586]

Self answer:
They apparently update their package list every 5 minutes or so - you can't make it any faster

Related

Cabal update appears to be working but not doing anything

I just installed Haskell and have been trying to get it going, but when I tried to start it up, it does this:
C:\Users\isaac>cabal install
Warning: The package list for 'hackage.haskell.org' does not exist. Run
'cabal update' to download it.
cabal: Error reading local package.
Couldn't find .cabal file in: .
C:\Users\isaac>cabal update
Downloading the latest package list from hackage.haskell.org
It has been like that for 10 hours now. I don't know if it's even possible to see how much progress, if any, it's made, but it doesn't seem to be doing anything. The version is:
C:\Users\isaac>cabal --version
cabal-install version 1.24.0.2
compiled using version 1.24.2.0 of the Cabal library
All of this has been just to get Cairo working (on Windows).

cabal update fails to download the archive file

I upgraded my Haskell platform to and copied the new cabal binary to my ~/.cabal/bin folder in my MacOS.
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.10.1
$ cabal --version
cabal-install version 1.22.2.0
using version 1.22.2.0 of the Cabal library
Now, when I try to update the package list, I get the following error:
$ cabal update
Downloading the latest package list from hackage.haskell.org
cabal: Failed to download
http://hackage.haskell.org/packages/archive/00-index.tar.gz : ErrorMisc "Error
HTTP code: 400"
I can download the 00-index.tar.gz file using my browser, but cabal fails to download it. What can be the problem?

Exit Code 11 installing Persistent (Yesod)

I'm trying to install Yesod on my Mac (running Mavericks), but installation fails because of an error installing Persistent. Specifically, cabal install persistent yields:
Failed to install persistent-1.3.0.2
Updating documentation index /Users/Max/Library/Haskell/doc/index.html
cabal: Error: some packages failed to install:
persistent-1.3.0.2 failed during the building phase. The exception was:
ExitFailure 11
(The full output is available as a gist)
I don't think this is an issue with conflicts, because I ran rm -rf ~/.ghc ~/.cabal before trying this (though I think 3 globally installed packages might not have been erased—unsure).
I'm using the latest Haskell Platform with the ghc-clang-wrapper script.
Cabal versions:
$ cabal --version
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library
GHC version:
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3
Reinstalling Haskell platform allowed me to install Persistent, but the real issue was that I needed to install gcc48. Installing this cleared everything up. https://stackoverflow.com/a/21285413/1176156

runhaskell Setup install Setup error

I am trying to install packages from haskell's Hackage using Cabal.
In particular, I am trying to download the gloss package:
cabal install gloss
Comes up with this error:
binary-0.7.1.0 failed during the building phase.
The exception was:
ExitFailure 1
bmp-1.2.5.2 depends on binary-0.7.1.0 which failed to install.
gloss-1.8.1.1 depends on binary-0.7.1.0 which failed to install.
I also tried binary-0.6.0.0. Because cabal install is not working, I am trying:
runhaskell Setup configure
runhaskell Setup build
runhaskell Setup install
...in the directory of the package, and I get the same error for every package:
Setup: Error: Could not find module: Data.Binary with any suffix: ["hi"] in
the search path: ["dist/build"]
I am also having trouble installing the newest version of Cabal.
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library
The Glorious Glasgow Haskell Compilation System, version 7.6.3
Mac OSX 10.8 on MacBook Pro Retina
The binary package fails to install on latest versions of osx because osx uses clang instead of gcc, and 'gcc' is usually just a symlink to clang. gcc is used in the pre-processor stage (haskell supports c-like macros) but clang does not support all the features for the pre-processor stage that gcc supports.
To know if this is your problem, type 'gcc' in the terminal. If it says 'clang' somewhere, then this is the issue.
The solution is to get gcc, and replace the symlink to gcc with real gcc. Using 'runhaskell' will still have the same issue. For the most part, you should never try to install packages without cabal, it is by far the easiest way.
This is not an answer.
If you have downloaded package binary-0.7.1.0, you can untar it first, and go into that folder, and run
cabal configure
cabal build
cabal install
There must be more error message, such as line number, but I didn't see it.

Cabal can't determine GHC version

I am currently trying to update Cabal (1.14.0, cabal-install at version 0.14.0) by doing
cabal install cabal-install
However, this gives me an ExitFailure1 with the error
setup: The program ghc version >=6.4 is required but the
version of /usr/bin/ghc could not be determined.
But I'm definitely running a version of GHC that is greater than that.
$ /usr/bin/ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.2
It might be important that I'm on OSX 10.8 and that I installed Haskell through the Haskell Platform download for Mac.
Does anyone have advice on how to fix or work around this issue? I haven't been able to find any documentation on this problem.
Since you're on a Mac, why not try installing the excellent Homebrew package manager? Add /usr/local/bin to your PATH, and then it's just brew install cabal-install.
You can even brew install ghc haskell-platform.
To upgrade the package list, use brew upgrade, then you can see what needs updating with brew outdated and update them with brew update.
Of course, you can name individual packages to update also, and specify versions of packages. Homebrew keeps the "recipes" (Ruby scripts) for package management in its own git repository (by default in /usr/local).
Then you can get on with what you really wanted to do in the first place...write some code! (or build, in your case)

Resources