Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta python merge #520

Closed
wants to merge 2 commits into from
Closed

Meta python merge #520

wants to merge 2 commits into from

Conversation

threexc
Copy link
Contributor

@threexc threexc commented Jan 18, 2022

Missed these two patches in my automatic pipeline. Some builds are breaking without them.

PyO3 provides Rust bindings for Python, including tools for creating native
Python extension modules. Running and interacting with Python code from a
Rust binary is also supported.

This class sets up the cross-compilation environment.

Export PYO3_CROSS, PYO3_CROSS_LIB_DIR, PYO3_CROSS_INCLUDE_DIR and CARGO_BUILD_TARGET
to inform tools like setuptools-rust we are cross-compiling.

Export RUSTFLAGS so cargo can find 'std' and 'core' for target

Dynamically generate PyO3 config file and export PYO3_CONFIG_FILE
absolute path. This is the trick that finally made pyo3 work.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.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>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
@kraj
Copy link
Contributor

kraj commented Jan 18, 2022

merged

@kraj kraj closed this Jan 18, 2022
@threexc threexc deleted the meta-python-merge branch January 19, 2022 12:55
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this pull request Feb 28, 2022
Changelog:
=========
Added:
-----
new flag --code-quote-style (and $BATS_CODE_QUOTE_STYLE) to customize
quotes around code blocks in error output (openembedded#506)
an example/regression test for running background tasks without blocking the
test run (openembedded#525, openembedded#535)
bats_load_library for loading libraries from the search path
$BATS_LIB_PATH (openembedded#548)

Fixed:
-----
improved error trace for some broken cases (openembedded#279)
removed leftover debug file /tmp/latch in selftest suite
(single use latch) (openembedded#516)
fix recurring errors on CTRL+C tests with NPM on Windows in selftest suite (openembedded#516)
fixed leaking of local variables from debug trap (openembedded#520)
don't mark FD3 output from teardown_file as <failure> in junit output (openembedded#532)
fix unbound variable error with Bash pre 4.4 (openembedded#550)

Documentation:
--------------
remove links to defunct freenode IRC channel (openembedded#515)
improved grammar (openembedded#534)
fixed link to TAP spec (openembedded#537)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this pull request Feb 28, 2022
Changelog:
=========
Added:
-----
new flag --code-quote-style (and $BATS_CODE_QUOTE_STYLE) to customize
quotes around code blocks in error output (openembedded#506)
an example/regression test for running background tasks without blocking the
test run (openembedded#525, openembedded#535)
bats_load_library for loading libraries from the search path
$BATS_LIB_PATH (openembedded#548)

Fixed:
-----
improved error trace for some broken cases (openembedded#279)
removed leftover debug file /tmp/latch in selftest suite
(single use latch) (openembedded#516)
fix recurring errors on CTRL+C tests with NPM on Windows in selftest suite (openembedded#516)
fixed leaking of local variables from debug trap (openembedded#520)
don't mark FD3 output from teardown_file as <failure> in junit output (openembedded#532)
fix unbound variable error with Bash pre 4.4 (openembedded#550)

Documentation:
--------------
remove links to defunct freenode IRC channel (openembedded#515)
improved grammar (openembedded#534)
fixed link to TAP spec (openembedded#537)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this pull request Feb 28, 2022
Changelog:
=========
Added:
-----
new flag --code-quote-style (and $BATS_CODE_QUOTE_STYLE) to customize
quotes around code blocks in error output (openembedded#506)
an example/regression test for running background tasks without blocking the
test run (openembedded#525, openembedded#535)
bats_load_library for loading libraries from the search path
$BATS_LIB_PATH (openembedded#548)

Fixed:
-----
improved error trace for some broken cases (openembedded#279)
removed leftover debug file /tmp/latch in selftest suite
(single use latch) (openembedded#516)
fix recurring errors on CTRL+C tests with NPM on Windows in selftest suite (openembedded#516)
fixed leaking of local variables from debug trap (openembedded#520)
don't mark FD3 output from teardown_file as <failure> in junit output (openembedded#532)
fix unbound variable error with Bash pre 4.4 (openembedded#550)

Documentation:
--------------
remove links to defunct freenode IRC channel (openembedded#515)
improved grammar (openembedded#534)
fixed link to TAP spec (openembedded#537)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
halstead pushed a commit that referenced this pull request Mar 1, 2022
Changelog:
=========
Added:
-----
new flag --code-quote-style (and $BATS_CODE_QUOTE_STYLE) to customize
quotes around code blocks in error output (#506)
an example/regression test for running background tasks without blocking the
test run (#525, #535)
bats_load_library for loading libraries from the search path
$BATS_LIB_PATH (#548)

Fixed:
-----
improved error trace for some broken cases (#279)
removed leftover debug file /tmp/latch in selftest suite
(single use latch) (#516)
fix recurring errors on CTRL+C tests with NPM on Windows in selftest suite (#516)
fixed leaking of local variables from debug trap (#520)
don't mark FD3 output from teardown_file as <failure> in junit output (#532)
fix unbound variable error with Bash pre 4.4 (#550)

Documentation:
--------------
remove links to defunct freenode IRC channel (#515)
improved grammar (#534)
fixed link to TAP spec (#537)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants