vincenthz / hs-cryptohash-cryptoapi

cryptohash instances for cryptoapi
Other
1 stars 5 forks source link

Failed to build 0.1.2 on Mac OS X #3

Closed snakamura closed 10 years ago

snakamura commented 10 years ago

When I tried to build 0.1.2 on Mac OS X, I got these errors. It seems that it's something to do with clang problem, but do you have any idea to solve this?

I use ghc-7.6.3 with http://www.haskell.org/platform/ghc-clang-wrapper on Mac OS X 10.8.5 and Xcode 5.1.

Note that I can build 0.1.1 on the same environment.

Building cryptohash-cryptoapi-0.1.2...
Preprocessing library cryptohash-cryptoapi-0.1.2...
[1 of 1] Compiling Crypto.Hash.CryptoAPI ( Crypto/Hash/CryptoAPI.hs, dist/build/Crypto/Hash/CryptoAPI.o )

Crypto/Hash/CryptoAPI.hs:119:352:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:119:359: Not in scope: `MODULENAME.hash'

Crypto/Hash/CryptoAPI.hs:119:388:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:119:395:
    Not in scope: `MODULENAME.hashlazy'

Crypto/Hash/CryptoAPI.hs:119:440:
    Not in scope: type constructor or class `NAME'

Crypto/Hash/CryptoAPI.hs:119:477:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:119:497:
    Not in scope: data constructor `OUTPUTLEN'

Crypto/Hash/CryptoAPI.hs:119:518:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:119:569:
    Not in scope: type constructor or class `CTXNAME'

Crypto/Hash/CryptoAPI.hs:119:629:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:119:639:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:119:668:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:119:677:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:120:352:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:120:359: Not in scope: `MODULENAME.hash'

Crypto/Hash/CryptoAPI.hs:120:388:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:120:395:
    Not in scope: `MODULENAME.hashlazy'

Crypto/Hash/CryptoAPI.hs:120:440:
    Not in scope: type constructor or class `NAME'

Crypto/Hash/CryptoAPI.hs:120:477:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:120:497:
    Not in scope: data constructor `OUTPUTLEN'

Crypto/Hash/CryptoAPI.hs:120:518:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:120:569:
    Not in scope: type constructor or class `CTXNAME'

Crypto/Hash/CryptoAPI.hs:120:629:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:120:639:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:120:668:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:120:677:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:121:352:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:121:359: Not in scope: `MODULENAME.hash'

Crypto/Hash/CryptoAPI.hs:121:388:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:121:395:
    Not in scope: `MODULENAME.hashlazy'

Crypto/Hash/CryptoAPI.hs:121:440:
    Not in scope: type constructor or class `NAME'

Crypto/Hash/CryptoAPI.hs:121:477:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:121:497:
    Not in scope: data constructor `OUTPUTLEN'

Crypto/Hash/CryptoAPI.hs:121:518:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:121:569:
    Not in scope: type constructor or class `CTXNAME'

Crypto/Hash/CryptoAPI.hs:121:629:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:121:639:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:121:668:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:121:677:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:123:368:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:123:375: Not in scope: `MODULENAME.hash'

Crypto/Hash/CryptoAPI.hs:123:404:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:123:411:
    Not in scope: `MODULENAME.hashlazy'

Crypto/Hash/CryptoAPI.hs:123:456:
    Not in scope: type constructor or class `NAME'

Crypto/Hash/CryptoAPI.hs:123:493:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:123:513:
    Not in scope: data constructor `OUTPUTLEN'

Crypto/Hash/CryptoAPI.hs:123:534:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:123:585:
    Not in scope: type constructor or class `CTXNAME'

Crypto/Hash/CryptoAPI.hs:123:645:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:123:655:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:123:684:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:123:693:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:125:400:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:125:407: Not in scope: `MODULENAME.hash'

Crypto/Hash/CryptoAPI.hs:125:436:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:125:443:
    Not in scope: `MODULENAME.hashlazy'

Crypto/Hash/CryptoAPI.hs:125:488:
    Not in scope: type constructor or class `NAME'

Crypto/Hash/CryptoAPI.hs:125:525:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:125:545:
    Not in scope: data constructor `OUTPUTLEN'

Crypto/Hash/CryptoAPI.hs:125:566:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:125:617:
    Not in scope: type constructor or class `CTXNAME'

Crypto/Hash/CryptoAPI.hs:125:677:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:125:687:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:125:716:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:125:725:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:126:400:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:126:407: Not in scope: `MODULENAME.hash'

Crypto/Hash/CryptoAPI.hs:126:436:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:126:443:
    Not in scope: `MODULENAME.hashlazy'

Crypto/Hash/CryptoAPI.hs:126:488:
    Not in scope: type constructor or class `NAME'

Crypto/Hash/CryptoAPI.hs:126:525:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:126:545:
    Not in scope: data constructor `OUTPUTLEN'

Crypto/Hash/CryptoAPI.hs:126:566:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:126:617:
    Not in scope: type constructor or class `CTXNAME'

Crypto/Hash/CryptoAPI.hs:126:677:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:126:687:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:126:716:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:126:725:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:127:401:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:127:408: Not in scope: `MODULENAME.hash'

Crypto/Hash/CryptoAPI.hs:127:437:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:127:444:
    Not in scope: `MODULENAME.hashlazy'

Crypto/Hash/CryptoAPI.hs:127:489:
    Not in scope: type constructor or class `NAME'

Crypto/Hash/CryptoAPI.hs:127:526:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:127:546:
    Not in scope: data constructor `OUTPUTLEN'

Crypto/Hash/CryptoAPI.hs:127:567:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:127:618:
    Not in scope: type constructor or class `CTXNAME'

Crypto/Hash/CryptoAPI.hs:127:678:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:127:688:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:127:717:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:127:726:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:128:401:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:128:408: Not in scope: `MODULENAME.hash'

Crypto/Hash/CryptoAPI.hs:128:437:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:128:444:
    Not in scope: `MODULENAME.hashlazy'

Crypto/Hash/CryptoAPI.hs:128:489:
    Not in scope: type constructor or class `NAME'

Crypto/Hash/CryptoAPI.hs:128:526:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:128:546:
    Not in scope: data constructor `OUTPUTLEN'

Crypto/Hash/CryptoAPI.hs:128:567:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:128:618:
    Not in scope: type constructor or class `CTXNAME'

Crypto/Hash/CryptoAPI.hs:128:678:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:128:688:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:128:717:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:128:726:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:130:448:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:130:455: Not in scope: `MODULENAME.hash'

Crypto/Hash/CryptoAPI.hs:130:484:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:130:491:
    Not in scope: `MODULENAME.hashlazy'

Crypto/Hash/CryptoAPI.hs:130:536:
    Not in scope: type constructor or class `NAME'

Crypto/Hash/CryptoAPI.hs:130:573:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:130:593:
    Not in scope: data constructor `OUTPUTLEN'

Crypto/Hash/CryptoAPI.hs:130:614:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:130:665:
    Not in scope: type constructor or class `CTXNAME'

Crypto/Hash/CryptoAPI.hs:130:725:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:130:735:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:130:764:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:130:773:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:131:384:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:131:391: Not in scope: `MODULENAME.hash'

Crypto/Hash/CryptoAPI.hs:131:420:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:131:427:
    Not in scope: `MODULENAME.hashlazy'

Crypto/Hash/CryptoAPI.hs:131:472:
    Not in scope: type constructor or class `NAME'

Crypto/Hash/CryptoAPI.hs:131:509:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:131:529:
    Not in scope: data constructor `OUTPUTLEN'

Crypto/Hash/CryptoAPI.hs:131:550:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:131:601:
    Not in scope: type constructor or class `CTXNAME'

Crypto/Hash/CryptoAPI.hs:131:661:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:131:671:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:131:700:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:131:709:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:132:448:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:132:455: Not in scope: `MODULENAME.hash'

Crypto/Hash/CryptoAPI.hs:132:484:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:132:491:
    Not in scope: `MODULENAME.hashlazy'

Crypto/Hash/CryptoAPI.hs:132:536:
    Not in scope: type constructor or class `NAME'

Crypto/Hash/CryptoAPI.hs:132:573:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:132:593:
    Not in scope: data constructor `OUTPUTLEN'

