silkapp / rest

Packages for defining APIs, running them, generating client code and documentation.
http://silkapp.github.io/rest
390 stars 52 forks source link

update rest-example.cabal for ghc 8 support #149

Closed cnd closed 8 years ago

hesselink commented 8 years ago

Did you actually get it to build (including all executables)? I tried something similar but lots of dependent libraries hadn't been updated yet.

Also, it's fine to raise the time upper bound to 1.7 instead of 1.6.1.

cnd commented 8 years ago
F:\P\thridparty\rest\rest-example>cabal build
Building rest-example-0.2.0.4...
Preprocessing library rest-example-0.2.0.4...
[ 1 of 19] Compiling Type.UserSignupError ( example-api\Type\UserSignupError.hs, dist\build\Type\UserSignupError.o )
[ 2 of 19] Compiling Api.Test.Err2    ( example-api\Api\Test\Err2.hs, dist\build\Api\Test\Err2.o )
[ 3 of 19] Compiling Type.User        ( example-api\Type\User.hs, dist\build\Type\User.o )
[ 4 of 19] Compiling Type.UserComment ( example-api\Type\UserComment.hs, dist\build\Type\UserComment.o )
[ 5 of 19] Compiling Type.UserInfo    ( example-api\Type\UserInfo.hs, dist\build\Type\UserInfo.o )
[ 6 of 19] Compiling Type.PostError   ( example-api\Type\PostError.hs, dist\build\Type\PostError.o )
[ 7 of 19] Compiling Type.Post        ( example-api\Type\Post.hs, dist\build\Type\Post.o )
[ 8 of 19] Compiling Type.Comment     ( example-api\Type\Comment.hs, dist\build\Type\Comment.o )
[ 9 of 19] Compiling Type.CreatePost  ( example-api\Type\CreatePost.hs, dist\build\Type\CreatePost.o )
[10 of 19] Compiling Type.UserPost    ( example-api\Type\UserPost.hs, dist\build\Type\UserPost.o )
[11 of 19] Compiling ApiTypes         ( example-api\ApiTypes.hs, dist\build\ApiTypes.o )
[12 of 19] Compiling Api.Post         ( example-api\Api\Post.hs, dist\build\Api\Post.o )
[13 of 19] Compiling Api.Post.Comment ( example-api\Api\Post\Comment.hs, dist\build\Api\Post\Comment.o )
[14 of 19] Compiling Api.Test         ( example-api\Api\Test.hs, dist\build\Api\Test.o )
[15 of 19] Compiling Api.Test.DashedName ( example-api\Api\Test\DashedName.hs, dist\build\Api\Test\DashedName.o )
[16 of 19] Compiling Api.Test.ReservedName ( example-api\Api\Test\ReservedName.hs, dist\build\Api\Test\ReservedName.o )
[17 of 19] Compiling Api.User         ( example-api\Api\User.hs, dist\build\Api\User.o )
[18 of 19] Compiling Example          ( example-api\Example.hs, dist\build\Example.o )
[19 of 19] Compiling Api              ( example-api\Api.hs, dist\build\Api.o )
Preprocessing executable 'rest-example-gen' for rest-example-0.2.0.4...
[1 of 1] Compiling Main             ( generate\Main.hs, dist\build\rest-example-gen\rest-example-gen-tmp\Main.o )
Linking dist\build\rest-example-gen\rest-example-gen.exe ...
hesselink commented 8 years ago

OK, that builds the rest-example-gen executable. To build the others, you need to pass some flags that are off by default. Something like cabal build -fhappstack -fsnap -fwai. But like I said, a lot of those dependencies haven't been updated yet. Perhaps --allow-newer can allow the build to proceed, though.

cnd commented 8 years ago

seems like cabal configure -f happstack ...

well at least rest-example-gen works, I'm not sure what exactly I need from rest currently =) wanted to discover possible ways building Rest service with Haskell

hesselink commented 8 years ago

OK! In that case, you don't need rest-example, per se. It can just be a nice example to see how to use the rest package. The different components show different things. The API in the example can be run with different web frameworks: happstack, snap or wai/warp. It can also be used to generate haskell and javascript client libraries with rest-example-gen. To write your own API, you use rest-core primarily, rest-happstack/rest-snap/rest-wai to run on a specific framework, and rest-gen to generate docs/client libs. There's a tutorial, and feel free to ask any questions here, or on the code@silk.co mailing list.

cnd commented 8 years ago

@hesselink I wonder if can I use any of those frameworks on ghc 8

hesselink commented 8 years ago

I just tried, and all frameworks build with --allow-newer. So while I can't give any guarantees, they seem to compile at least. However, you're going to run into a lot of issues since GHC 8 is so new, so I'd recommend working with GHC 7.10 for now. You can have them installed side by side if you want, either manually or using stack.

hesselink commented 8 years ago

I've pushed the relaxed bounds since the seem to work with --allow-never.

cnd commented 8 years ago

yes, this fix allows to build them https://github.com/jystic/unix-compat/pull/21