Skip to content

Commit d6185bf

Browse files
r-barnesmeta-codesync[bot]
authored andcommitted
Richard/packaging
Summary: Fixes #ISSUE_NUMBER X-link: https://github.com/facebookincubator/rebalancer/pull/40 Reviewed By: sravi-in Differential Revision: D107910573 Pulled By: r-barnes fbshipit-source-id: 5e5f2c3c42ec68b75d3309a2a276e35504cd5e48
1 parent 4333156 commit d6185bf

7 files changed

Lines changed: 58 additions & 8 deletions

File tree

build/fbcode_builder/manifests/fbthrift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ enable_tests=ON
2323
[cmake.defines.any(os=windows,test=off)]
2424
enable_tests=OFF
2525

26+
[cmake.defines.all(os=linux,feature_shared_libs=on)]
27+
BUILD_SHARED_LIBS=ON
28+
2629
# Features. The defaults match the historical full build. Consumers that
2730
# only need codegen + (de)serialization pull this dep as
2831
# `fbthrift = !rpc, !benchmark` to skip both the RPC link-graph and the
@@ -31,6 +34,7 @@ enable_tests=OFF
3134
default = rpc, benchmark
3235
rpc =
3336
benchmark =
37+
shared_libs =
3438

3539
[cmake.defines.feature_rpc=off]
3640
THRIFT_RPC=OFF

build/fbcode_builder/manifests/fmt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@ sha256 = ea7de4299689e12b6dddd392f9896f08fb0777ac7168897a244a6d6085043fea
99
builder = cmake
1010
subdir = fmt-12.1.0
1111

12+
[features]
13+
default =
14+
shared_libs =
15+
1216
[cmake.defines]
1317
FMT_TEST = OFF
1418
FMT_DOC = OFF
1519

20+
[cmake.defines.feature_shared_libs=on]
21+
BUILD_SHARED_LIBS = ON
22+
1623
[homebrew]
1724
fmt
1825

build/fbcode_builder/manifests/folly

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ zlib
3535
libaio
3636
libiberty
3737
libunwind
38+
# folly uses OpenSSL on every platform (SSL contexts, hashing, etc.).
39+
# On Linux, openssl's manifest uses builder=nop and resolves via the
40+
# distro's openssl-devel package, so listing it here only causes
41+
# install-system-deps --recursive to pick that package up. Without
42+
# this, downstream consumers that don't otherwise pull in fizz/wangle/
43+
# fbthrift have to discover this transitive system dep themselves.
44+
openssl
3845

3946
# xz depends on autoconf which does not build on
4047
# Windows
@@ -49,9 +56,16 @@ fbcode/folly = folly
4956
^fbcode/folly/folly-config\.h$
5057
^fbcode/folly/public_tld/build/facebook_.*
5158

59+
[features]
60+
default =
61+
shared_libs =
62+
5263
[cmake.defines]
5364
BUILD_SHARED_LIBS=OFF
5465

66+
[cmake.defines.feature_shared_libs=on]
67+
BUILD_SHARED_LIBS=ON
68+
5569
[cmake.defines.not(os=windows)]
5670
BOOST_LINK_STATIC=ON
5771

build/fbcode_builder/manifests/gflags

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ subdir = gflags-2.3.0
1212
[cmake.defines]
1313
BUILD_SHARED_LIBS = ON
1414
BUILD_STATIC_LIBS = ON
15-
#BUILD_gflags_nothreads_LIB = OFF
1615
BUILD_gflags_LIB = ON
1716

1817
[homebrew]

build/fbcode_builder/manifests/glog

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ rev = 3411d58669fe07e70335b252299432a00d1e7c6c
1313

1414
[build]
1515
builder = cmake
16+
# The patchfile removes glog's unconditional CMAKE_CXX_VISIBILITY_PRESET=hidden
17+
# (cmake_minimum_required(VERSION 3.16) forces CMP0063=NEW, making
18+
# CMAKE_POLICY_DEFAULT_CMP0063=OLD ineffective). Applied unconditionally;
19+
# default-visibility symbols in a static archive are harmless for consumers
20+
# that don't need the shared_libs feature.
21+
patchfile = glog_default_visibility.patch
1622

1723
[dependencies]
1824
gflags
@@ -35,4 +41,3 @@ libgoogle-glog-dev
3541

3642
[rpms.distro=fedora]
3743
glog-devel
38-

build/fbcode_builder/manifests/rebalancer

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,26 @@ builder = cmake
1717
[cmake.defines]
1818
CMAKE_POSITION_INDEPENDENT_CODE=ON
1919

20+
# Build the example/demo executables only when getdeps is invoked with
21+
# tests enabled (test=on -- the default for `getdeps build` without
22+
# --no-tests). Wheel builds pass --no-tests so the wheel stays
23+
# data-only. CI test jobs get the examples built and link-checked
24+
# automatically without needing to thread EXAMPLES=ON through every
25+
# workflow's --extra-cmake-defines.
26+
[cmake.defines.test=on]
27+
EXAMPLES=ON
28+
2029
[dependencies]
2130
boost
2231
# Rebalancer only uses fbthrift's codegen + (de)serialization. Skip the RPC
2332
# transport stack (fizz/wangle/mvfst, none of which it links) and the
24-
# benchmark executables.
25-
fbthrift = !rpc, !benchmark
26-
fmt
27-
folly
28-
gflags
29-
glog
33+
# benchmark executables. shared_libs builds folly/fbthrift/fmt/gflags/glog as
34+
# shared libraries, which avoids duplicate static-initializer crashes and lets
35+
# the wheel bundler (auditwheel/delocate) reason about each dep as a single
36+
# shared object.
37+
fbthrift = !rpc, !benchmark, shared_libs
38+
fmt = shared_libs
39+
folly = shared_libs
3040
googletest
3141
highs-optimizer
3242
xxhash
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
--- a/CMakeLists.txt
3+
+++ b/CMakeLists.txt
4+
@@ -61,7 +61,4 @@ endif (NOT WITH_THREADS)
5+
6+
-set (CMAKE_C_VISIBILITY_PRESET hidden)
7+
-set (CMAKE_CXX_VISIBILITY_PRESET hidden)
8+
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
9+
-set (CMAKE_VISIBILITY_INLINES_HIDDEN ON)
10+
11+
set (CMAKE_DEBUG_POSTFIX d)

0 commit comments

Comments
 (0)