1
0
mirror of https://github.com/facebook/proxygen.git synced 2026-10-24 01:33:54 +03:00

Fix libiberty install and shared glog for folly-python

Summary:
Fixes the two getdeps regressions that break the BGP++ OSS builds (`fboss-oss-build-bgp`, `fboss-oss-build-bgp-bb`) and FBOSS OSS builds that build dependencies from HEAD. They ship together because either fix alone still leaves `fboss-oss-build-ondiff` red on the other.

libiberty: getdeps-built libiberty installs its headers but no `libiberty.a`, so `fbthrift-python` configure fails with `Could NOT find Libiberty (missing: LIBIBERTY_LIBRARY)`. `AutoconfBuilder` adds `--disable-shared` when a manifest passes neither shared flag, and libiberty's configure then empties `PICFLAG`, so `pic/libiberty.a` is never built and `libiberty_install_pic_lib.patch` copies nothing while the install still exits 0. The miss was silent until D125047475 renamed the package in `FindLibiberty.cmake` to `Libiberty`, which made `find_package(Libiberty REQUIRED)` in fbthrift enforce REQUIRED. Passing `--enable-shared` keeps `PICFLAG`; libiberty builds no shared library either way.

glog: since D124075105 made glog static by default, the `-python` shared libraries built on `folly-python` each embed a copy of glog, and every copy registers its flags with the one shared gflags, so test binaries abort with `linked both statically and dynamically`. glog's `[cmake.defines.feature_shared_libs=on]` could never turn on because glog declared no features. This declares `shared_libs` in glog and requests it from `folly-python`; getdeps unions features per project, so graphs that contain `folly-python` (`bgp`, `fboss`) get one shared glog, and graphs without it (`cachelib`, `mcrouter`, `folly`, `fbthrift`) keep static glog.

Reviewed By: yfeldblum, shitanshu-shah

Differential Revision: D125332467

fbshipit-source-id: 4ff0cb077de91afc86f79f09e1ab6b15fac2c7f0
This commit is contained in:
Indu Suresh
2026-10-14 20:39:27 -07:00
committed by meta-codesync[bot]
parent 6a2cdc9f51
commit 6461cf9a84
4 changed files with 12 additions and 1 deletions

View File

@@ -16,7 +16,9 @@ builder = nop
[dependencies]
gflags
glog
# folly-python's shared libraries and the binaries that load them must use one
# copy of glog.
glog = shared_libs
googletest
boost-python
libdwarf-python

View File

@@ -23,6 +23,9 @@ patchfile = glog_default_visibility.patch
[dependencies]
gflags
[features]
shared_libs =
[cmake.defines]
BUILD_TESTING=NO
WITH_PKGCONFIG=ON

View File

@@ -24,3 +24,6 @@ patchfile = libiberty_install_pic_lib.patch
# as we still want to use system linker and assembler etc
[autoconf.args]
--enable-install-libiberty
# libiberty builds pic/libiberty.a, the archive that
# libiberty_install_pic_lib.patch installs, only when shared is enabled.
--enable-shared

View File

@@ -30,5 +30,8 @@ builder = nop
# as we still want to use system linker and assembler etc
[autoconf.args]
--enable-install-libiberty
# libiberty builds pic/libiberty.a, the archive that
# libiberty_install_pic_lib.patch installs, only when shared is enabled.
--enable-shared
CFLAGS=-fPIC -O2
PICFLAG=-fPIC