Commit 48f6f9fe authored by Matthew William Edwards's avatar Matthew William Edwards Committed by Facebook GitHub Bot

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
parent 30186d69
...@@ -414,6 +414,14 @@ class FBCodeBuilder(object): ...@@ -414,6 +414,14 @@ class FBCodeBuilder(object):
'BUILD_SHARED_LIBS': 'ON', 'BUILD_SHARED_LIBS': 'ON',
'CMAKE_INSTALL_PREFIX': self.option('prefix'), 'CMAKE_INSTALL_PREFIX': self.option('prefix'),
} }
# Hacks to add thriftpy3 support
if 'BUILD_THRIFT_PY3' in os.environ and 'folly' in name:
cmake_defines['PYTHON_EXTENSIONS'] = 'True'
if 'BUILD_THRIFT_PY3' in os.environ and 'fbthrift' in name:
cmake_defines['thriftpy3'] = 'ON'
cmake_defines.update( cmake_defines.update(
self.option('{0}:cmake_defines'.format(name), {}) self.option('{0}:cmake_defines'.format(name), {})
) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment