Skip to content

Commit 8d69f6a

Browse files
r-barnesmeta-codesync[bot]
authored andcommitted
folly manifest: promote openssl to universal dep + force Apple ar/ranlib on darwin
Summary: Two unrelated cleanups to the folly manifest. 1. Promote openssl from per-OS `[dependencies.os=*]` entries to the universal `[dependencies]` block. folly uses OpenSSL on every supported platform: openssl's manifest is `builder=nop` on linux/freebsd (resolves via the distro's openssl-devel package) and builds from source on darwin/windows. Listing it once at the top is simpler and lets `install-system-deps --recursive` pick it up uniformly. This also removes a stale comment claiming the manifest format can't express "system dep is sufficient" -- that capability now exists via the `nop` builder + `[debs]`/`[rpms]` declarations in the openssl manifest. 2. Force `CMAKE_AR=/usr/bin/ar` and `CMAKE_RANLIB=/usr/bin/ranlib` on darwin. When folly is built with Homebrew LLVM clang on macOS (used by the wheels CI to pick up C++23 features that AppleClang doesn't have), CMake otherwise picks up Homebrew's llvm-ar, which writes BSD-style archives with a "/" symbol-table member that Apple's classic linker cannot parse for empty archives. Several folly portability libraries have no source files on darwin and produce exactly such empty archives, which then fail to link. Apple's tools always emit archives the system linker accepts, and AppleClang already uses /usr/bin/ar by default, so this is a no-op for AppleClang folly users. Reviewed By: bigfootjon Differential Revision: D104428959 fbshipit-source-id: 3390a631e533c34095f5db8ebb1fdd5ccc2f5ebb
1 parent 9445346 commit 8d69f6a

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

  • build/fbcode_builder/manifests

build/fbcode_builder/manifests/folly

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,12 @@ double-conversion
2323
fast_float
2424
fmt
2525
lz4
26+
openssl
2627
snappy
2728
zstd
28-
# no openssl or zlib in the linux case, why?
29-
# these are usually installed on the system
30-
# and are the easiest system deps to pull in.
31-
# In the future we want to be able to express
32-
# that a system dep is sufficient in the manifest
33-
# for eg: openssl and zlib, but for now we don't
34-
# have it.
35-
36-
# macOS doesn't expose the openssl api so we need
37-
# to build our own.
38-
[dependencies.os=darwin]
39-
openssl
4029

41-
# Windows has neither openssl nor zlib, so we get
42-
# to provide both
30+
# Windows has no zlib, so we get to provide it
4331
[dependencies.os=windows]
44-
openssl
4532
zlib
4633

4734
[dependencies.os=linux]
@@ -71,6 +58,20 @@ BOOST_LINK_STATIC=ON
7158
[cmake.defines.os=freebsd]
7259
LIBDWARF_FOUND=NO
7360

61+
# When folly is built with Homebrew LLVM clang on macOS (used by the
62+
# wheels CI to pick up C++23 features that AppleClang doesn't have),
63+
# CMake otherwise picks up Homebrew's llvm-ar, which writes BSD-style
64+
# archives with a "/" symbol-table member that Apple's classic linker
65+
# cannot parse for empty archives. Several folly portability libraries
66+
# have no source files on darwin and so produce exactly such empty
67+
# archives, which then fail to link. Forcing Apple's /usr/bin/ar and
68+
# /usr/bin/ranlib avoids this -- they write archives the system linker
69+
# always accepts. AppleClang already uses /usr/bin/ar by default, so
70+
# this is a no-op for AppleClang folly users.
71+
[cmake.defines.os=darwin]
72+
CMAKE_AR=/usr/bin/ar
73+
CMAKE_RANLIB=/usr/bin/ranlib
74+
7475
[cmake.defines.test=on]
7576
BUILD_TESTS=ON
7677
BUILD_BENCHMARKS=OFF

0 commit comments

Comments
 (0)