You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "John Chee (JIRA)" <ji...@apache.org> on 2014/05/13 19:24:14 UTC

[jira] [Comment Edited] (THRIFT-2401) Haskell tutorial compiles

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

John Chee edited comment on THRIFT-2401 at 5/13/14 5:23 PM:
------------------------------------------------------------

Applying the patch 0001-hs-generator-fully-qualified-ByteString-annotation.patch with the changes on THRIFT-2453 allows {{make check}} in test/hs to pass:

{code}
% make check
...
SERVER: fromList [1,2,3,4,5]
CLIENT: fromList [1,2,3,4,5]
SERVER: fromList [4,5,1,2,3]
CLIENT: fromList [4,5,1,2,3]
SERVER: Xtruct {f_Xtruct_string_thing = Just "hi", f_Xtruct_byte_thing = Just 4, f_Xtruct_i32_thing = Just 5, f_Xtruct_i64_thing = Nothing}
CLIENT: Xtruct {f_Xtruct_string_thing = Just "hi", f_Xtruct_byte_thing = Just 4, f_Xtruct_i32_thing = Just 5, f_Xtruct_i64_thing = Nothing}
CLIENT: Xception {f_Xception_errorCode = Just 1, f_Xception_message = Just "bya"}
CLIENT: Xception {f_Xception_errorCode = Just 1, f_Xception_message = Just "xyz"}
CLIENT: ok
SUCCESS
{code}


was (Author: cheecheeo):
Applying the patch 0001-hs-generator-fully-qualified-ByteString-annotation.patch with the changes on THRIFT-2453 allows {make check} in test/hs to pass:

% make check
...
SERVER: fromList [1,2,3,4,5]
CLIENT: fromList [1,2,3,4,5]
SERVER: fromList [4,5,1,2,3]
CLIENT: fromList [4,5,1,2,3]
SERVER: Xtruct {f_Xtruct_string_thing = Just "hi", f_Xtruct_byte_thing = Just 4, f_Xtruct_i32_thing = Just 5, f_Xtruct_i64_thing = Nothing}
CLIENT: Xtruct {f_Xtruct_string_thing = Just "hi", f_Xtruct_byte_thing = Just 4, f_Xtruct_i32_thing = Just 5, f_Xtruct_i64_thing = Nothing}
CLIENT: Xception {f_Xception_errorCode = Just 1, f_Xception_message = Just "bya"}
CLIENT: Xception {f_Xception_errorCode = Just 1, f_Xception_message = Just "xyz"}
CLIENT: ok
SUCCESS


> Haskell tutorial compiles
> -------------------------
>
>                 Key: THRIFT-2401
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2401
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Haskell - Compiler, Haskell - Library, Tutorial
>         Environment: Ubuntu
> The Glorious Glasgow Haskell Compilation System, version 7.6.3
>            Reporter: John Chee
>            Assignee: Roger Meier
>         Attachments: 0001-THRIFT-2401-Haskell-tutorial-compiles.patch, 0001-hs-generator-fully-qualified-ByteString-annotation.patch, haskell_tutorial_compiles.patch
>
>
> This patch fixes compilation on the Haskell tutorial.
> Running: https://gist.github.com/cheecheeo/9521607
> Before this patch results in:
> {code}
> ...
> Building ThriftTutorial-0.1.0...
> Preprocessing executable 'HaskellServer' for ThriftTutorial-0.1.0...
> on the commandline: Warning:
>     -fglasgow-exts is deprecated: Use individual extensions instead
> ../gen-hs/Shared_Types.hs:33:8:
>     Could not find module `Thrift.Types'
>     It is a member of the hidden package `thrift-1.0.0'.
>     Perhaps you need to add `thrift' to the build-depends in your .cabal file.
>     Use -v to see a list of the files searched for.
> Failed to install ThriftTutorial-0.1.0
> cabal: Error: some packages failed to install:
> ThriftTutorial-0.1.0 failed during the building phase. The exception was:
> ExitFailure 1
> {code}
> After this patch results in:
> {code}
> ...
> on the commandline: Warning:
>     -fglasgow-exts is deprecated: Use individual extensions instead
> Linking dist/dist-sandbox-ca46c903/build/HaskellClient/HaskellClient ...
> Installing executable(s) in /home/jchee/packages/thrift/.cabal-sandbox/bin
> Installed ThriftTutorial-0.1.0
> + popd
> ~/packages/thrift/tutorial ~/packages/thrift
> + popd
> ~/packages/thrift
> {code}
> Also, runnning the Haskell server and client produces expected output:
> {code}
> + pushd .cabal-sandbox/bin
> ~/packages/thrift/.cabal-sandbox/bin ~/packages/thrift
> + trap 'kill -9 19091' EXIT
> + ./HaskellServer
> + ./HaskellClient
> "Starting the server..."
> "ping()"
> "ping()"
> add(1,1)
> 1+1=2
> calculate(1, Work {f_Work_num1 = Just 15, f_Work_num2 = Just 10, f_Work_op = Just SUBTRACT, f_Work_comment = Nothing})
> 15-10=5
> Check log: 5
> + popd
> ~/packages/thrift
> + kill -9 19091
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)