[ 
https://issues.apache.org/jira/browse/THRIFT-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913708#action_12913708
 ] 

Christian Lavoie commented on THRIFT-914:
-----------------------------------------

> It does seem to compile fine with 6.12.3 from homebrew (even without 
> THRIFT-743, any idea why that is the case?).

Yes -- see my comments above about -glasgow-exts and -XArrows.

To recap:

# ghc 6.11.something (development version) introduced the -XArrows flag (and 
the matching Arrows haskell language extension) which reserves identifiers 
'proc' and 'rec' as keywords.
# -fglasgow-exts is a ghc flag that enables all glasgow (==ghc) haskell 
extensions (including -XArrows)
# Before my patches THRIFT-901 (recently commited by Bryan Duxbury) and 
THRIFT-914 (this very JIRA issue) the Thrift bindings required -fglasgow-exts
# Because of stuff like #1, releasing general libraries that require 
-fglasgow-exts is a suboptimal situation -- as is the case here, new extensions 
have the nasty habit of clashing with older codebases

When ghc 6.12 came out, Thrift stopped compiling without my patches or without 
THRIFT-743. Now THRIFT-743 is only required IFF you want to use both thrift and 
the Arrows extension. If you don't want or use Arrows (or ghc 6.12), it's 
redundant but entirely harmless.

So the full state matrix is:

1) Before my patches and before THRIFT-743

# Thrift passes -fglasgow-exts to ghc
# Thrift and thrift-compiler generated code would compile with ghc 6.10 (and 
probably any earlier ghc6 version, but I have not tested this)
# Thrift would NOT compile with ghc 6.12
# Thrift-compiler generated code would NOT compile if your build system passed 
-XArrows (this is my case and how I got started on this path) or -fglasgow-exts 
(which implicitly turns on -XArrows; and probably was Martin's case)

2) After my patches but before THRIFT-743

# Thrift does NOT pass -fglasgow-exts (or any of the extension flags anywhere, 
but rather turns them on individually as pragmas, for maximum compatibility 
with random build scripts)
# Thrift would compile in all cases (except if you somehow forced 
-fglasgow-exts or -XArrows to the ghc invokation compiling thrift itself)
# The thrift-compiler generated code would NOT compile if your build system 
passed -XArrows to GHC when trying to build the generated code (this is still 
my case)
# The thrift compiler generated code will compile in all other cases 
(including, if I read you correctly, your current situation)

3) After my patches and after THRIFT-743

# Both the thrift/lib/hs/src/... code and the thrift-compiler generated code 
will compile in all cases (except, apparently, with your homebrew haskell 
platform, see below for my thoughts on that -- it is, I believe, a completely 
unrelated issue)

> Do you have any idea what could be causing this failure?

Bug in GHC, is my gut feeling; specifically, in the evil mangler: 
http://hackage.haskell.org/trac/ghc/wiki/Commentary/EvilMangler). Try making 
sure your homebrew version is using ghc's native code backend just for fun; or 
use a different version of perl (no, seriously, see 
http://www.mail-archive.com/cvs-...@haskell.org/msg02780.html for an example 
bug caused by perl version).

You could always attach the .s file, but I haven't played with x86 assembly in 
about a decade, and never with ghc's internals (evil mangler or not). Not sure 
I can do much there.

I asked, there seems to be general consensus in the haskell irc channel that 
macports' ghc is particularly sensitive to perl versions.

> Make haskell bindings 'easily' compilable
> -----------------------------------------
>
>                 Key: THRIFT-914
>                 URL: https://issues.apache.org/jira/browse/THRIFT-914
>             Project: Thrift
>          Issue Type: Bug
>          Components: Haskell - Compiler, Haskell - Library
>    Affects Versions: 0.5
>         Environment: GHC 6.12.3, Mac OS X 10.6, Haskell Platform 2010.2.0.0
> Darwin -- 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; 
> root:xnu-1504.7.4~1/RELEASE_I386 i386
> The Glorious Glasgow Haskell Compilation System, version 6.12.3
>            Reporter: Christian Lavoie
>            Assignee: Anthony Molinaro
>             Fix For: 0.5
>
>         Attachments: v1-thrift-fix-cabal-Setup.patch
>
>
> Current Setup.lhs file has weird commenting that barfs on my machine (Haskell 
> does not use # as a comment marker). Also, after much recent mungling from me 
> the .cabal file is out of date.
> This patch fixes both issues, making it easy to test the haskell bindings 
> compilability state:
> {noquote}
> cabal update
> cabal install network binary http
> cd $THRIFT/lib/hs/src
> runhaskell Setup.lhs configure --user # --user is optional, but you'll need 
> root-like powers without it
> runhaskell Setup.lhs build
> runhaskell Setup.lhs install # optional, really
> {noquote}
> Also, with the recent commit of the improved type bindings, it's worth 
> bumping the thrift cabal package's version number -- that change was major 
> API breakage.
> (Please note this does NOT integrate with autotools in any useful way, but is 
> a prerequisite for THRIFT-905 to be useful)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to