setuptools-rust and python3-cryptography
cover setuptools-rust and python3-cryptography
This series upgrades python3-cryptography from the last version to be purely Python/C extensions (3.3.2) to the latest version which also includes Rust extensions (36.0.1).
This has been tested (including full ptest runs) on:
- qemux86-64
- qemux86-musl
- qemuarm64
The test cases require an absolute minimum of 1 GB of free memory according to the documentation, but in practice it was more performant to have 2 GB of free memory. For this reason a check-memfree.py test is added to run-ptest to avoid OOM/Exit code 9 in the ptest-runner. The test cases were run with:
runqemu nographic slirp qemuparams="-m 2176 -smp 4"
On x86-64 with kvm this takes about 5 minutes.
The results are 2856+/-2 passed, 1654+/-2 skipped. Of the skipped tests 1600 of them are because of unsupported "counter location middle_fixed" in https://github.com/pyca/cryptography/pull/2773. A further ~35 test cases are skipped because of not setting --wychefproof-root, but even when the Google wychefproof repository is cloned and the option is set, it adds another ~5000 skipped test cases:
https://git.openembedded.org/meta-openembedded-contrib/commit/?h=timo/wip-python3-cryptography-ptest&id=fff4da6e70c97265e17a82f1d043ab16039d510e
Upstream uses python3-pytest-xdist to parallize test cases (and python3-pytest-shard to distribute amongst workers), but this uses stdin/stdout and therefore we have no output to ptest-runner.
This series introduces two helper classes pyo3.bbclass and setuptools_rust.bbclass for Python/Rust projects.
The setuptools_rust.bbclass wraps PyO3, Cargo and the newly added python3-setuptools-rust-native recipe. Since oe-core only supports native rustc at this time, only a native recipe is provided.
To demonstrate that these classes are applicable to multiple recipes, we also introduce python3-pyruvate, a WSGI implementation in Rust.
While we are at it we upgrade python3-pytest-subtests from 0.5.0 to 0.6.0.
The following changes since commit df5c1a31fdb8325d1c514f9ed8a7b3805dc581ac:
python3-diskcache: Upgrade 5.3.0 -> 5.4.0 (2022-01-10 10:35:02 -0800)
are available in the Git repository at:
git://git.openembedded.org/meta-openembedded-contrib timo/python3-cryptography_36.0.1
http://cgit.openembedded.org/meta-openembedded-contrib/log/?h=timo/python3-cryptography_36.0.1
Tim Orling (7):
python3-setuptools-rust-native: add v1.1.2 recipe pyo3.bbclass: add class for PyO3 cross-compilation setuptools3_rust.bbclass: setuptoools Rust plugin
python3-pyruvate: add recipe for v1.1.2
python3-pytest-subtests: upgrade 0.5.0 -> 0.6.0 python3-cryptography-vectors: upgrade 35.0.0 => 36.0.1
python3-cryptography: upgrade 3.3.2 -> 36.0.1
meta-python/classes/pyo3.bbclass | 30 +++++
meta-python/classes/setuptools3_rust.bbclass | 11 ++
...=> python3-cryptography-vectors_36.0.1.bb} | 5 +-
.../0001-Cargo.toml-specify-pem-version.patch | 31 +++++
.../0002-Cargo.toml-edition-2018-2021.patch | 28 ++++
.../python3-cryptography/check-memfree.py | 10 ++
.../python/python3-cryptography/h-test.patch | 10 --
.../python3-cryptography/openssl3.patch | 62 ---------
.../python/python3-cryptography/run-ptest | 4 +-
.../python/python3-cryptography_3.3.2.bb | 68 ----------
.../python/python3-cryptography_36.0.1.bb | 121 ++++++++++++++++++
.../python/python3-pyruvate_1.1.2.bb | 119 +++++++++++++++++
.../python/python3-pytest-subtests_0.5.0.bb | 16 ---
.../python/python3-pytest-subtests_0.6.0.bb | 20 +++
.../python3-setuptools-rust-native_1.1.2.bb | 26 ++++
15 files changed, 403 insertions(+), 158 deletions(-)
create mode 100644 meta-python/classes/pyo3.bbclass
create mode 100644 meta-python/classes/setuptools3_rust.bbclass
rename meta-python/recipes-devtools/python/{python3-cryptography-vectors_35.0.0.bb => python3-cryptography-vectors_36.0.1.bb} (72%)
create mode 100644 meta-python/recipes-devtools/python/python3-cryptography/0001-Cargo.toml-specify-pem-version.patch
create mode 100644 meta-python/recipes-devtools/python/python3-cryptography/0002-Cargo.toml-edition-2018-2021.patch
create mode 100755 meta-python/recipes-devtools/python/python3-cryptography/check-memfree.py
delete mode 100644 meta-python/recipes-devtools/python/python3-cryptography/h-test.patch
delete mode 100644 meta-python/recipes-devtools/python/python3-cryptography/openssl3.patch
delete mode 100644 meta-python/recipes-devtools/python/python3-cryptography_3.3.2.bb
create mode 100644 meta-python/recipes-devtools/python/python3-cryptography_36.0.1.bb
create mode 100644 meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb
delete mode 100644 meta-python/recipes-devtools/python/python3-pytest-subtests_0.5.0.bb
create mode 100644 meta-python/recipes-devtools/python/python3-pytest-subtests_0.6.0.bb
create mode 100644 meta-python/recipes-devtools/python/python3-setuptools-rust-native_1.1.2.bbSignature · 1 line
2.30.2
PATCH 1/7 python3-setuptools-rust-native: add v1.1.2 recipe
Dependency for python3-cryptography 3.4.x+
Only native rustc is supported at this time in oe-core, therefore it makes no sense to try to build for target.
--- .../python3-setuptools-rust-native_1.1.2.bb | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 meta-python/recipes-devtools/python/python3-setuptools-rust-native_1.1.2.bb
meta-python/recipes-devtools/python/python3-setuptools-rust-native_1.1.2.bb new file +26 -0
@@ -0,0 +1,26 @@ +SUMMARY = "Setuptools Rust extension plugin" +DESCRIPTION = "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." +HOMEPAGE = "https://github.com/PyO3/setuptools-rust" +BUGTRACKER = "https://github.com/PyO3/setuptools-rust/issues" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=011cd92e702dd9e6b1a26157b6fd53f5" + +SRC_URI = "https://files.pythonhosted.org/packages/67/08/e1aa2c582c62ac76e4d60f8e454bd3bba933781a06a88b4e38797445822a/setuptools-rust-${PV}.tar.gz" +SRC_URI[sha256sum] = "a0adb9b503c0ffc4e8fe80b7c617898cefa78049983aaaea7f747e153a3e65d1" + +inherit cargo pypi setuptools3 native + +DEPENDS += "python3-setuptools-scm-native python3-wheel-native" + +RDEPENDS:${PN}:class-native += " \ + python3-semantic-version-native \ + python3-setuptools-native \ + python3-setuptools-scm-native \ + python3-toml-native \ + python3-typing-extensions-native \ + python3-wheel-native \ +"
Signature · 1 line
2.30.2
PATCH 2/7 pyo3.bbclass: add class for PyO3 cross-compilation
In reply to Tim OrlingPyO3 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.
--- meta-python/classes/pyo3.bbclass | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 meta-python/classes/pyo3.bbclass
meta-python/classes/pyo3.bbclass new file +30 -0
@@ -0,0 +1,30 @@ +# +# This class helps make sure that Python extensions built with PyO3 +# and setuptools_rust properly set up the environment for cross compilation +# + +inherit cargo python3-dir siteinfo + +export PYO3_CROSS="1" +export PYO3_CROSS_PYTHON_VERSION="${PYTHON_BASEVERSION}" +export PYO3_CROSS_LIB_DIR="${STAGING_LIBDIR}" +export CARGO_BUILD_TARGET="${HOST_SYS}" +export RUSTFLAGS +export PYO3_PYTHON="${PYTHON}" +export PYO3_CONFIG_FILE="${WORKDIR}/pyo3.config" + +pyo3_do_configure () { + cat > ${WORKDIR}/pyo3.config << EOF +implementation=CPython +version=${PYTHON_BASEVERSION} +shared=true +abi3=false +lib_name=${PYTHON_DIR} +lib_dir=${STAGING_LIBDIR} +pointer_width=${SITEINFO_BITS} +build_flags=WITH_THREAD +suppress_build_script_link_lines=false +EOF +} + +EXPORT_FUNCTIONS do_configure
Signature · 1 line
2.30.2
PATCH 3/7 setuptools3_rust.bbclass: setuptoools Rust plugin
In reply to Tim Orlingsetuptools-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
--- meta-python/classes/setuptools3_rust.bbclass | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 meta-python/classes/setuptools3_rust.bbclass
meta-python/classes/setuptools3_rust.bbclass new file +11 -0
@@ -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
Signature · 1 line
2.30.2
PATCH 4/7 python3-pyruvate: add recipe for v1.1.2
In reply to Tim OrlingPyruvate is a reasonably fast, multithreaded, non-blocking WSGI server implemented in Rust.
This recipe uses the new setuptools3_rust and pyo3 classes.
--- .../python/python3-pyruvate_1.1.2.bb | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb
meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb new file +119 -0
@@ -0,0 +1,119 @@ +SUMMARY = "WSGI server implemented in Rust." +DESCRIPTION = "Pyruvate is a reasonably fast, multithreaded, non-blocking \ +WSGI server implemented in Rust." +HOMEPAGE = "https://gitlab.com/tschorr/pyruvate" +BUGTRACKER = "https://gitlab.com/tschorr/pyruvate/-/issues" + +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://LICENSE;md5=051b48e640a6e2d795eac75542d9417c \ + file://LICENSE.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +SRC_URI[sha256sum] = "10befedd97e73fc18b902d02aa3b24e8978aa162242c1b664849c886c0675899" + +S = "${WORKDIR}/pyruvate-${PV}" + +inherit pypi setuptools3_rust + +SRC_URI += " \ + crate://crates.io/aho-corasick/0.7.18 \ + crate://crates.io/atty/0.2.14 \ + crate://crates.io/autocfg/1.0.1 \ + crate://crates.io/bitflags/1.3.2 \ + crate://crates.io/block-buffer/0.9.0 \ + crate://crates.io/cc/1.0.72 \ + crate://crates.io/cfg-if/1.0.0 \ + crate://crates.io/chrono/0.4.19 \ + crate://crates.io/cpufeatures/0.2.1 \ + crate://crates.io/cpython/0.7.0 \ + crate://crates.io/crossbeam-channel/0.5.2 \ + crate://crates.io/crossbeam-deque/0.8.1 \ + crate://crates.io/crossbeam-epoch/0.9.6 \ + crate://crates.io/crossbeam-queue/0.3.3 \ + crate://crates.io/crossbeam-utils/0.8.6 \ + crate://crates.io/crossbeam/0.8.1 \ + crate://crates.io/crypto-mac/0.11.1 \ + crate://crates.io/ctrlc/3.2.1 \ + crate://crates.io/digest/0.9.0 \ + crate://crates.io/encoding-index-japanese/1.20141219.5 \ + crate://crates.io/encoding-index-korean/1.20141219.5 \ + crate://crates.io/encoding-index-simpchinese/1.20141219.5 \ + crate://crates.io/encoding-index-singlebyte/1.20141219.5 \ + crate://crates.io/encoding-index-tradchinese/1.20141219.5 \ + crate://crates.io/encoding/0.2.33 \ + crate://crates.io/encoding_index_tests/0.1.4 \ + crate://crates.io/env_logger/0.9.0 \ + crate://crates.io/errno-dragonfly/0.1.2 \ + crate://crates.io/errno/0.2.8 \ + crate://crates.io/fastrand/1.6.0 \ + crate://crates.io/generic-array/0.14.5 \ + crate://crates.io/getrandom/0.2.3 \ + crate://crates.io/hermit-abi/0.1.19 \ + crate://crates.io/hmac/0.11.0 \ + crate://crates.io/httparse/1.5.1 \ + crate://crates.io/humantime/2.1.0 \ + crate://crates.io/instant/0.1.12 \ + crate://crates.io/lazy_static/1.4.0 \ + crate://crates.io/libc/0.2.112 \ + crate://crates.io/libsystemd/0.4.1 \ + crate://crates.io/log/0.4.14 \ + crate://crates.io/memchr/2.4.1 \ + crate://crates.io/memoffset/0.6.5 \ + crate://crates.io/mio/0.8.0 \ + crate://crates.io/miow/0.3.7 \ + crate://crates.io/nix/0.23.1 \ + crate://crates.io/ntapi/0.3.6 \ + crate://crates.io/num-integer/0.1.44 \ + crate://crates.io/num-traits/0.2.14 \ + crate://crates.io/num_cpus/1.13.1 \ + crate://crates.io/once_cell/1.9.0 \ + crate://crates.io/opaque-debug/0.3.0 \ + crate://crates.io/paste/1.0.6 \ + crate://crates.io/ppv-lite86/0.2.16 \ + crate://crates.io/proc-macro2/1.0.36 \ + crate://crates.io/python3-sys/0.7.0 \ + crate://crates.io/quote/1.0.14 \ + crate://crates.io/rand/0.8.4 \ + crate://crates.io/rand_chacha/0.3.1 \ + crate://crates.io/rand_core/0.6.3 \ + crate://crates.io/rand_hc/0.3.1 \ + crate://crates.io/redox_syscall/0.2.10 \ + crate://crates.io/regex-syntax/0.6.25 \ + crate://crates.io/regex/1.5.4 \ + crate://crates.io/remove_dir_all/0.5.3 \ + crate://crates.io/scopeguard/1.1.0 \ + crate://crates.io/serde/1.0.133 \ + crate://crates.io/serde_derive/1.0.133 \ + crate://crates.io/sha2/0.9.9 \ + crate://crates.io/simplelog/0.11.1 \ + crate://crates.io/spmc/0.3.0 \ + crate://crates.io/subtle/2.4.1 \ + crate://crates.io/syn/1.0.85 \ + crate://crates.io/tempfile/3.3.0 \ + crate://crates.io/termcolor/1.1.2 \ + crate://crates.io/thiserror-impl/1.0.30 \ + crate://crates.io/thiserror/1.0.30 \ + crate://crates.io/threadpool/1.8.1 \ + crate://crates.io/time/0.1.44 \ + crate://crates.io/typenum/1.15.0 \ + crate://crates.io/unicode-xid/0.2.2 \ + crate://crates.io/urlencoding/2.1.0 \ + crate://crates.io/uuid/0.8.2 \ + crate://crates.io/version_check/0.9.4 \ + crate://crates.io/wasi/0.10.0+wasi-snapshot-preview1 \ + crate://crates.io/winapi-i686-pc-windows-gnu/0.4.0 \ + crate://crates.io/winapi-util/0.1.5 \ + crate://crates.io/winapi-x86_64-pc-windows-gnu/0.4.0 \ + crate://crates.io/winapi/0.3.9 \ +" + +# The following configs & dependencies are from setuptools extras_require. +# These dependencies are optional, hence can be controlled via PACKAGECONFIG. +# The upstream names may not correspond exactly to bitbake package names. +# +# Uncomment this line to enable all the optional features. +#PACKAGECONFIG ?= "test" +PACKAGECONFIG[test] = ",,,python3-pytest python3-requests" + +# WARNING: the following rdepends are determined through basic analysis of the +# python sources, and might not be 100% accurate. +RDEPENDS:${PN} += "python3-core"
Signature · 1 line
2.30.2
PATCH 5/7 python3-pytest-subtests: upgrade 0.5.0 -> 0.6.0
In reply to Tim Orling0.6.0 (2022-01-15)
* pytest>=6.0 is now required.
* Added official support for Python 3.10.
* Dropped support for Python 3.5.
* Users no longer need to configure a warnings filter for the internal A private pytest class or function was used pytest warning (#52).
* Experimental: Use SUBPASS and , for passed subtests instead of general PASSED, SUBFAIL and u for failed ones instead of FAILED (#30).
References:
https://github.com/pytest-dev/pytest-subtests/pull/52
https://github.com/pytest-dev/pytest-subtests/pull/30
--- .../python/python3-pytest-subtests_0.5.0.bb | 16 --------------- .../python/python3-pytest-subtests_0.6.0.bb | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 16 deletions(-) delete mode 100644 meta-python/recipes-devtools/python/python3-pytest-subtests_0.5.0.bb create mode 100644 meta-python/recipes-devtools/python/python3-pytest-subtests_0.6.0.bb
meta-python/recipes-devtools/python/python3-pytest-subtests_0.5.0.bb deleted +0 -16
@@ -1,16 +0,0 @@ -DESCRIPTION = "unittest subTest() support and subtests fixture." - -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://LICENSE;md5=242b4e17fa287dcf7aef372f6bc3dcb1" - -SRC_URI[sha256sum] = "5bd1e4bf0eda4c89a6cd42b0ee28e1d2ca0848de3fd67ad8cdd6d559ed00f120" - -inherit pypi setuptools3 - -DEPENDS += "${PYTHON_PN}-setuptools-scm-native" - -RDEPENDS:${PN} += " \ - ${PYTHON_PN}-pytest \ -" - -BBCLASSEXTEND = "native nativesdk"
meta-python/recipes-devtools/python/python3-pytest-subtests_0.6.0.bb new file +20 -0
@@ -0,0 +1,20 @@ +SUMMARY = "unittest subTest() support and subtests fixture." +DESCRIPTION = "Adds support for TestCase.subTest.\ +New subtests fixture, providing similar functionality for pure pytest tests." +HOMEPAGE = "https://github.com/pytest-dev/pytest-subtests" +BUGTRACKER = "https://github.com/pytest-dev/pytest-subtests/issues" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=242b4e17fa287dcf7aef372f6bc3dcb1" + +SRC_URI[sha256sum] = "3ebd306a8dcf75133f1742f288c82f36426ebcf8a132d4ee89782d20e84fc13a" + +inherit pypi setuptools3 + +DEPENDS += "${PYTHON_PN}-setuptools-scm-native" + +RDEPENDS:${PN} += " \ + ${PYTHON_PN}-pytest \ +" + +BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.30.2
PATCH 7/7 python3-cryptography: upgrade 3.3.2 -> 36.0.1
In reply to Tim OrlingSee https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst#3601---2021-12-14
for changes
* Add PSF-2.0 license and explicitly add checksums for the LICENSE files that are packaged.
* RDEPENDS on python3-hypothesis (in oe-core) for ptest so we can drop the patch for skipping.
* Drop backported patch for openssl3 support.
* inherit new setuptools_rust class (which inherits new pyo3 class, which inherits cargo and python3-dir).
* RDEPENDS on python3-pytest-subtests for ptest
* Copy pyproject.toml for ptest as it defines the pytest.marker(s) needed
* Cleanup and alphabetize the RDEPENDS
* Use 'cargo bitbake' to generate the crate:// SRC_URIs
- Needed some hacks to the Cargo.toml in src/rust/ to make this work (probably only package.repository was strictly required):
[package]
description = "cryptography includes both high level recipes and low level interfaces to common cryptographic algorithms such as symmetric ciphers, message digests, and key derivation functions." homepage = "https://github.com/pyca/cryptography"
repository = "https://github.com/pyca/cryptography"
* Add patches to src/rust/Cargo.toml to fix cargo errors including pem version
* Add check-memfree.py to ptest to check for sufficient free memory
--- .../0001-Cargo.toml-specify-pem-version.patch | 31 +++++ .../0002-Cargo.toml-edition-2018-2021.patch | 28 ++++ .../python3-cryptography/check-memfree.py | 10 ++ .../python/python3-cryptography/h-test.patch | 10 -- .../python3-cryptography/openssl3.patch | 62 --------- .../python/python3-cryptography/run-ptest | 4 +- .../python/python3-cryptography_3.3.2.bb | 68 ---------- .../python/python3-cryptography_36.0.1.bb | 121 ++++++++++++++++++ 8 files changed, 193 insertions(+), 141 deletions(-) create mode 100644 meta-python/recipes-devtools/python/python3-cryptography/0001-Cargo.toml-specify-pem-version.patch create mode 100644 meta-python/recipes-devtools/python/python3-cryptography/0002-Cargo.toml-edition-2018-2021.patch create mode 100755 meta-python/recipes-devtools/python/python3-cryptography/check-memfree.py delete mode 100644 meta-python/recipes-devtools/python/python3-cryptography/h-test.patch delete mode 100644 meta-python/recipes-devtools/python/python3-cryptography/openssl3.patch delete mode 100644 meta-python/recipes-devtools/python/python3-cryptography_3.3.2.bb create mode 100644 meta-python/recipes-devtools/python/python3-cryptography_36.0.1.bb
meta-python/recipes-devtools/python/python3-cryptography/0001-Cargo.toml-specify-pem-version.patch new file +31 -0
@@ -0,0 +1,31 @@ +From ec8d3f3c61280c8140b34ed1479baef5e706f064 Mon Sep 17 00:00:00 2001 +From: Tim Orling <[email protected]> +Date: Fri, 14 Jan 2022 22:02:25 -0800 +Subject: [PATCH] Cargo.toml: specify pem version + +pem = "1.0" is not resolving, specify the current +pem = { version: "1.0.2"} + +Upstream-Status: Pending + +Signed-off-by: Tim Orling <[email protected]> +--- + src/rust/Cargo.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml +index 617167d0..174eaa80 100644 +--- a/src/rust/Cargo.toml ++++ b/src/rust/Cargo.toml +@@ -9,7 +9,7 @@ publish = false + lazy_static = "1" + pyo3 = { version = "0.15.1" } + asn1 = { version = "0.8.7", default-features = false, features = ["derive"] } +-pem = "1.0" ++pem = { version = "1.0.2" } + chrono = { version = "0.4", default-features = false, features = ["alloc", "clock"] } + ouroboros = "0.13" + +-- +2.30.2 +
meta-python/recipes-devtools/python/python3-cryptography/0002-Cargo.toml-edition-2018-2021.patch new file +28 -0
@@ -0,0 +1,28 @@ +From 4b73298b214a5b69ea6edf3c2e21dd82b2b29708 Mon Sep 17 00:00:00 2001 +From: Tim Orling <[email protected]> +Date: Fri, 14 Jan 2022 22:34:59 -0800 +Subject: [PATCH 2/2] Cargo.toml: edition 2018 -> 2021 + +Upstream-Status: Pending + +Signed-off-by: Tim Orling <[email protected]> +--- + src/rust/Cargo.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml +index 174eaa80..7ad053d9 100644 +--- a/src/rust/Cargo.toml ++++ b/src/rust/Cargo.toml +@@ -2,7 +2,7 @@ + name = "cryptography-rust" + version = "0.1.0" + authors = ["The cryptography developers <[email protected]>"] +-edition = "2018" ++edition = "2021" + publish = false + + [dependencies] +-- +2.30.2 +
meta-python/recipes-devtools/python/python3-cryptography/check-memfree.py new file +10 -0
@@ -0,0 +1,10 @@ +#!/usr/bin/env python3 +# https://stackoverflow.com/questions/22102999/get-total-physical-memory-in-python/28161352 +import sys +meminfo = dict((i.split()[0].rstrip(':'),int(i.split()[1])) for i in open('/proc/meminfo').readlines()) +mem_free = meminfo['MemTotal']/1024./1024. +if mem_free < 2.: + raise RuntimeError("Insufficient free memory({:.3f}): requires > 2 GB".format(mem_free)) + sys.exit(1) +else: + print("Free memory: {:.3f} GB".format(mem_free))
meta-python/recipes-devtools/python/python3-cryptography/h-test.patch deleted +0 -10
@@ -1,10 +0,0 @@ ---- a/tests/hypothesis/__init__.py -+++ b/tests/hypothesis/__init__.py -@@ -3,3 +3,7 @@ - # for complete details. - - from __future__ import absolute_import, division, print_function -+ -+import pytest -+hypothesis = pytest.importorskip("hypothesis") -+
meta-python/recipes-devtools/python/python3-cryptography/openssl3.patch deleted +0 -62
62 lines not on this page · raw message
meta-python/recipes-devtools/python/python3-cryptography/run-ptest +3 -1
@@ -1,2 +1,4 @@ #!/bin/sh -py.test +if ./check-memfree.py; then + pytest -vvvv tests/ +fi
meta-python/recipes-devtools/python/python3-cryptography_3.3.2.bb deleted +0 -68
68 lines not on this page · raw message
meta-python/recipes-devtools/python/python3-cryptography_36.0.1.bb new file +121 -0
121 lines not on this page · raw message
Signature · 1 line
2.30.2
PATCH 6/7 python3-cryptography-vectors: upgrade 35.0.0 => 36.0.1
In reply to Tim OrlingAdd note to remind contributors to keep this recipe in lock-step with python3-cryptography. They must be at the same version.
5bd0c10d allow parsing of nonstandard country name and jurisdiction country name (#6641) 78c2dd8a add AES SIV vectors (#6608)c451c1df add AES OCB3 test vectors (#6606)4da2a681 Allow parsing CSR extensions with the critical bit having an explicitly encoded default (#6600) bb05d4b5 allow multiple identical pem blocks (#6551)f4871a21 add accvraiz1 bmpstring test vector (#6503)667e7a5f Add new PKCS12 test vectors (#6383)703de3af Accept combined PEM files with multiple sections (#6365)51221b2c support legacy PEM headers for certificate and CSR (#6356)
---
...tors_35.0.0.bb => python3-cryptography-vectors_36.0.1.bb} | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
rename meta-python/recipes-devtools/python/{python3-cryptography-vectors_35.0.0.bb => python3-cryptography-vectors_36.0.1.bb} (72%)meta-python/recipes-devtools/python/python3-cryptography-vectors_36.0.1.bb renamed from meta-python/recipes-devtools/python/python3-cryptography-vectors_35.0.0.bb +4 -1
@@ -6,7 +6,10 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=8c3617db4fb6fae01f1d253ab91511e4 \ file://LICENSE.APACHE;md5=4e168cce331e5c827d4c2b68a6200e1b \ file://LICENSE.BSD;md5=5ae30ba4123bc4f2fa49aa0b0dce887b" -SRC_URI[sha256sum] = "978ad96822c0e007a0a3d8187eb0eafbd9eb1d67b50cfac70277175e74957bfc" +# NOTE: Make sure to keep this recipe at the same version as python3-cryptography +# Upgrade both recipes at the same time + +SRC_URI[sha256sum] = "fc8490afd5424342b868215435bd174dcd76ab396b4ea9435498be5721dcd598" PYPI_PACKAGE = "cryptography_vectors"
Signature · 1 line
2.30.2
Re: [oe] [meta-python][PATCH 4/7] python3-pyruvate: add recipe for v1.1.2
In reply to Tim Orlingthis fail on mips see
https://errors.yoctoproject.org/Errors/Details/622699/
Quoted 149 lines · Tim Orling
Pyruvate is a reasonably fast, multithreaded, non-blocking WSGI server implemented in Rust.
This recipe uses the new
setuptools3_rustand pyo3 classes.Signed-off-by Tim Orling <[email protected]>--- .../python/python3-pyruvate_1.1.2.bb | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bbmeta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb new file +119
-1@@ -0,0 +1,119 @@ +SUMMARY = "WSGI server implemented in Rust." +DESCRIPTION = "Pyruvate is a reasonably fast, multithreaded, non-blocking \ +WSGI server implemented in Rust." +HOMEPAGE = "https://gitlab.com/tschorr/pyruvate" +BUGTRACKER = "https://gitlab.com/tschorr/pyruvate/-/issues" + +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://LICENSE;md5=051b48e640a6e2d795eac75542d9417c \ + file://LICENSE.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +SRC_URI[sha256sum] = "10befedd97e73fc18b902d02aa3b24e8978aa162242c1b664849c886c0675899" + +S = "${WORKDIR}/pyruvate-${PV}" + +inherit pypi setuptools3_rust + +SRC_URI += " \ + crate://crates.io/aho-corasick/0.7.18 \ + crate://crates.io/atty/0.2.14 \ + crate://crates.io/autocfg/1.0.1 \ + crate://crates.io/bitflags/1.3.2 \ + crate://crates.io/block-buffer/0.9.0 \ + crate://crates.io/cc/1.0.72 \ + crate://crates.io/cfg-if/1.0.0 \ + crate://crates.io/chrono/0.4.19 \ + crate://crates.io/cpufeatures/0.2.1 \ + crate://crates.io/cpython/0.7.0 \ + crate://crates.io/crossbeam-channel/0.5.2 \ + crate://crates.io/crossbeam-deque/0.8.1 \ + crate://crates.io/crossbeam-epoch/0.9.6 \ + crate://crates.io/crossbeam-queue/0.3.3 \ + crate://crates.io/crossbeam-utils/0.8.6 \ + crate://crates.io/crossbeam/0.8.1 \ + crate://crates.io/crypto-mac/0.11.1 \ + crate://crates.io/ctrlc/3.2.1 \ + crate://crates.io/digest/0.9.0 \ + crate://crates.io/encoding-index-japanese/1.20141219.5 \ + crate://crates.io/encoding-index-korean/1.20141219.5 \ + crate://crates.io/encoding-index-simpchinese/1.20141219.5 \ + crate://crates.io/encoding-index-singlebyte/1.20141219.5 \ + crate://crates.io/encoding-index-tradchinese/1.20141219.5 \ + crate://crates.io/encoding/0.2.33 \ + crate://crates.io/encoding_index_tests/0.1.4 \ + crate://crates.io/env_logger/0.9.0 \ + crate://crates.io/errno-dragonfly/0.1.2 \ + crate://crates.io/errno/0.2.8 \ + crate://crates.io/fastrand/1.6.0 \ + crate://crates.io/generic-array/0.14.5 \ + crate://crates.io/getrandom/0.2.3 \ + crate://crates.io/hermit-abi/0.1.19 \ + crate://crates.io/hmac/0.11.0 \ + crate://crates.io/httparse/1.5.1 \ + crate://crates.io/humantime/2.1.0 \ + crate://crates.io/instant/0.1.12 \ + crate://crates.io/lazy_static/1.4.0 \ + crate://crates.io/libc/0.2.112 \ + crate://crates.io/libsystemd/0.4.1 \ + crate://crates.io/log/0.4.14 \ + crate://crates.io/memchr/2.4.1 \ + crate://crates.io/memoffset/0.6.5 \ + crate://crates.io/mio/0.8.0 \ + crate://crates.io/miow/0.3.7 \ + crate://crates.io/nix/0.23.1 \ + crate://crates.io/ntapi/0.3.6 \ + crate://crates.io/num-integer/0.1.44 \ + crate://crates.io/num-traits/0.2.14 \ + crate://crates.io/num_cpus/1.13.1 \ + crate://crates.io/once_cell/1.9.0 \ + crate://crates.io/opaque-debug/0.3.0 \ + crate://crates.io/paste/1.0.6 \ + crate://crates.io/ppv-lite86/0.2.16 \ + crate://crates.io/proc-macro2/1.0.36 \ + crate://crates.io/python3-sys/0.7.0 \ + crate://crates.io/quote/1.0.14 \ + crate://crates.io/rand/0.8.4 \ + crate://crates.io/rand_chacha/0.3.1 \ + crate://crates.io/rand_core/0.6.3 \ + crate://crates.io/rand_hc/0.3.1 \ + crate://crates.io/redox_syscall/0.2.10 \ + crate://crates.io/regex-syntax/0.6.25 \ + crate://crates.io/regex/1.5.4 \ + crate://crates.io/remove_dir_all/0.5.3 \ + crate://crates.io/scopeguard/1.1.0 \ + crate://crates.io/serde/1.0.133 \ + crate://crates.io/serde_derive/1.0.133 \ + crate://crates.io/sha2/0.9.9 \ + crate://crates.io/simplelog/0.11.1 \ + crate://crates.io/spmc/0.3.0 \ + crate://crates.io/subtle/2.4.1 \ + crate://crates.io/syn/1.0.85 \ + crate://crates.io/tempfile/3.3.0 \ + crate://crates.io/termcolor/1.1.2 \ + crate://crates.io/thiserror-impl/1.0.30 \ + crate://crates.io/thiserror/1.0.30 \ + crate://crates.io/threadpool/1.8.1 \ + crate://crates.io/time/0.1.44 \ + crate://crates.io/typenum/1.15.0 \ + crate://crates.io/unicode-xid/0.2.2 \ + crate://crates.io/urlencoding/2.1.0 \ + crate://crates.io/uuid/0.8.2 \ + crate://crates.io/version_check/0.9.4 \ + crate://crates.io/wasi/0.10.0+wasi-snapshot-preview1 \ + crate://crates.io/winapi-i686-pc-windows-gnu/0.4.0 \ + crate://crates.io/winapi-util/0.1.5 \ + crate://crates.io/winapi-x86_64-pc-windows-gnu/0.4.0 \ + crate://crates.io/winapi/0.3.9 \ +" + +# The following configs & dependencies are from setuptools extras_require. +# These dependencies are optional, hence can be controlled via PACKAGECONFIG. +# The upstream names may not correspond exactly to bitbake package names. +# +# Uncomment this line to enable all the optional features. +#PACKAGECONFIG ?= "test" +PACKAGECONFIG[test] = ",,,python3-pytest python3-requests" + +# WARNING: the following rdepends are determined through basic analysis of the +# python sources, and might not be 100% accurate. +RDEPENDS:${PN} += "python3-core" --2.30.2
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#94879): https://lists.openembedded.org/g/openembedded-devel/message/94879
Mute This Topic: https://lists.openembedded.org/mt/88458053/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [oe] [meta-python][PATCH 4/7] python3-pyruvate: add recipe for v1.1.2
Quoted 5 lines · Khem Raj
this fail on mips see
https://errors.yoctoproject.org/Errors/Details/622699/
error[E0432]: unresolved imports
core::sync::atomic::AtomicI64,core::sync::atomic::AtomicU64
--> /usr/src/debug/python3-pyruvate/1.1.2-r0/cargo_home/bitbake/crossbeam-utils-0.8.6/src/lib.rs:79:49
|
79 | pub(crate) use core::sync::atomic::{AtomicI64, AtomicU64};
| ^^^^^^^^^
^^^^^^^^^ no `AtomicU64` in `sync::atomic`
| |
| no `AtomicI64` in
`sync::atomic`
|
help: a similar name exists in the module
|
79 | pub(crate) use core::sync::atomic::{AtomicI8, AtomicU64};
| ~~~~~~~~help: a similar name exists in the module
|
79 | pub(crate) use core::sync::atomic::{AtomicI64, AtomicU8};
| ~~~~~~~~
Probably need to disable for mips32 as it doesn't have support in rust?
Quoted 164 lines · Tim Orling
Quoted 11 lines
Pyruvate is a reasonably fast, multithreaded, non-blocking WSGI server implemented in Rust.
This recipe uses the new
setuptools3_rustand pyo3 classes.Signed-off-by Tim Orling <[email protected]>--- .../python/python3-pyruvate_1.1.2.bb | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb
Review
Quoted 2 lines
(quoted diff) +0
-0python3-pyruvate_1.1.2.bb b/meta-python/recipes-devtools/python/ python3-pyruvate_1.1.2.bb
meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb line 2
Quoted 7 lines
new file mode 100644
index 0000000000..835cf9a93dmeta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb new file +2
-0@@ -0,0 +1,119 @@ +SUMMARY = "WSGI server implemented in Rust." +DESCRIPTION = "Pyruvate is a reasonably fast, multithreaded,non-blocking \
meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb
Quoted 6 lines
meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb new file +6
-0+WSGI server implemented in Rust." +HOMEPAGE = "https://gitlab.com/tschorr/pyruvate" +BUGTRACKER = "https://gitlab.com/tschorr/pyruvate/-/issues" + +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://LICENSE;md5=051b48e640a6e2d795eac75542d9417c\
meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb line 9
Quoted 1 line
meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb new file +1
-0+file://LICENSE.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263"
meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb line 11
Quoted 2 lines
meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb new file +2
-0+ +SRC_URI[sha256sum] ="
10befedd97e73fc18b902d02aa3b24e8978aa162242c1b664849c886c0675899"Quoted 88 lines
meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb new file +88
-0+ +S = "${WORKDIR}/pyruvate-${PV}" + +inherit pypi setuptools3_rust + +SRC_URI += " \ + crate://crates.io/aho-corasick/0.7.18 \ + crate://crates.io/atty/0.2.14 \ + crate://crates.io/autocfg/1.0.1 \ + crate://crates.io/bitflags/1.3.2 \ + crate://crates.io/block-buffer/0.9.0 \ + crate://crates.io/cc/1.0.72 \ + crate://crates.io/cfg-if/1.0.0 \ + crate://crates.io/chrono/0.4.19 \ + crate://crates.io/cpufeatures/0.2.1 \ + crate://crates.io/cpython/0.7.0 \ + crate://crates.io/crossbeam-channel/0.5.2 \ + crate://crates.io/crossbeam-deque/0.8.1 \ + crate://crates.io/crossbeam-epoch/0.9.6 \ + crate://crates.io/crossbeam-queue/0.3.3 \ + crate://crates.io/crossbeam-utils/0.8.6 \ + crate://crates.io/crossbeam/0.8.1 \ + crate://crates.io/crypto-mac/0.11.1 \ + crate://crates.io/ctrlc/3.2.1 \ + crate://crates.io/digest/0.9.0 \ + crate://crates.io/encoding-index-japanese/1.20141219.5 \ + crate://crates.io/encoding-index-korean/1.20141219.5 \ + crate://crates.io/encoding-index-simpchinese/1.20141219.5 \ + crate://crates.io/encoding-index-singlebyte/1.20141219.5 \ + crate://crates.io/encoding-index-tradchinese/1.20141219.5 \ + crate://crates.io/encoding/0.2.33 \ + crate://crates.io/encoding_index_tests/0.1.4 \ + crate://crates.io/env_logger/0.9.0 \ + crate://crates.io/errno-dragonfly/0.1.2 \ + crate://crates.io/errno/0.2.8 \ + crate://crates.io/fastrand/1.6.0 \ + crate://crates.io/generic-array/0.14.5 \ + crate://crates.io/getrandom/0.2.3 \ + crate://crates.io/hermit-abi/0.1.19 \ + crate://crates.io/hmac/0.11.0 \ + crate://crates.io/httparse/1.5.1 \ + crate://crates.io/humantime/2.1.0 \ + crate://crates.io/instant/0.1.12 \ + crate://crates.io/lazy_static/1.4.0 \ + crate://crates.io/libc/0.2.112 \ + crate://crates.io/libsystemd/0.4.1 \ + crate://crates.io/log/0.4.14 \ + crate://crates.io/memchr/2.4.1 \ + crate://crates.io/memoffset/0.6.5 \ + crate://crates.io/mio/0.8.0 \ + crate://crates.io/miow/0.3.7 \ + crate://crates.io/nix/0.23.1 \ + crate://crates.io/ntapi/0.3.6 \ + crate://crates.io/num-integer/0.1.44 \ + crate://crates.io/num-traits/0.2.14 \ + crate://crates.io/num_cpus/1.13.1 \ + crate://crates.io/once_cell/1.9.0 \ + crate://crates.io/opaque-debug/0.3.0 \ + crate://crates.io/paste/1.0.6 \ + crate://crates.io/ppv-lite86/0.2.16 \ + crate://crates.io/proc-macro2/1.0.36 \ + crate://crates.io/python3-sys/0.7.0 \ + crate://crates.io/quote/1.0.14 \ + crate://crates.io/rand/0.8.4 \ + crate://crates.io/rand_chacha/0.3.1 \ + crate://crates.io/rand_core/0.6.3 \ + crate://crates.io/rand_hc/0.3.1 \ + crate://crates.io/redox_syscall/0.2.10 \ + crate://crates.io/regex-syntax/0.6.25 \ + crate://crates.io/regex/1.5.4 \ + crate://crates.io/remove_dir_all/0.5.3 \ + crate://crates.io/scopeguard/1.1.0 \ + crate://crates.io/serde/1.0.133 \ + crate://crates.io/serde_derive/1.0.133 \ + crate://crates.io/sha2/0.9.9 \ + crate://crates.io/simplelog/0.11.1 \ + crate://crates.io/spmc/0.3.0 \ + crate://crates.io/subtle/2.4.1 \ + crate://crates.io/syn/1.0.85 \ + crate://crates.io/tempfile/3.3.0 \ + crate://crates.io/termcolor/1.1.2 \ + crate://crates.io/thiserror-impl/1.0.30 \ + crate://crates.io/thiserror/1.0.30 \ + crate://crates.io/threadpool/1.8.1 \ + crate://crates.io/time/0.1.44 \ + crate://crates.io/typenum/1.15.0 \ + crate://crates.io/unicode-xid/0.2.2 \ + crate://crates.io/urlencoding/2.1.0 \meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb
Quoted 10 lines
meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb new file +10
-0+ crate://crates.io/uuid/0.8.2 \ + crate://crates.io/version_check/0.9.4 \ + crate://crates.io/wasi/0.10.0+wasi-snapshot-preview1 \ + crate://crates.io/winapi-i686-pc-windows-gnu/0.4.0 \ + crate://crates.io/winapi-util/0.1.5 \ + crate://crates.io/winapi-x86_64-pc-windows-gnu/0.4.0 \ + crate://crates.io/winapi/0.3.9 \ +" + +# The following configs & dependencies are from setuptools
extras_require.meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb line 110
Quoted 1 line
meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb new file +1
-0+# These dependencies are optional, hence can be controlled viaPACKAGECONFIG.
meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb line 111
Quoted 1 line
meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb new file +1
-0+# The upstream names may not correspond exactly to bitbake packagenames.
meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb
Quoted 6 lines
meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb new file +6
-0+# +# Uncomment this line to enable all the optional features. +#PACKAGECONFIG ?= "test" +PACKAGECONFIG[test] = ",,,python3-pytest python3-requests" + +# WARNING: the following rdepends are determined through basic analysisof the
Quoted 9 lines
meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb new file +2
-1+# python sources, and might not be 100% accurate. +RDEPENDS:${PN} += "python3-core" --2.30.2
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#94879):https://lists.openembedded.org/g/openembedded-devel/message/94879
Quoted 3 lines
Mute This Topic: https://lists.openembedded.org/mt/88458053/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [Quoted 2 lines
-=-=-=-=-=-=-=-=-=-=-=-
Hi,
This seems to be causing build break for nativesdk builds. nativesdk-python3-cryptography:
running build_rust
error: Error loading target specification: Could not find specification for target "x86_64-pokysdk-linux". Run rustc --print target-list for a list of built-in targets
The same build for target gives only warning:
running build_rust
warning: build_rust: Forced Rust target aarch64-poky-linux is not compatible with deduced Rust target aarch64-unknown-linux-gnu - the built package may not import successfully once installed.
-samuli
Quoted 125 lines · Tim Orling
This series upgrades python3-cryptography from the last version to be purely Python/C extensions (3.3.2) to the latest version which also includes Rust extensions (36.0.1).
This has been tested (including full ptest runs) on:
- qemux86-64
- qemux86-musl
- qemuarm64The test cases require an absolute minimum of 1 GB of free memory according to the documentation, but in practice it was more performant to have 2 GB of free memory. For this reason a
check-memfree.pytest is added to run-ptest to avoid OOM/Exit code 9 in the ptest-runner. The test cases were run with:runqemu nographic slirp qemuparams="-m 2176 -smp 4"
On x86-64 with kvm this takes about 5 minutes.
The results are 2856+/-2 passed, 1654+/-2 skipped. Of the skipped tests 1600 of them are because of unsupported "counter location
middle_fixed" in https://github.com/pyca/cryptography/pull/2773. A further ~35 test cases are skipped because of not setting --wychefproof-root, but even when the Google wychefproof repository is cloned and the option is set, it adds another ~5000 skipped test cases:Upstream uses python3-pytest-xdist to parallize test cases (and python3-pytest-shard to distribute amongst workers), but this uses stdin/stdout and therefore we have no output to ptest-runner.
This series introduces two helper classes pyo3.bbclass and setuptools_rust.bbclass for Python/Rust projects.
The setuptools_rust.bbclass wraps PyO3, Cargo and the newly added python3-setuptools-rust-native recipe. Since oe-core only supports native rustc at this time, only a native recipe is provided.
To demonstrate that these classes are applicable to multiple recipes, we also introduce python3-pyruvate, a WSGI implementation in Rust.
While we are at it we upgrade python3-pytest-subtests from 0.5.0 to 0.6.0.
The following changes since commit
df5c1a31fdb8325d1c514f9ed8a7b3805dc581ac:python3-diskcache: Upgrade 5.3.0 -> 5.4.0 (2022-01-10 10:35:02 -0800)
are available in the Git repository at:
git://git.openembedded.org/meta-openembedded-contrib
timo/python3-cryptography_36.0.1http://cgit.openembedded.org/meta-openembedded-contrib/log/?h=timo/python3-cryptography_36.0.1
Tim Orling (7):
python3-setuptools-rust-native: add v1.1.2 recipe pyo3.bbclass: add class for PyO3 cross-compilation setuptools3_rust.bbclass: setuptoools Rust plugin
python3-pyruvate: add recipe for v1.1.2
python3-pytest-subtests: upgrade 0.5.0 -> 0.6.0 python3-cryptography-vectors: upgrade 35.0.0 => 36.0.1
python3-cryptography: upgrade 3.3.2 -> 36.0.1meta-python/classes/pyo3.bbclass | 30 +++++ meta-python/classes/setuptools3_rust.bbclass | 11 ++ ...=> python3-cryptography-vectors_36.0.1.bb} | 5 +- .../0001-Cargo.toml-specify-pem-version.patch | 31 +++++ .../0002-Cargo.toml-edition-2018-2021.patch | 28 ++++ .../python3-cryptography/check-memfree.py | 10 ++ .../python/python3-cryptography/h-test.patch | 10 -- .../python3-cryptography/openssl3.patch | 62 --------- .../python/python3-cryptography/run-ptest | 4 +- .../python/python3-cryptography_3.3.2.bb | 68 ---------- .../python/python3-cryptography_36.0.1.bb | 121 ++++++++++++++++++ .../python/python3-pyruvate_1.1.2.bb | 119 +++++++++++++++++ .../python/python3-pytest-subtests_0.5.0.bb | 16 --- .../python/python3-pytest-subtests_0.6.0.bb | 20 +++ .../python3-setuptools-rust-native_1.1.2.bb | 26 ++++ 15 files changed, 403 insertions(+), 158 deletions(-) create mode 100644 meta-python/classes/pyo3.bbclass create mode 100644 meta-python/classes/setuptools3_rust.bbclass rename meta-python/recipes-devtools/python/{ python3-cryptography-vectors_35.0.0.bb => python3-cryptography-vectors_36.0.1.bb} (72%) create mode 100644 meta-python/recipes-devtools/python/python3-cryptography/0001-Cargo.toml-specify-pem-version.patch create mode 100644 meta-python/recipes-devtools/python/python3-cryptography/0002-Cargo.toml-edition-2018-2021.patch create mode 100755 meta-python/recipes-devtools/python/python3-cryptography/check-memfree.py delete mode 100644 meta-python/recipes-devtools/python/python3-cryptography/h-test.patch delete mode 100644 meta-python/recipes-devtools/python/python3-cryptography/openssl3.patch delete mode 100644 meta-python/recipes-devtools/python/ python3-cryptography_3.3.2.bb create mode 100644 meta-python/recipes-devtools/python/ python3-cryptography_36.0.1.bb create mode 100644 meta-python/recipes-devtools/python/ python3-pyruvate_1.1.2.bb delete mode 100644 meta-python/recipes-devtools/python/ python3-pytest-subtests_0.5.0.bb create mode 100644 meta-python/recipes-devtools/python/ python3-pytest-subtests_0.6.0.bb create mode 100644 meta-python/recipes-devtools/python/python3-setuptools-rust-native_1.1.2.bb
--
2.30.2-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#94875):
https://lists.openembedded.org/g/openembedded-devel/message/94875
Mute This Topic: https://lists.openembedded.org/mt/88458046/3617605
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [oe] [meta-python][PATCH 7/7] python3-cryptography: upgrade 3.3.2 -> 36.0.1
In reply to Tim OrlingThis results in a broken python3-cryptography-native:
$ bitbake trusted-firmware-m -c devshell $ nativepython3
Quoted 1 line
Quoted 1 line
Quoted 1 line
import cryptography.hazmat.backends.openssl.backend
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/yocto/ross/build/tmp/work/musca_b1-poky-eabi/trusted-firmware-m/1.5.0-r0/recipe-sysroot-native/usr/lib/python3.10/site-packages/cryptography/hazmat/backends/openssl/__init__.py",
line 6, in <module>
from cryptography.hazmat.backends.openssl.backend import backend
File "/yocto/ross/build/tmp/work/musca_b1-poky-eabi/trusted-firmware-m/1.5.0-r0/recipe-sysroot-native/usr/lib/python3.10/site-packages/cryptography/hazmat/backends/openssl/backend.py",
line 64, in <module>
from cryptography.hazmat.bindings.openssl import binding
File "/yocto/ross/build/tmp/work/musca_b1-poky-eabi/trusted-firmware-m/1.5.0-r0/recipe-sysroot-native/usr/lib/python3.10/site-packages/cryptography/hazmat/bindings/openssl/binding.py",
line 205, in <module>
Binding.init_static_locks()
File "/yocto/ross/build/tmp/work/musca_b1-poky-eabi/trusted-firmware-m/1.5.0-r0/recipe-sysroot-native/usr/lib/python3.10/site-packages/cryptography/hazmat/bindings/openssl/binding.py",
line 179, in init_static_locks
cls._ensure_ffi_initialized()
File "/yocto/ross/build/tmp/work/musca_b1-poky-eabi/trusted-firmware-m/1.5.0-r0/recipe-sysroot-native/usr/lib/python3.10/site-packages/cryptography/hazmat/bindings/openssl/binding.py",
line 167, in _ensure_ffi_initialized
_openssl_assert(
File "/yocto/ross/build/tmp/work/musca_b1-poky-eabi/trusted-firmware-m/1.5.0-r0/recipe-sysroot-native/usr/lib/python3.10/site-packages/cryptography/hazmat/bindings/openssl/binding.py",
line 77, in _openssl_assert
raise InternalError(cryptography.exceptions.InternalError: Unknown OpenSSL error. This error is commonly encountered when another library is not cleaning up the OpenSSL error stack. If you are using cryptography with another library that uses OpenSSL try disabling it before reporting a bug. Otherwise please file an issue at
https://github.com/pyca/cryptography/issues with information on how to reproduce this. ([_OpenSSLErrorWithText(code=310378599, lib=37, reason=103, reason_text=b'error:12800067:DSO support routines::could not load the shared library'), _OpenSSLErrorWithText(code=310378599, lib=37, reason=103, reason_text=b'error:12800067:DSO support routines::could not load the shared library'), _OpenSSLErrorWithText(code=126615813, lib=15, reason=786693, reason_text=b'error:078C0105:common libcrypto routines::init fail')])
Initial hunch is that python3-native is linking to the host libssl but crypto is linking to our libssl.
Ross
Quoted 10 lines · Samuli Piippo
Hi,
This seems to be causing build break for nativesdk builds. nativesdk-python3-cryptography:
runningbuild_rust
error: Error loading target specification: Could not find specification for target "x86_64-pokysdk-linux". Runrustc --print target-listfor a list of built-in targetsWe seem to have a problem with Rust in SDK in general, so this is a Rust
toolchain problem not a python3-cryptography nor setuptools_rust problem. But that's all I can say for certain.
Quoted 138 lines
The same build for target gives only warning:
runningbuild_rust
warning:build_rust: Forced Rust targetaarch64-poky-linuxis not compatible with deduced Rust targetaarch64-unknown-linux-gnu- the built package may not import successfully once installed.This warning seems to be harmless, but I don't know how to "fix it".
-samuli
Quoted 125 lines · Tim Orling
This series upgrades python3-cryptography from the last version to be purely Python/C extensions (3.3.2) to the latest version which also includes Rust extensions (36.0.1).
This has been tested (including full ptest runs) on:
- qemux86-64
- qemux86-musl
- qemuarm64The test cases require an absolute minimum of 1 GB of free memory according to the documentation, but in practice it was more performant to have 2 GB of free memory. For this reason a
check-memfree.pytest is added to run-ptest to avoid OOM/Exit code 9 in the ptest-runner. The test cases were run with:runqemu nographic slirp qemuparams="-m 2176 -smp 4"
On x86-64 with kvm this takes about 5 minutes.
The results are 2856+/-2 passed, 1654+/-2 skipped. Of the skipped tests 1600 of them are because of unsupported "counter location
middle_fixed" in https://github.com/pyca/cryptography/pull/2773. A further ~35 test cases are skipped because of not setting --wychefproof-root, but even when the Google wychefproof repository is cloned and the option is set, it adds another ~5000 skipped test cases:Upstream uses python3-pytest-xdist to parallize test cases (and python3-pytest-shard to distribute amongst workers), but this uses stdin/stdout and therefore we have no output to ptest-runner.
This series introduces two helper classes pyo3.bbclass and setuptools_rust.bbclass for Python/Rust projects.
The setuptools_rust.bbclass wraps PyO3, Cargo and the newly added python3-setuptools-rust-native recipe. Since oe-core only supports native rustc at this time, only a native recipe is provided.
To demonstrate that these classes are applicable to multiple recipes, we also introduce python3-pyruvate, a WSGI implementation in Rust.
While we are at it we upgrade python3-pytest-subtests from 0.5.0 to 0.6.0.
The following changes since commit
df5c1a31fdb8325d1c514f9ed8a7b3805dc581ac:python3-diskcache: Upgrade 5.3.0 -> 5.4.0 (2022-01-10 10:35:02 -0800)
are available in the Git repository at:
git://git.openembedded.org/meta-openembedded-contrib
timo/python3-cryptography_36.0.1http://cgit.openembedded.org/meta-openembedded-contrib/log/?h=timo/python3-cryptography_36.0.1
Tim Orling (7):
python3-setuptools-rust-native: add v1.1.2 recipe pyo3.bbclass: add class for PyO3 cross-compilation setuptools3_rust.bbclass: setuptoools Rust plugin
python3-pyruvate: add recipe for v1.1.2
python3-pytest-subtests: upgrade 0.5.0 -> 0.6.0 python3-cryptography-vectors: upgrade 35.0.0 => 36.0.1
python3-cryptography: upgrade 3.3.2 -> 36.0.1meta-python/classes/pyo3.bbclass | 30 +++++ meta-python/classes/setuptools3_rust.bbclass | 11 ++ ...=> python3-cryptography-vectors_36.0.1.bb} | 5 +- .../0001-Cargo.toml-specify-pem-version.patch | 31 +++++ .../0002-Cargo.toml-edition-2018-2021.patch | 28 ++++ .../python3-cryptography/check-memfree.py | 10 ++ .../python/python3-cryptography/h-test.patch | 10 -- .../python3-cryptography/openssl3.patch | 62 --------- .../python/python3-cryptography/run-ptest | 4 +- .../python/python3-cryptography_3.3.2.bb | 68 ---------- .../python/python3-cryptography_36.0.1.bb | 121 ++++++++++++++++++ .../python/python3-pyruvate_1.1.2.bb | 119 +++++++++++++++++ .../python/python3-pytest-subtests_0.5.0.bb | 16 --- .../python/python3-pytest-subtests_0.6.0.bb | 20 +++ .../python3-setuptools-rust-native_1.1.2.bb | 26 ++++ 15 files changed, 403 insertions(+), 158 deletions(-) create mode 100644 meta-python/classes/pyo3.bbclass create mode 100644 meta-python/classes/setuptools3_rust.bbclass rename meta-python/recipes-devtools/python/{ python3-cryptography-vectors_35.0.0.bb => python3-cryptography-vectors_36.0.1.bb} (72%) create mode 100644 meta-python/recipes-devtools/python/python3-cryptography/0001-Cargo.toml-specify-pem-version.patch create mode 100644 meta-python/recipes-devtools/python/python3-cryptography/0002-Cargo.toml-edition-2018-2021.patch create mode 100755 meta-python/recipes-devtools/python/python3-cryptography/check-memfree.py delete mode 100644 meta-python/recipes-devtools/python/python3-cryptography/h-test.patch delete mode 100644 meta-python/recipes-devtools/python/python3-cryptography/openssl3.patch delete mode 100644 meta-python/recipes-devtools/python/ python3-cryptography_3.3.2.bb create mode 100644 meta-python/recipes-devtools/python/ python3-cryptography_36.0.1.bb create mode 100644 meta-python/recipes-devtools/python/ python3-pyruvate_1.1.2.bb delete mode 100644 meta-python/recipes-devtools/python/ python3-pytest-subtests_0.5.0.bb create mode 100644 meta-python/recipes-devtools/python/ python3-pytest-subtests_0.6.0.bb create mode 100644 meta-python/recipes-devtools/python/python3-setuptools-rust-native_1.1.2.bb
--
2.30.2-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#94875):
https://lists.openembedded.org/g/openembedded-devel/message/94875
Mute This Topic: https://lists.openembedded.org/mt/88458046/3617605
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-