Skip to content

Commit 5e86b7c

Browse files
Fix openr.thrift Python Module Build
Summary: Add Dockerfile build for openr.thrift python module. The python module is built by: 1. Building and installing Facebook libraries with fbcode_builder 2. Building Open/R 3. Generating Cython files from thrift files with the FB thrift compiler 4. Generating C++ files from the Cython modules with the Cython compiler 5. Compiling the C++ modules into shared objects Future work for building and distributing Breeze: - Fix the hacks in build_breeze.sh, see comments therein - Use a staged Dockerfile build for the Open/R and Breeze build - Install openr.thrift. The openr.thrift shared objects are build and stored in the Docker image generated by Dockerfile, but are unused. - Install all the openr python submodules in a single openr site-package - Add cross-compilation to the openr.thrift build. This is needed for Terragraph - Upload the openr python package to PyPi Reviewed By: saifhhasan Differential Revision: D28614443 fbshipit-source-id: 38b7e7c5594fd4bb5a338f19c69e5fc3b3b95863
1 parent a6a91b3 commit 5e86b7c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

build/fbcode_builder/fbcode_builder.py

+8
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,14 @@ def cmake_configure(self, name, cmake_path='..'):
414414
'BUILD_SHARED_LIBS': 'ON',
415415
'CMAKE_INSTALL_PREFIX': self.option('prefix'),
416416
}
417+
418+
# Hacks to add thriftpy3 support
419+
if 'BUILD_THRIFT_PY3' in os.environ and 'folly' in name:
420+
cmake_defines['PYTHON_EXTENSIONS'] = 'True'
421+
422+
if 'BUILD_THRIFT_PY3' in os.environ and 'fbthrift' in name:
423+
cmake_defines['thriftpy3'] = 'ON'
424+
417425
cmake_defines.update(
418426
self.option('{0}:cmake_defines'.format(name), {})
419427
)

0 commit comments

Comments
 (0)