
The other day, I did a slightly foolish thing. I uttered the command cabal install gitit Actually, while I was "foolish", it actually worked better than you'd think. It wanted to install several thousand billion packages, but all of them compiled without issue. Well, all except one. You see, for reasons that I have yet to determine, cabal is *convinced* that gitit transitively requires the "unix" package. Astonishingly, this doesn't work on Windows. :-P Question: Why does 90% of the network-related stuff on Hackage require the unix package? What's in there that's so network-related? I don't understand. We've *got* a portable "network" package that works on all platforms, so...? Anyway, on further investigation, it appears that the culprit is "cautious-file". If a certain CPP flag it set, "unix" gets added to the Build-Depends: field. Except... I didn't set any CPP flags! What the hell? So I manually edit the package description (!), and now it builds and installs perfectly happily. So now I tell cabal to install gitit again... and it immediately tries to install unix, even though the only package that (it thinks) requires unix is already installed? Wuh? So I unpack gitit and tell cabal to build it. Building takes about 30 seconds. *Linking* takes about 4 minutes (??!) And then it fails due to some missing symbols. (No, I don't remember off the top of my head what they were.) At this point, I am completely lost. Does anybody have any ideas on how I can make GitIt work, short of installing Linux? I've searched and searched and I can't see a pre-built binary anywhere.

Two possible fixes come to mind:
1) In the .cabal file for cautious-file, it says:
Flag posix
description: Use POSIX-specific features
default: True
You can use "cabal install -fposix cautious-file" to explicitly turn
on POSIX support, and "cabal install -f-posix cautious-file" to
explicitly turn it off. (From above, the default is the former.)
So you can probably get this working with:
cabal install cautious-file -f-posix; cabal install gitit
Incidentally, it would be better for the .cabal file to detect that
automatically with "if os(windows)", as e.g. Haskeline does.
2) If you have a local, edited installation of a package with the same
version number as the one on Hackage, then it seems to confuse "cabal
install". (This may be a bug; I'm not sure.) Workaround is to bump
the version in your local installation, e.g. from 0.1.5 to
0.1.5.0.0.0.1.; then "cabal install" won't try to rebuild it.
Hope that helps,
-Judah
On Fri, Nov 19, 2010 at 12:20 PM, Andrew Coppin
The other day, I did a slightly foolish thing. I uttered the command
cabal install gitit
Actually, while I was "foolish", it actually worked better than you'd think. It wanted to install several thousand billion packages, but all of them compiled without issue.
Well, all except one. You see, for reasons that I have yet to determine, cabal is *convinced* that gitit transitively requires the "unix" package. Astonishingly, this doesn't work on Windows. :-P
Question: Why does 90% of the network-related stuff on Hackage require the unix package? What's in there that's so network-related? I don't understand. We've *got* a portable "network" package that works on all platforms, so...?
Anyway, on further investigation, it appears that the culprit is "cautious-file". If a certain CPP flag it set, "unix" gets added to the Build-Depends: field. Except... I didn't set any CPP flags! What the hell?
So I manually edit the package description (!), and now it builds and installs perfectly happily. So now I tell cabal to install gitit again... and it immediately tries to install unix, even though the only package that (it thinks) requires unix is already installed? Wuh?
So I unpack gitit and tell cabal to build it. Building takes about 30 seconds. *Linking* takes about 4 minutes (??!) And then it fails due to some missing symbols. (No, I don't remember off the top of my head what they were.)
At this point, I am completely lost. Does anybody have any ideas on how I can make GitIt work, short of installing Linux? I've searched and searched and I can't see a pre-built binary anywhere.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On 19/11/2010 08:32 PM, Judah Jacobson wrote:
Two possible fixes come to mind:
1) In the .cabal file for cautious-file, it says:
Flag posix description: Use POSIX-specific features default: True
Ah. I hadn't seen this bit. Yes, what's probably happened is that I altered the build dependencies, but the CPP flag was still turned on by default, resulting in a borked binary being built.
You can use "cabal install -fposix cautious-file" to explicitly turn on POSIX support, and "cabal install -f-posix cautious-file" to explicitly turn it off. (From above, the default is the former.)
Right. Yes, if I explicitly turn off POSIX support, that'll probably fix it. (I didn't know what the correct flag was to do that.)
Incidentally, it would be better for the .cabal file to detect that automatically with "if os(windows)", as e.g. Haskeline does.
Tell it to whoever maintains cautious-file. ;-)
2) If you have a local, edited installation of a package with the same version number as the one on Hackage, then it seems to confuse "cabal install". (This may be a bug; I'm not sure.)
It sure sounds like a bug to me... (And presumably a bug specifically with cabal-install, not the cabal library itself?)
Workaround is to bump the version in your local installation, e.g. from 0.1.5 to 0.1.5.0.0.0.1.; then "cabal install" won't try to rebuild it.
Ooo, yeah, but only if the package depending on cautious-file doesn't exactly pin down the required version number. ;-)
Hope that helps, -Judah
Yes, I think I know how to fix this now. PS. You have *no idea* how many different MD5 implementations I saw being compiled during this exercise...!
participants (2)
-
Andrew Coppin
-
Judah Jacobson