Cabal Compiler Flag Problem

Hi, I'm trying to install the Haskell cgi module, as per here http://passingcuriosity.com/2009/haskell-fastcgi-with-apache/. When I type cabal install cgi, I get the following error (on a Fedora instance): cabal install cgi Resolving dependencies... Configuring MonadCatchIO-mtl-0.3.0.0... Preprocessing library MonadCatchIO-mtl-0.3.0.0... Building MonadCatchIO-mtl-0.3.0.0... [1 of 1] Compiling Control.Monad.CatchIO ( Control/Monad/CatchIO.hs, dist/build/Control/Monad/CatchIO.o ) Control/Monad/CatchIO.hs:146:34: Illegal signature in pattern: E.SomeException Use -XPatternSignatures to permit it cabal: Error: some packages failed to install: MonadCatchIO-mtl-0.3.0.0 failed during the building phase. The exception was: exit: ExitFailure 1 cgi-3001.1.8 depends on MonadCatchIO-mtl-0.3.0.0 which failed to install. So, I modified my /root/.cabal/config with: -- flags: -XPatternSignatures This doesn't seem to resolve the problem. What do I need to do to change the compiler flags? Thanks, Ben

On 24 March 2010 16:26, Ben Derrett
cabal install cgi Resolving dependencies... Configuring MonadCatchIO-mtl-0.3.0.0... Preprocessing library MonadCatchIO-mtl-0.3.0.0... Building MonadCatchIO-mtl-0.3.0.0... [1 of 1] Compiling Control.Monad.CatchIO ( Control/Monad/CatchIO.hs, dist/build/Control/Monad/CatchIO.o ) Control/Monad/CatchIO.hs:146:34: Illegal signature in pattern: E.SomeException
Interesting.... the code is obviously using extensible-exceptions but it doesn't seem to work. What version of GHC are you using?
Use -XPatternSignatures to permit it cabal: Error: some packages failed to install: MonadCatchIO-mtl-0.3.0.0 failed during the building phase. The exception was: exit: ExitFailure 1 cgi-3001.1.8 depends on MonadCatchIO-mtl-0.3.0.0 which failed to install. So, I modified my /root/.cabal/config with: -- flags: -XPatternSignatures
Nah, that's a GHC flag not a Cabal/cabal-install flag, so you'd have to edit the .cabal file to add that in (where it says ghc-options). -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

Thank you. I'm using GHC 6.8.2. I can't see ghc-options in the file
/root/.cabal/config, am I looking in the right place?
Ben
On Wed, Mar 24, 2010 at 1:30 AM, Ivan Miljenovic
On 24 March 2010 16:26, Ben Derrett
wrote: cabal install cgi Resolving dependencies... Configuring MonadCatchIO-mtl-0.3.0.0... Preprocessing library MonadCatchIO-mtl-0.3.0.0... Building MonadCatchIO-mtl-0.3.0.0... [1 of 1] Compiling Control.Monad.CatchIO ( Control/Monad/CatchIO.hs, dist/build/Control/Monad/CatchIO.o ) Control/Monad/CatchIO.hs:146:34: Illegal signature in pattern: E.SomeException
Interesting.... the code is obviously using extensible-exceptions but it doesn't seem to work. What version of GHC are you using?
Use -XPatternSignatures to permit it cabal: Error: some packages failed to install: MonadCatchIO-mtl-0.3.0.0 failed during the building phase. The exception was: exit: ExitFailure 1 cgi-3001.1.8 depends on MonadCatchIO-mtl-0.3.0.0 which failed to install. So, I modified my /root/.cabal/config with: -- flags: -XPatternSignatures
Nah, that's a GHC flag not a Cabal/cabal-install flag, so you'd have to edit the .cabal file to add that in (where it says ghc-options).
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com
-- Ben Derrett Department of Mathematics MIT Class of 2012 bderrett@mit.edu

On 24 March 2010 16:52, Ben Derrett
Thank you. I'm using GHC 6.8.2.
That shouldn't be a problem.... Unless, of course, that syntax (it's using \e::E.SomeException) is valid in GHC >= 6.10 but not previously (in which case I would think that that's a bug).
I can't see ghc-options in the file /root/.cabal/config, am I looking in the right place?
No, I meant the package's .cabal file:
cabal unpack MonadCatchIO-mtl
cd MonadCatchIO-mtl-<version>

On Wed, 24 Mar 2010, Ben Derrett wrote:
Control/Monad/CatchIO.hs:146:34: Illegal signature in pattern: E.SomeException Use -XPatternSignatures to permit it
A fix is to avoid using a pattern signature in Control/Monad/CatchIO.hs: -onException a onEx = a `catch` (\(e::E.SomeException) -> onEx >> throw e) +onException a onEx = a `catch` \e -> onEx >> throw (e :: E.SomeException) I reported this to the MonadCatchIO-mtl maintainer a few days ago; hopefully it will be fixed soon. (I’ve CCed him as a reminder.) Meanwhile, you can use cgi-3001.1.7.3, which does not require MonadCatchIO-mtl. Anders
participants (3)
-
Anders Kaseorg
-
Ben Derrett
-
Ivan Miljenovic