fbthrift
fbthrift copied to clipboard
feat(oss): Get thriftpy3 compiling in OSS
NOTE: This change is intended to land after folly PRs 2503-2507 NOTE: The changes to FBPythonWrapper.cmake duplicate those in folly PR 2505 which is shared internally between folly and fbthrift.
There are three distinct parts to this change:
- Updating the build infra necessary to get thriftpy3 compilation working and accessible from sapling/eden
- Updating the cython files to compile cleanly with Cython 3.0.8-3.1.3. (The internal version of cython appears to have some different rules around declaring/defining classes.)
- ~Removing the use of the ironically deprecated
#[deprecated]macro in Rust (may need a better fix)~
~It also fixes the following build error:~
| error: `#[deprecated]` attribute cannot be used on extern crates
| --> /tmp/fbcode_builder_getdeps-ZUsersZbenZossZsaplingZbuildZfbcode_builder-root/build/rust-shed/release/build/just_knobs_struct-7461bc517a178a8c/out/lib.rs:206:5
| |
| 206 | #[deprecated = "Please use `//thrift/annotation:rust-rust` directly"]
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
| = help: `#[deprecated]` can be applied to functions, data types, modules, unions, constants, statics, macro defs, type aliases, use statements, foreign statics, struct fields, traits, associated types, associated consts, enum variants, inherent impl blocks, and crates
| = note: `#[deny(useless_deprecated)]` on by default
Looking at the individual diffs in the PR should help the reviewer see these changes in context.
Tested by running a clean build of EdenFS in Sapling, which needs to import fbthrift with the thriftpy3 flag enabled.