(alpha) "stick shift" cabal install for GHC 6.12.1
bayer at cpw.math.columbia.edu
Thu Dec 17 17:00:22 EST 2009
I wrote the barest possible python script this morning as a poor-man's replacement for "cabal install".
Here is the script "cabal-install.py" and a sample use, "GLUT-188.8.131.52-install.sh" :
I copy "cabal-install.py" to "/usr/local/bin/cabal-install", and set the environment variable $CABAL to a directory of package sources which I manually download and maintain. For example, on my Mac OS X 10.6,
% echo $CABAL; cd $CABAL; ls -l GLUT-184.108.40.206
drwxr-xr-x 11 dave admin 374 Dec 17 12:47 GLUT-220.127.116.11
-rwxr-xr-x@ 1 dave admin 165 Dec 17 12:20 GLUT-18.104.22.168-install.sh
-rw-r--r-- 1 dave admin 650235 Oct 26 14:12 GLUT-22.214.171.124.tar.gz
-rw-r--r--@ 1 dave admin 92 Dec 17 13:33 HackageDB- GLUT-126.96.36.199.webloc
"cabal-install.py" looks for package directories by exact name, including version numbers. It skips packages that are already installed, and stops on any error. My typical workflow is to edit the corresponding "install.sh" until I get the list and order of dependent packages right.
This is an alpha version; the code itself is clearer than my documentation here. If you thought about writing this and didn't yet, and can read my code, then you may want to experiment with this script. It surely got me unstuck on getting my projects to run under GHC 6.12.1. Any comments are welcome, as are suggestions for how to better share this script.
Background: I never got "cabal install" to work on OS X 10.5 with GHC 6.10.4, basically because zlib wouldn't work. Odd, because a perfectly good version of gunzip already exists on most platforms, and the code doesn't fall back to this version if needed.
Back when a bunch of libraries came with GHC, I didn't mind manually adding the few extra libraries I needed. Nevertheless, I tried to get "cabal install" working with OS X 10.6 and GHC 6.10.4, and again hit the zlib issue. Realizing I was a bad boy for not reporting the bug, I set up some Apple Software Restore images so I could quickly create sandbox development startup volumes, in hopes of isolating the problem.
Meanwhile, GHC 6.12.1 was released. Far fewer standard libraries made "cabal install" more critical, yet a compatible version hadn't been released. I darc'd the development head, but ran into other troubles.
There's clearly something wrong with this picture. A Rorschach blot test as to what's wrong, but I see people overreaching, if I have to wait weeks for a simple install tool, then months for the Haskell Platform to be ready. So I wrote something simpler. Not automatic, but a lot faster than installing by hand. Now I've made my peace with the GHC team's decision to get out of the library business.
More information about the Glasgow-haskell-users