Alex requirement for Setup.lhs

Dear all, Hopefully, you will excuse me for my lack of experience with Cabal. I have seen quite a few e-mails on this list that seem related to this issue, but my specific error, I did not find. Thus: Since installing 6.10.1, I can't perform Setup.(l)hs functions. The error message I get is: Setup.hs: alex is required but it could not be found. The problem is that I get this error also when I try to "runghc Setup.lhs build" alex (is the fact that "runghc Setup.lhs configure" does *not* produce this error significant?). I'm running an OpenSuSE 10.3 installation on which I can only install rpms from standard repositories. In these repositories, there is no binary distribution of alex. How do I install alex from source without requiring alex? Regards, Philip

On Tue, Dec 02, 2008 at 01:56:03PM +0100, Philip K.F. Hölzenspies wrote:
Setup.hs: alex is required but it could not be found.
The problem is that I get this error also when I try to "runghc Setup.lhs build" alex
If you have downloaded the source tarball then the preprocessed files are included. Cabal may be getting confused by the .x files also being present, so rm src/Scan.x should fix it. You may also need to rm src/Parser.y if you don't have happy. Thanks Ian

On Thursday 04 December 2008 00:11:13 Ian Lynagh wrote:
If you have downloaded the source tarball then the preprocessed files are included. Cabal may be getting confused by the .x files also being present, so rm src/Scan.x should fix it. You may also need to rm src/Parser.y if you don't have happy.
Dear Ian, all, Thank you for your tip, Ian. Deleting src/Scan.x did do the trick. However, I get a very strange type error when I try to compile alex 2.2. Maybe someone knows what's going on here: [16 of 16] Compiling Main ( src/Main.hs, dist/build/alex/alex-tmp/Main.o ) src/Main.hs:316:25: Ambiguous type variable `e' in the constraint: `GHC.Exception.Exception e' arising from a use of `throw' at src/Main.hs:316:25-31 Probable fix: add a type signature that fixes these type variable(s) Lines 314 through 316 in src/Main.hs are: r <- Exception.catch (unblock (thing a)) (\e -> do { after a; throw e }) I guess the error in itself makes some sense, because throw can not be resolved without knowing a concrete instance of e. I just don't get why I get this error in a release version of alex; I would imagine other people do not get this error. What am I missing? Regards, Philip

On Thursday 04 December 2008 14:24:32 Philip K.F. Hölzenspies wrote:
[16 of 16] Compiling Main ( src/Main.hs, dist/build/alex/alex-tmp/Main.o )
src/Main.hs:316:25: Ambiguous type variable `e' in the constraint: `GHC.Exception.Exception e' arising from a use of `throw' at src/Main.hs:316:25-31 Probable fix: add a type signature that fixes these type variable(s)
Lines 314 through 316 in src/Main.hs are:
r <- Exception.catch (unblock (thing a)) (\e -> do { after a; throw e })
I guess the error in itself makes some sense, because throw can not be resolved without knowing a concrete instance of e. I just don't get why I get this error in a release version of alex; I would imagine other people do not get this error. What am I missing?
Dear Ian, all, Please ignore my previous e-mail. It must have been a remainder from an earlier failed build attempt. I just did a checkout from the alex darcs repository, which built without a hitch. Regards, Philip
participants (2)
-
Ian Lynagh
-
Philip K.F. Hölzenspies