Crypto/Hash/CryptoAPI.hs:132:614:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:132:665:
    Not in scope: type constructor or class `CTXNAME'

Crypto/Hash/CryptoAPI.hs:132:725:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:132:735:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:132:764:
    Not in scope: data constructor `CTXNAME'

Crypto/Hash/CryptoAPI.hs:132:773:
    Not in scope: data constructor `MODULENAME.Ctx'

Crypto/Hash/CryptoAPI.hs:134:483:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:134:490: Not in scope: `MODULENAME.hash'

Crypto/Hash/CryptoAPI.hs:134:506:
    Not in scope: data constructor `OUTPUTLEN'

Crypto/Hash/CryptoAPI.hs:134:529:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:134:536:
    Not in scope: `MODULENAME.hashlazy'

Crypto/Hash/CryptoAPI.hs:134:556:
    Not in scope: data constructor `OUTPUTLEN'

Crypto/Hash/CryptoAPI.hs:134:591:
    Not in scope: type constructor or class `NAME'

Crypto/Hash/CryptoAPI.hs:134:628:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:134:648:
    Not in scope: data constructor `OUTPUTLEN'

Crypto/Hash/CryptoAPI.hs:134:669:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:135:483:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:135:490: Not in scope: `MODULENAME.hash'

Crypto/Hash/CryptoAPI.hs:135:506:
    Not in scope: data constructor `OUTPUTLEN'

Crypto/Hash/CryptoAPI.hs:135:529:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:135:536:
    Not in scope: `MODULENAME.hashlazy'

Crypto/Hash/CryptoAPI.hs:135:556:
    Not in scope: data constructor `OUTPUTLEN'

Crypto/Hash/CryptoAPI.hs:135:591:
    Not in scope: type constructor or class `NAME'

Crypto/Hash/CryptoAPI.hs:135:628:
    Not in scope: data constructor `NAME'

Crypto/Hash/CryptoAPI.hs:135:648:
    Not in scope: data constructor `OUTPUTLEN'

Crypto/Hash/CryptoAPI.hs:135:669:
    Not in scope: data constructor `NAME'
nominolo commented 10 years ago

The problem is that the Clang preporcessor does not deal well with ' in macro. In this instance it stops expanding the macro parameters after the occurrence of hash' =. I don't know if there are some Clang CPP flags to make this work. Alternatively, the source tarball could include pre-processed files.

snakamura commented 10 years ago

I found that I could build it with cpphs. Just added this pragma and it built.

{-# OPTIONS_GHC -pgmP cpphs -optP --cpp #-}

Is it acceptable for you to depend on cpphs?

vincenthz commented 10 years ago

@TomMD: Do you have an opinion about this ?

personally I would recommend using Crypto.Hash (from cryptohash) directly to solve the problem :-)

TomMD commented 10 years ago

My knee-jerk reaction is that forcing cpphs is an acceptable short term solution. That or including post-processed filed in the distribution. The alternative is to select a naming scheme based on what a C preprocessor can handle and that just seems backwards.

vincenthz commented 10 years ago

I think I'm more inclined toward distributing the post-processed file directly than depending on cpphs.

nominolo commented 10 years ago

Yes, including it with the distribution is common practice for things like generated parsers and lexers. This means only the package developers needs to have a reliable setup/workaround (e.g., in this case using cpphs if the developer is on Mac with Xcode 5).

geraldus commented 10 years ago

Having the same problem with GHC-7.8.1-RC2 on OS X 10.9.2 with XCode 5.1. I'm sorry, but I didn't understand is there some solution?

dmjio commented 10 years ago

Having same issue as well. Is there a solution where I don't have to clone the package to fix it?

geraldus commented 10 years ago

This issue is related to XCode 5. It is possible to install GCC 4.7 and make GHC to use it. But I used another way: I've installed Yesod (in my case cryptohash-cryptoapi is dependency of Yesod) with constraint: cabal install --only-dependencies --constraint=cryptohash-cryptoapi==1.1.1

snakamura commented 10 years ago

Now I can build it with Xcode 5.1 on Mac OS X. Thanks!