From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core@lists.openembedded.org
Cc: Tim Orling <tim.orling@konsulko.com>
Subject: [PATCH 04/33] setuptools3_rust.bbclass: move from meta-python
Date: Mon, 14 Mar 2022 22:48:08 +0000 [thread overview]
Message-ID: <20220314224837.834776-4-richard.purdie@linuxfoundation.org> (raw)
In-Reply-To: <20220314224837.834776-1-richard.purdie@linuxfoundation.org>
From: Tim Orling <tim.orling@konsulko.com>
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 | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 meta/classes/setuptools3_rust.bbclass
diff --git a/meta/classes/setuptools3_rust.bbclass b/meta/classes/setuptools3_rust.bbclass
new file mode 100644
index 00000000000..fb11f08f89c
--- /dev/null
+++ b/meta/classes/setuptools3_rust.bbclass
@@ -0,0 +1,11 @@
+inherit pyo3 setuptools3
+
+DEPENDS += "python3-setuptools-rust-native"
+
+setuptools3_rust_do_configure() {
+ pyo3_do_configure
+ cargo_common_do_configure
+ setuptools3_do_configure
+}
+
+EXPORT_FUNCTIONS do_configure
--
2.32.0
next prev parent reply other threads:[~2022-03-14 22:48 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-14 22:48 [PATCH 01/33] python3-setuptools-rust-native: from meta-python Richard Purdie
2022-03-14 22:48 ` [PATCH 02/33] python3-setuptools-rust-native: remove obsolete PIP_* Richard Purdie
2022-03-14 22:48 ` [PATCH 03/33] pyo3.bbclass: move from meta-python Richard Purdie
2022-03-14 22:48 ` Richard Purdie [this message]
2022-03-14 22:48 ` [PATCH 05/33] python3-cryptography: " Richard Purdie
2022-03-14 22:48 ` [PATCH 06/33] python3-pytest-subtests: " Richard Purdie
2022-03-14 22:48 ` [PATCH 07/33] python3-cryptography-vectors: " Richard Purdie
2022-03-14 22:48 ` [PATCH 08/33] python3-asn1crypto: move " Richard Purdie
2022-03-14 22:48 ` [PATCH 09/33] python3-cffi: " Richard Purdie
2022-03-14 22:48 ` [PATCH 10/33] python3-pytz: " Richard Purdie
2022-03-14 22:48 ` [PATCH 11/33] python3-bcrypt: " Richard Purdie
2022-03-14 22:48 ` [PATCH 12/33] python3-pretend: " Richard Purdie
2022-03-14 22:48 ` [PATCH 13/33] python3-psutil: " Richard Purdie
2022-03-14 22:48 ` [PATCH 14/33] poetry_core.bbclass: " Richard Purdie
2022-03-14 22:48 ` [PATCH 15/33] python3-poetry-core: " Richard Purdie
2022-03-14 22:48 ` [PATCH 16/33] python3-poetry-core: remove obsolete PIP_INSTALL_PACKAGE Richard Purdie
2022-03-14 22:48 ` [PATCH 17/33] python3-iso8601: move from meta-python Richard Purdie
2022-03-14 22:48 ` [PATCH 18/33] python3-typing-extensions: " Richard Purdie
2022-03-14 22:48 ` [PATCH 19/33] python3-semantic-version: " Richard Purdie
2022-03-14 22:48 ` [PATCH 20/33] python3-pycparser: " Richard Purdie
2022-03-14 22:48 ` [PATCH 21/33] python3-ply: " Richard Purdie
2026-01-30 1:12 ` [OE-core] " Randy MacLeod
2022-03-14 22:48 ` [PATCH 22/33] maintainers.inc: add python3-crypto and friends Richard Purdie
2022-03-14 22:48 ` [PATCH 23/33] py3o: Rename to python_py3o Richard Purdie
2022-03-14 22:48 ` [PATCH 24/33] setuptools3_rust: Rename to python_setuptools3_rust Richard Purdie
2022-03-14 22:48 ` [PATCH 25/33] poetry_core: Rename to python_poetry_core Richard Purdie
2022-03-14 22:48 ` [PATCH 26/33] poetry_core: update for renamed class pip_install_wheel to python_pep517 Richard Purdie
2022-03-14 22:48 ` [PATCH 27/33] ptest-packagelists.inc: add python3-cryptography Richard Purdie
2022-03-14 22:48 ` [PATCH 28/33] ptest-packagelists: add python3-bcrypt and -pytz Richard Purdie
2022-03-14 22:48 ` [PATCH 29/33] python3-cryptography: mark test_create_certificate_with_extensions as expected to fail Richard Purdie
2022-03-14 22:48 ` [PATCH 30/33] python3-psutil/python3-bcrypt: Add missing HOMEPAGE Richard Purdie
2022-03-14 22:48 ` [PATCH 31/33] python3-cryptography: Add missing ptest tomli dependency Richard Purdie
2022-03-14 22:48 ` [PATCH 32/33] python3-cryptography: remove obsolete PIP_INSTALL_DIST_PATH Richard Purdie
2022-03-14 22:48 ` [PATCH 33/33] python3-cryptography-vectors: Fix reproducibility Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220314224837.834776-4-richard.purdie@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=openembedded-core@lists.openembedded.org \
--cc=tim.orling@konsulko.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox