File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,7 +117,12 @@ jobs:
117117 - if : matrix.buildtype == 'getdeps'
118118 name : Set Cabal flags
119119 run : |
120- echo CABAL_CONFIG_FLAGS="$CABAL_CONFIG_FLAGS -f-bundled-folly -f-fbthrift" >>"$GITHUB_ENV"
120+ echo CABAL_CONFIG_FLAGS="$CABAL_CONFIG_FLAGS -f-bundled-folly" >>"$GITHUB_ENV"
121+
122+ - if : matrix.buildtype == 'cabal'
123+ name : Set Cabal flags
124+ run : |
125+ echo CABAL_CONFIG_FLAGS="$CABAL_CONFIG_FLAGS -f-fbthrift" >>"$GITHUB_ENV"
121126
122127 - if : matrix.buildtype == 'cabal'
123128 name : Install dependencies needed by the Cabal build
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ setup-folly::
167167 sed ' s/;/ \\\n /g' > cppfiles && \
168168 grep ' ^FILES_H:' out | \
169169 sed ' s/FILES_H://' | \
170- sed " s|$$ (dirname $$ (pwd))/|folly/ |g" | \
170+ sed " s|$$ (dirname $$ (pwd))/||g" | \
171171 sed ' s/;/ \\\n /g' > hfiles && \
172172 cd ../.. && sed " s|__CPP_FILES__|$$ (cat <folly/_build/cppfiles)|;s|__H_FILES__|$$ (cat <folly/_build/hfiles)|" < folly-clib.cabal.in > folly-clib.cabal \
173173 )
@@ -180,8 +180,13 @@ setup-folly::
180180# since there are no upstream releases. Careful to generate something
181181# that respects Cabal's constraints on version numbers: no leading
182182# zeroes and fields must be <10 digits.
183- .PHONY : setup-folly-version
183+ .PHONY : setup-folly-version setup-folly-0
184184ver: =$(shell cd folly-clib/folly && date -u "--date=@$$(git log -1 --format=%ct ) " +% Y% m% d.% -k% M)
185185setup-folly-version ::
186186 sed -i " s/^version:\(\s*\).*$$ /version:\1$( ver) /" folly-clib/folly-clib.cabal
187- sed -i " s/^\(\s*\)build-depends:\(\s*\)folly-clib.*$$ /\1build-depends: folly-clib==$( ver) /" common/util/fb-util.cabal
187+ sed -i " s/^\(\s*\)build-depends:\(\s*\)folly-clib\s*$$ /\1build-depends: folly-clib==$( ver) /" common/util/fb-util.cabal
188+
189+ # Make version 0.0 of folly-clib, the empty package
190+ setup-folly-0 ::
191+ sed " s|__CPP_FILES__||;s|__H_FILES__||" < folly-clib/folly-clib.cabal.in | grep -v ' ^\s*install-includes' | grep -v ' \.h$$' > folly-clib/folly-clib.cabal
192+ sed -i " s/^version:\(\s*\).*$$ /version:\10.0/" folly-clib/folly-clib.cabal
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ The repository contains the following packages:
3737 function prototypes into symbol names, useful for using C++ code via
3838 the Haskell FFI.
3939* [ fb-util] ( common/util ) , a collection of utilities
40+ * [ folly-clib] ( folly-clib ) , the folly C++ library wrapped in a Cabal package
4041* [ thrift-compiler] ( compiler ) , the Haskell Thrift compiler
4142* [ thrift-lib] ( lib ) , libraries for Thrift clients
4243* [ thrift-tests] ( tests ) , a test suite
@@ -56,9 +57,9 @@ packages above are on Hackage except for `thrift-cpp-channel` and
5657$ cabal install thrift-compiler thrift-lib thrift-http
5758```
5859
59- aren't on
60- Hackage because they depend on fbthrift and can only be built from the
61- repository; see the next section.
60+ ` thrift-cpp-channel ` and ` thrift-server ` aren't on Hackage because
61+ they depend on fbthrift and can only be built from the repository; see
62+ the next section.
6263
6364# Building and testing from the repository
6465
Original file line number Diff line number Diff line change @@ -243,6 +243,16 @@ library
243243 else
244244 pkgconfig-depends : double-conversion
245245
246+ -- clients of fb-util can specify
247+ -- build-depends: folly-clib > 0.0
248+ -- to ensure that fb-util is built with +folly
249+ if flag(folly)
250+ -- the version here is spliced automatically by
251+ -- 'make setup-folly-version':
252+ build-depends : folly-clib
253+ else
254+ build-depends : folly-clib== 0.0
255+
246256 if flag(folly)
247257 exposed-modules :
248258 Foreign.CPP.Addressable
@@ -281,8 +291,6 @@ library
281291 cpp/HsStruct.cpp
282292 cpp/IOBuf.cpp
283293
284- build-depends : folly-clib
285-
286294common test-common
287295 extra-libraries : stdc++
288296 ghc-options : -threaded
Original file line number Diff line number Diff line change 33## 0.1.0.0 -- YYYY-mm-dd
44
55* First version. Released on an unsuspecting world.
6+
7+ ## 0.0
8+
9+ * Empty package. Used as a dummy dependency by fb-util to force
10+ the Cabal solver to set +/-folly
Original file line number Diff line number Diff line change @@ -46,8 +46,9 @@ flag clang
4646 default: False
4747
4848-- If False, we just depend on folly from pkg-config. This is to support the
49- -- original build setup using getdeps.py, used in CI.
49+ -- original build setup using getdeps.py, used in hsthrift's CI.
5050flag bundled-folly
51+ manual: True
5152 default: True
5253
5354library
@@ -69,7 +70,7 @@ library
6970 __H_FILES__
7071
7172 install-includes:
72- folly/_build/folly/ folly-config.h
73+ folly/folly-config.h
7374 fast_float/ascii_number.h
7475 fast_float/float_common.h
7576 fast_float/constexpr_feature_detect.h
You can’t perform that action at this time.
0 commit comments