fix(python): fix OSS Cython bindings build for Linux and macOS#2629
fix(python): fix OSS Cython bindings build for Linux and macOS#2629Ade20boss wants to merge 1 commit intofacebook:mainfrom
Conversation
|
Hi @Ade20boss! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Fix OSS CMake build for Python/Cython bindings
Fixes #1703
Summary
The
folly/python/setup.pywas incomplete, causing the OSS CMake build to fail when-DPYTHON_EXTENSIONS=ONis set. This fix brings the setup in line with what is required to successfully build and import the Cython bindings on both Linux and macOS.Changes
library_dirsfor Linux and macOS (Apple Silicon homebrew path)CMAKE_PREFIX_PATHsupport so the linker finds libraries built by folly's own build system, not just system pathsfmt,double-conversionlibunwindfor Linux only — guarded withsys.platform != 'darwin'since it is not available on macOSfolly.fiber_managerextensionexecutor_intf.cpp,iobuf_intf.cpp,error.cppinclude_dirsso Cython-generated code can locate folly headers-std=c++20compile flag, required for coroutines used in folly*.pyitopackage_dataso type stubs are included in the installTesting
Tested on Fedora Workstation. Additional testing was based on the investigation carried out in #1703 by @gmarzot and @novitae across Ubuntu 22.04 and macOS (Apple Silicon).
Notes
This work builds on investigation done in #1703 by @gmarzot and @novitae. The
folly/python/test/directory still needs asetup.pyand test runner — that can be addressed in a follow-up.