-
Notifications
You must be signed in to change notification settings - Fork 34
/
thrift-server.cabal
187 lines (166 loc) · 4.89 KB
/
thrift-server.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
cabal-version: 3.6
-- Copyright (c) Facebook, Inc. and its affiliates.
name: thrift-server
version: 0.1.0.0
synopsis: Support for creating Thrift servers in Haskell
homepage: https://github.com/facebookincubator/hsthrift
bug-reports: https://github.com/facebookincubator/hsthrift/issues
license: BSD-3-Clause
license-file: LICENSE
author: Facebook, Inc.
maintainer: [email protected]
copyright: (c) Facebook, All Rights Reserved
category: Thrift
extra-source-files: CHANGELOG.md,
cpp/*.h,
cpp/*.cpp,
test/if/*.thrift
description:
Support for building server applications that
communicate using the Thrift protocols.
.
NOTE: for build instructions and documentation, see
https://github.com/facebookincubator/hsthrift
source-repository head
type: git
location: https://github.com/facebookincubator/hsthrift.git
common fb-haskell
default-language: Haskell2010
default-extensions:
BangPatterns
BinaryLiterals
DataKinds
DeriveDataTypeable
DeriveGeneric
EmptyCase
ExistentialQuantification
FlexibleContexts
FlexibleInstances
GADTs
GeneralizedNewtypeDeriving
LambdaCase
MultiParamTypeClasses
MultiWayIf
NoMonomorphismRestriction
OverloadedStrings
PatternSynonyms
RankNTypes
RecordWildCards
ScopedTypeVariables
StandaloneDeriving
TupleSections
TypeFamilies
TypeSynonymInstances
NondecreasingIndentation
if flag(opt)
ghc-options: -O2
common fb-cpp
cxx-options: -std=c++17
if !flag(clang)
cxx-options: -fcoroutines
-- very important to use -fcoroutines here, because there are
-- #ifdefs in the fbthrift code (e.g. ThriftServer.h) that must
-- be consistent with the fbthrift build.
if arch(x86_64)
cxx-options: -march=haswell
if flag(opt)
cxx-options: -O3
flag opt
default: False
flag clang
default: False
library
import: fb-haskell, fb-cpp
exposed-modules:
Thrift.Server.Types
Thrift.Server.ProcessorCallback
Thrift.Server.CppServer
cxx-sources:
cpp/CppServer.cpp
cpp/HaskellProcessor.cpp
build-depends:
fb-util,
thrift-lib,
thrift-cpp-channel,
base >=4.11.1 && <4.17,
text ^>=1.2.3.0,
bytestring >=0.10.8.2 && <0.12,
async ^>=2.2.1,
utf8-string,
containers
default-language: Haskell2010
build-tool-depends: hsc2hs:hsc2hs
hsc2hs-options: --cc=g++ --lflag=-lstdc++ --cflag=-D__HSC2HS__=1 --cflag=-std=c++17
include-dirs: .
-- TODO: I needed this to satisfy an undefined reference to jump_fcontext
-- when running hsc2hs on Thrift.Server.ProcessorCallback
extra-libraries: boost_context
-- Workaround for IPv6 loopback bug on Docker/Ubuntu:
-- https://github.com/docker/for-linux/issues/1374
flag tests_use_ipv4
description: Force tests to use IPV4 whenever bringing thrift clients/servers up
default: False
manual: True
common test-deps
build-depends: aeson,
base,
bytestring,
data-default,
deepseq,
fb-stubs,
fb-util,
hashable,
hspec,
hspec-contrib,
ghc-prim,
HUnit ^>= 1.6.1,
STMonadTrans,
text,
thrift-lib,
thrift-lib:test-helpers,
thrift-server,
thrift-cpp-channel,
transformers,
unordered-containers
if flag(tests_use_ipv4)
-- for test/Network.hs
cpp-options: -DIPV4
library test-lib
import: fb-haskell, fb-cpp, test-deps
hs-source-dirs: test/common, test/gen-hs2
exposed-modules:
CalculatorHandler
EchoHandler
Echoer.Echoer.Client
Echoer.Echoer.Service
Echoer.Types
Math.Adder.Client
Math.Adder.Service
Math.Calculator.Client
Math.Calculator.Service
Math.Types
HashMap.HashMapService.Client
HashMap.HashMapService.Service
HashMap.Types
build-depends:
containers
common test-common
import: test-deps
hs-source-dirs: test
build-depends: thrift-server:test-lib
ghc-options: -threaded
test-suite dangling-pointer
import: fb-haskell, test-common
type: exitcode-stdio-1.0
main-is: DanglingPointerTest.hs
ghc-options: -main-is DanglingPointerTest
test-suite handler
import: fb-haskell, test-common
type: exitcode-stdio-1.0
main-is: HandlerTest.hs
ghc-options: -main-is HandlerTest
test-suite server
import: fb-haskell, test-common
type: exitcode-stdio-1.0
main-is: ServerTest.hs
ghc-options: -main-is ServerTest