Question

Here is what cabal update outputs:

Downloading the latest package list from hackage.haskell.org
cabal: out of memory (requested 2097152 bytes)

The reason may be shortage of memory. What about tail 00-index.cache?

pkg: charade 0.1 b# 46384
pkg: charset 0.0 b# 46390
pkg: charset 0.1 b# 46393
pkg: charset 0.2.0 b# 46396
pkg: charset 0.2.1 b# 46399
pkg: charset 0.2.2 b# 46402
pkg: charset 0.2.3 b# 46405
pkg: charset 0.3 b# 46408
pkg: charset 0.3.0.1 b# 46412

I can have 00-index.tar.gz downloaded easily and have 00-index.tar untared. However, because of out of memory, I cannot generate the cache file! Can cabal generate 00-index.cache locally in an cheap way?

cabal --version

cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library

No correct solution

OTHER TIPS

I ran into a similar problem running a micro instance on AWS (not running cabal update, but compiling my own program). I followed the suggestions in this link to create a swap space and it did the trick.

From the link:

> dd if=/dev/zero of=/tmp/swap bs=1M count=1024
> mkswap /tmp/swap
> swapon /tmp/swap

The dd command creates a swap file with the name “swap” under the /tmp directory with a size of 1024MB (1GB).

Make this file as a swap file using the mkswap command.

Enable the newly created swapfile using the swapon command.

This link has more information about swap spaces.

You can just put 00-index.cache in the appropriate place, and cabal-install will use it just fine. To find out where to put it, look at the value of remote-repo-cache and remote-repo in ~/.cabal/config; the cache should go in a directory named after the remote repo's nick inside the remote-repo-cache directory. For example, here's a snippet of my config:

remote-repo: hackage.haskell.org:http://hackage.haskell.org/packages/archive
remote-repo-cache: /home/dmwit/.cabal/packages

and my cache is in /home/dmwit/.cabal/packages/hackage.haskell.org/00-index.cache.

Try adding more memory to the machine on which you're running cabal update.

I once was trying to install GHC and compile some Haskell on a DigitalOcean bottom-tier server, and compilation always failed due to the lack of available RAM. Trying again on a more well-equipped server fixed the issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top