]> code.ossystems Code Review - openembedded-core.git/commit
setuptools3_rust.bbclass: move from meta-python
authorTim Orling <tim.orling@konsulko.com>
Sat, 12 Mar 2022 20:50:43 +0000 (12:50 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 15 Mar 2022 08:40:11 +0000 (08:40 +0000)
commit1ab888b37716cf7aa25bc432c1d069b19566875d
treea5241e0196c7d12f42114cb92cfcc2c014466ea0
parent545127cb3a7d810f1bae8f8610910302abdeadaa
setuptools3_rust.bbclass: move from meta-python

setuptools-rust is a plugin for setuptools to build Rust Python extensions
implemented with PyO3 or rust-cpython.

Compile and distribute Python extensions written in Rust as easily as if
they were written in C.

This class inherits pyo3.bbclass (and therefore cargo.bbclass) and
setuptools3.bbclass to make it easier to build Python modules with Rust
extensions.

Need to call pyo3_do_configure to properly setup the PyO3 environment
for cross-compiling.

Need to call cargo_common_do_configure to setup cargo_home/config so
that the linker properly finds e.g. crti.o and crtbeginS.o

It is strongly recommended to provide crates needed for your recipe
using the crate:// fetcher. This can be helped with the cargo-bitbake
command [1].

If you choose not to use the crate fetcher, bitbake vendoring will not
work with setuptools-rust, as it errors out immediately because it cannot
find pyo3 or some other crate. The (strongly discouraged) workaround for
this is to set:

CARGO_DISABLE_BITBAKE_VENDORING = "1"

[1] https://crates.io/crates/cargo-bitbake

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
meta/classes/setuptools3_rust.bbclass [new file with mode: 0644]