All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-python][PATCH 0/7] setuptools-rust and python3-cryptography
@ 2022-01-16  5:28 Tim Orling
  2022-01-16  5:28 ` [meta-python][PATCH 1/7] python3-setuptools-rust-native: add v1.1.2 recipe Tim Orling
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Tim Orling @ 2022-01-16  5:28 UTC (permalink / raw)
  To: openembedded-devel

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.bb

-- 
2.30.2



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [meta-python][PATCH 1/7] python3-setuptools-rust-native: add v1.1.2 recipe
  2022-01-16  5:28 [meta-python][PATCH 0/7] setuptools-rust and python3-cryptography Tim Orling
@ 2022-01-16  5:28 ` Tim Orling
  2022-01-16  5:28 ` [meta-python][PATCH 2/7] pyo3.bbclass: add class for PyO3 cross-compilation Tim Orling
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Tim Orling @ 2022-01-16  5:28 UTC (permalink / raw)
  To: openembedded-devel

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.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 .../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

diff --git a/meta-python/recipes-devtools/python/python3-setuptools-rust-native_1.1.2.bb b/meta-python/recipes-devtools/python/python3-setuptools-rust-native_1.1.2.bb
new file mode 100644
index 0000000000..34ff91241f
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-setuptools-rust-native_1.1.2.bb
@@ -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 \
+"
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [meta-python][PATCH 2/7] pyo3.bbclass: add class for PyO3 cross-compilation
  2022-01-16  5:28 [meta-python][PATCH 0/7] setuptools-rust and python3-cryptography Tim Orling
  2022-01-16  5:28 ` [meta-python][PATCH 1/7] python3-setuptools-rust-native: add v1.1.2 recipe Tim Orling
@ 2022-01-16  5:28 ` Tim Orling
  2022-01-16  5:29 ` [meta-python][PATCH 3/7] setuptools3_rust.bbclass: setuptoools Rust plugin Tim Orling
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Tim Orling @ 2022-01-16  5:28 UTC (permalink / raw)
  To: openembedded-devel

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>
---
 meta-python/classes/pyo3.bbclass | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 meta-python/classes/pyo3.bbclass

diff --git a/meta-python/classes/pyo3.bbclass b/meta-python/classes/pyo3.bbclass
new file mode 100644
index 0000000000..4bae0949e5
--- /dev/null
+++ b/meta-python/classes/pyo3.bbclass
@@ -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
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [meta-python][PATCH 3/7] setuptools3_rust.bbclass: setuptoools Rust plugin
  2022-01-16  5:28 [meta-python][PATCH 0/7] setuptools-rust and python3-cryptography Tim Orling
  2022-01-16  5:28 ` [meta-python][PATCH 1/7] python3-setuptools-rust-native: add v1.1.2 recipe Tim Orling
  2022-01-16  5:28 ` [meta-python][PATCH 2/7] pyo3.bbclass: add class for PyO3 cross-compilation Tim Orling
@ 2022-01-16  5:29 ` Tim Orling
  2022-01-16  5:29 ` [meta-python][PATCH 4/7] python3-pyruvate: add recipe for v1.1.2 Tim Orling
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Tim Orling @ 2022-01-16  5:29 UTC (permalink / raw)
  To: openembedded-devel

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-python/classes/setuptools3_rust.bbclass | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 meta-python/classes/setuptools3_rust.bbclass

diff --git a/meta-python/classes/setuptools3_rust.bbclass b/meta-python/classes/setuptools3_rust.bbclass
new file mode 100644
index 0000000000..fb11f08f89
--- /dev/null
+++ b/meta-python/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.30.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [meta-python][PATCH 4/7] python3-pyruvate: add recipe for v1.1.2
  2022-01-16  5:28 [meta-python][PATCH 0/7] setuptools-rust and python3-cryptography Tim Orling
                   ` (2 preceding siblings ...)
  2022-01-16  5:29 ` [meta-python][PATCH 3/7] setuptools3_rust.bbclass: setuptoools Rust plugin Tim Orling
@ 2022-01-16  5:29 ` Tim Orling
  2022-01-18 17:15   ` [oe] " Khem Raj
  2022-01-16  5:29 ` [meta-python][PATCH 5/7] python3-pytest-subtests: upgrade 0.5.0 -> 0.6.0 Tim Orling
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Tim Orling @ 2022-01-16  5:29 UTC (permalink / raw)
  To: openembedded-devel

Pyruvate is a reasonably fast, multithreaded, non-blocking WSGI server
implemented in Rust.

This recipe uses the new setuptools3_rust and pyo3 classes.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 .../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

diff --git a/meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb b/meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb
new file mode 100644
index 0000000000..835cf9a93d
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb
@@ -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



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [meta-python][PATCH 5/7] python3-pytest-subtests: upgrade 0.5.0 -> 0.6.0
  2022-01-16  5:28 [meta-python][PATCH 0/7] setuptools-rust and python3-cryptography Tim Orling
                   ` (3 preceding siblings ...)
  2022-01-16  5:29 ` [meta-python][PATCH 4/7] python3-pyruvate: add recipe for v1.1.2 Tim Orling
@ 2022-01-16  5:29 ` Tim Orling
  2022-01-16  5:29 ` [meta-python][PATCH 6/7] python3-cryptography-vectors: upgrade 35.0.0 => 36.0.1 Tim Orling
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Tim Orling @ 2022-01-16  5:29 UTC (permalink / raw)
  To: openembedded-devel

0.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

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 .../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

diff --git a/meta-python/recipes-devtools/python/python3-pytest-subtests_0.5.0.bb b/meta-python/recipes-devtools/python/python3-pytest-subtests_0.5.0.bb
deleted file mode 100644
index 2e03512bde..0000000000
--- a/meta-python/recipes-devtools/python/python3-pytest-subtests_0.5.0.bb
+++ /dev/null
@@ -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"
diff --git a/meta-python/recipes-devtools/python/python3-pytest-subtests_0.6.0.bb b/meta-python/recipes-devtools/python/python3-pytest-subtests_0.6.0.bb
new file mode 100644
index 0000000000..5e4847b8d9
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-pytest-subtests_0.6.0.bb
@@ -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"
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [meta-python][PATCH 6/7] python3-cryptography-vectors: upgrade 35.0.0 => 36.0.1
  2022-01-16  5:28 [meta-python][PATCH 0/7] setuptools-rust and python3-cryptography Tim Orling
                   ` (4 preceding siblings ...)
  2022-01-16  5:29 ` [meta-python][PATCH 5/7] python3-pytest-subtests: upgrade 0.5.0 -> 0.6.0 Tim Orling
@ 2022-01-16  5:29 ` Tim Orling
  2022-01-16  5:29 ` [meta-python][PATCH 7/7] python3-cryptography: upgrade 3.3.2 -> 36.0.1 Tim Orling
  2022-01-19 12:13 ` [oe] [meta-python][PATCH 0/7] setuptools-rust and python3-cryptography Samuli Piippo
  7 siblings, 0 replies; 13+ messages in thread
From: Tim Orling @ 2022-01-16  5:29 UTC (permalink / raw)
  To: openembedded-devel

Add 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)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 ...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%)

diff --git a/meta-python/recipes-devtools/python/python3-cryptography-vectors_35.0.0.bb b/meta-python/recipes-devtools/python/python3-cryptography-vectors_36.0.1.bb
similarity index 72%
rename from meta-python/recipes-devtools/python/python3-cryptography-vectors_35.0.0.bb
rename to meta-python/recipes-devtools/python/python3-cryptography-vectors_36.0.1.bb
index c0ab9c85c1..b9e6b811c3 100644
--- a/meta-python/recipes-devtools/python/python3-cryptography-vectors_35.0.0.bb
+++ b/meta-python/recipes-devtools/python/python3-cryptography-vectors_36.0.1.bb
@@ -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"
 
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [meta-python][PATCH 7/7] python3-cryptography: upgrade 3.3.2 -> 36.0.1
  2022-01-16  5:28 [meta-python][PATCH 0/7] setuptools-rust and python3-cryptography Tim Orling
                   ` (5 preceding siblings ...)
  2022-01-16  5:29 ` [meta-python][PATCH 6/7] python3-cryptography-vectors: upgrade 35.0.0 => 36.0.1 Tim Orling
@ 2022-01-16  5:29 ` Tim Orling
  2022-01-19 12:51   ` [oe] " Ross Burton
  2022-01-19 12:13 ` [oe] [meta-python][PATCH 0/7] setuptools-rust and python3-cryptography Samuli Piippo
  7 siblings, 1 reply; 13+ messages in thread
From: Tim Orling @ 2022-01-16  5:29 UTC (permalink / raw)
  To: openembedded-devel

See 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

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 .../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

diff --git a/meta-python/recipes-devtools/python/python3-cryptography/0001-Cargo.toml-specify-pem-version.patch b/meta-python/recipes-devtools/python/python3-cryptography/0001-Cargo.toml-specify-pem-version.patch
new file mode 100644
index 0000000000..d7ab757bb5
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-cryptography/0001-Cargo.toml-specify-pem-version.patch
@@ -0,0 +1,31 @@
+From ec8d3f3c61280c8140b34ed1479baef5e706f064 Mon Sep 17 00:00:00 2001
+From: Tim Orling <tim.orling@konsulko.com>
+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 <tim.orling@konsulko.com>
+---
+ 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
+
diff --git a/meta-python/recipes-devtools/python/python3-cryptography/0002-Cargo.toml-edition-2018-2021.patch b/meta-python/recipes-devtools/python/python3-cryptography/0002-Cargo.toml-edition-2018-2021.patch
new file mode 100644
index 0000000000..366e3a4d39
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-cryptography/0002-Cargo.toml-edition-2018-2021.patch
@@ -0,0 +1,28 @@
+From 4b73298b214a5b69ea6edf3c2e21dd82b2b29708 Mon Sep 17 00:00:00 2001
+From: Tim Orling <tim.orling@konsulko.com>
+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 <tim.orling@konsulko.com>
+---
+ 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 <cryptography-dev@python.org>"]
+-edition = "2018"
++edition = "2021"
+ publish = false
+ 
+ [dependencies]
+-- 
+2.30.2
+
diff --git a/meta-python/recipes-devtools/python/python3-cryptography/check-memfree.py b/meta-python/recipes-devtools/python/python3-cryptography/check-memfree.py
new file mode 100755
index 0000000000..c111a9074c
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-cryptography/check-memfree.py
@@ -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))
diff --git a/meta-python/recipes-devtools/python/python3-cryptography/h-test.patch b/meta-python/recipes-devtools/python/python3-cryptography/h-test.patch
deleted file mode 100644
index 9f07c73803..0000000000
--- a/meta-python/recipes-devtools/python/python3-cryptography/h-test.patch
+++ /dev/null
@@ -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")
-+
diff --git a/meta-python/recipes-devtools/python/python3-cryptography/openssl3.patch b/meta-python/recipes-devtools/python/python3-cryptography/openssl3.patch
deleted file mode 100644
index 25baa42cc9..0000000000
--- a/meta-python/recipes-devtools/python/python3-cryptography/openssl3.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-Encourage our old python3-cryptography to at least start to work with OpenSSL 3.
-
-- Backport one patch to err.py to remove a symbol which has been removed in
-  OpenSSL 3, and isn't used in python3-cryptography.
-  (50ec692749b7e2e62685b443f5e629627b03987e)
-
-- Backport the detection of OpenSSL 3 and don't link to FIPS_mode/FIPS_mode_set
-  (parts of f08a7de651f9e6475c8c0a67d2a61ed8b669ddf6)
-
-This is *not* a complete backport of the 3.0 support, but is enough that packages
-such as imgtool can import python3-cryptography and operate until the upgrade is
-ready.
-
-Upstream-Status: Inappropriate
-Signed-off-by: Ross Burton <ross.burton@arm.com>
-
-diff --git a/src/_cffi_src/openssl/cryptography.py b/src/_cffi_src/openssl/cryptography.py
-index f24bee5a..920a86de 100644
---- a/src/_cffi_src/openssl/cryptography.py
-+++ b/src/_cffi_src/openssl/cryptography.py
-@@ -35,6 +35,8 @@ INCLUDES = """
- 
- #define CRYPTOGRAPHY_OPENSSL_110F_OR_GREATER \
-     (OPENSSL_VERSION_NUMBER >= 0x1010006f && !CRYPTOGRAPHY_IS_LIBRESSL)
-+#define CRYPTOGRAPHY_OPENSSL_300_OR_GREATER \
-+    (OPENSSL_VERSION_NUMBER >= 0x30000000 && !CRYPTOGRAPHY_IS_LIBRESSL)
- 
- #define CRYPTOGRAPHY_OPENSSL_LESS_THAN_110J \
-     (OPENSSL_VERSION_NUMBER < 0x101000af || CRYPTOGRAPHY_IS_LIBRESSL)
-@@ -54,6 +56,7 @@ INCLUDES = """
- 
- TYPES = """
- static const int CRYPTOGRAPHY_OPENSSL_110F_OR_GREATER;
-+static const int CRYPTOGRAPHY_OPENSSL_300_OR_GREATER;
- 
- static const int CRYPTOGRAPHY_OPENSSL_LESS_THAN_111;
- static const int CRYPTOGRAPHY_OPENSSL_LESS_THAN_111B;
-diff --git a/src/_cffi_src/openssl/err.py b/src/_cffi_src/openssl/err.py
-index 0dd74146..42bab4d9 100644
---- a/src/_cffi_src/openssl/err.py
-+++ b/src/_cffi_src/openssl/err.py
-@@ -40,7 +40,6 @@ void ERR_clear_error(void);
- void ERR_put_error(int, int, int, const char *, int);
- 
- int ERR_GET_LIB(unsigned long);
--int ERR_GET_FUNC(unsigned long);
- int ERR_GET_REASON(unsigned long);
- 
- """
-diff --git a/src/_cffi_src/openssl/fips.py b/src/_cffi_src/openssl/fips.py
-index c92bca49..38bfa231 100644
---- a/src/_cffi_src/openssl/fips.py
-+++ b/src/_cffi_src/openssl/fips.py
-@@ -18,7 +18,7 @@ int FIPS_mode(void);
- """
- 
- CUSTOMIZATIONS = """
--#if CRYPTOGRAPHY_IS_LIBRESSL
-+#if CRYPTOGRAPHY_IS_LIBRESSL || CRYPTOGRAPHY_OPENSSL_300_OR_GREATER
- static const long Cryptography_HAS_FIPS = 0;
- int (*FIPS_mode_set)(int) = NULL;
- int (*FIPS_mode)(void) = NULL;
diff --git a/meta-python/recipes-devtools/python/python3-cryptography/run-ptest b/meta-python/recipes-devtools/python/python3-cryptography/run-ptest
index 0ba239c2a4..1e97dda63e 100644
--- a/meta-python/recipes-devtools/python/python3-cryptography/run-ptest
+++ b/meta-python/recipes-devtools/python/python3-cryptography/run-ptest
@@ -1,2 +1,4 @@
 #!/bin/sh
-py.test
+if ./check-memfree.py; then
+    pytest -vvvv tests/
+fi
diff --git a/meta-python/recipes-devtools/python/python3-cryptography_3.3.2.bb b/meta-python/recipes-devtools/python/python3-cryptography_3.3.2.bb
deleted file mode 100644
index a4c3344278..0000000000
--- a/meta-python/recipes-devtools/python/python3-cryptography_3.3.2.bb
+++ /dev/null
@@ -1,68 +0,0 @@
-SUMMARY = "Provides cryptographic recipes and primitives to python developers"
-HOMEPAGE = "https://cryptography.io/"
-SECTION = "devel/python"
-LICENSE = "Apache-2.0 | BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=bf405a8056a6647e7d077b0e7bc36aba \
-                    file://LICENSE.APACHE;md5=4e168cce331e5c827d4c2b68a6200e1b \
-                    file://LICENSE.BSD;md5=5ae30ba4123bc4f2fa49aa0b0dce887b"
-
-LDSHARED += "-pthread"
-
-SRC_URI[sha256sum] = "5a60d3780149e13b7a6ff7ad6526b38846354d11a15e21068e57073e29e19bed"
-
-SRC_URI += " \
-    file://run-ptest \
-    file://h-test.patch \
-    file://openssl3.patch \
-"
-
-inherit pypi setuptools3
-
-DEPENDS += " \
-    ${PYTHON_PN}-cffi \
-    ${PYTHON_PN}-cffi-native \
-    ${PYTHON_PN}-asn1crypto \
-    ${PYTHON_PN}-six \
-"
-
-RDEPENDS:${PN} += " \
-    ${PYTHON_PN}-cffi \
-    ${PYTHON_PN}-idna \
-    ${PYTHON_PN}-asn1crypto \
-    ${PYTHON_PN}-setuptools \
-    ${PYTHON_PN}-six \
-"
-
-RDEPENDS:${PN}:class-target += " \
-    ${PYTHON_PN}-cffi \
-    ${PYTHON_PN}-idna \
-    ${PYTHON_PN}-numbers \
-    ${PYTHON_PN}-asn1crypto \
-    ${PYTHON_PN}-setuptools \
-    ${PYTHON_PN}-six \
-    ${PYTHON_PN}-threading \
-"
-
-RDEPENDS:${PN}-ptest += " \
-    ${PN} \
-    ${PYTHON_PN}-cryptography-vectors \
-    ${PYTHON_PN}-iso8601 \
-    ${PYTHON_PN}-pretend \
-    ${PYTHON_PN}-pytest \
-    ${PYTHON_PN}-pytz \
-"
-
-inherit ptest
-
-do_install_ptest() {
-    install -d ${D}${PTEST_PATH}/tests
-    cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
-    install -d ${D}${PTEST_PATH}/tests/hazmat
-    cp -rf ${S}/tests/hazmat/* ${D}${PTEST_PATH}/tests/hazmat/
-}
-
-FILES:${PN}-dbg += " \
-    ${libdir}/${PYTHON_PN}2.7/site-packages/${SRCNAME}/hazmat/bindings/.debug \
-"
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-python/recipes-devtools/python/python3-cryptography_36.0.1.bb b/meta-python/recipes-devtools/python/python3-cryptography_36.0.1.bb
new file mode 100644
index 0000000000..abb15381f5
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-cryptography_36.0.1.bb
@@ -0,0 +1,121 @@
+SUMMARY = "Provides cryptographic recipes and primitives to python developers"
+HOMEPAGE = "https://cryptography.io/"
+SECTION = "devel/python"
+LICENSE = "( Apache-2.0 | BSD-3-Clause ) & PSF-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=bf405a8056a6647e7d077b0e7bc36aba \
+                    file://LICENSE.APACHE;md5=4e168cce331e5c827d4c2b68a6200e1b \
+                    file://LICENSE.BSD;md5=5ae30ba4123bc4f2fa49aa0b0dce887b \
+                    file://LICENSE.PSF;md5=43c37d21e1dbad10cddcd150ba2c0595 \
+                   "
+LDSHARED += "-pthread"
+
+SRC_URI[sha256sum] = "53e5c1dc3d7a953de055d77bef2ff607ceef7a2aac0353b5d630ab67f7423638"
+
+SRC_URI += " \
+    file://run-ptest \
+    file://check-memfree.py \
+    file://0001-Cargo.toml-specify-pem-version.patch \
+    file://0002-Cargo.toml-edition-2018-2021.patch \
+"
+
+inherit pypi setuptools3_rust
+
+DEPENDS += " \
+    ${PYTHON_PN}-asn1crypto-native \
+    ${PYTHON_PN}-cffi-native \
+    ${PYTHON_PN}-setuptools-rust-native \
+    ${PYTHON_PN}-six-native \
+"
+
+SRC_URI += " \
+    crate://crates.io/Inflector/0.11.4 \
+    crate://crates.io/aliasable/0.1.3 \
+    crate://crates.io/asn1/0.8.7 \
+    crate://crates.io/asn1_derive/0.8.7 \
+    crate://crates.io/autocfg/1.0.1 \
+    crate://crates.io/base64/0.13.0 \
+    crate://crates.io/bitflags/1.3.2 \
+    crate://crates.io/cfg-if/1.0.0 \
+    crate://crates.io/chrono/0.4.19 \
+    crate://crates.io/indoc-impl/0.3.6 \
+    crate://crates.io/indoc/0.3.6 \
+    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/lock_api/0.4.5 \
+    crate://crates.io/num-integer/0.1.44 \
+    crate://crates.io/num-traits/0.2.14 \
+    crate://crates.io/once_cell/1.9.0 \
+    crate://crates.io/ouroboros/0.13.0 \
+    crate://crates.io/ouroboros_macro/0.13.0 \
+    crate://crates.io/parking_lot/0.11.2 \
+    crate://crates.io/parking_lot_core/0.8.5 \
+    crate://crates.io/paste-impl/0.1.18 \
+    crate://crates.io/paste/0.1.18 \
+    crate://crates.io/pem/1.0.2 \
+    crate://crates.io/proc-macro-error-attr/1.0.4 \
+    crate://crates.io/proc-macro-error/1.0.4 \
+    crate://crates.io/proc-macro-hack/0.5.19 \
+    crate://crates.io/proc-macro2/1.0.36 \
+    crate://crates.io/pyo3-build-config/0.15.1 \
+    crate://crates.io/pyo3-macros-backend/0.15.1 \
+    crate://crates.io/pyo3-macros/0.15.1 \
+    crate://crates.io/pyo3/0.15.1 \
+    crate://crates.io/quote/1.0.14 \
+    crate://crates.io/redox_syscall/0.2.10 \
+    crate://crates.io/scopeguard/1.1.0 \
+    crate://crates.io/smallvec/1.7.0 \
+    crate://crates.io/stable_deref_trait/1.2.0 \
+    crate://crates.io/syn/1.0.85 \
+    crate://crates.io/unicode-xid/0.2.2 \
+    crate://crates.io/unindent/0.1.7 \
+    crate://crates.io/version_check/0.9.4 \
+    crate://crates.io/winapi-i686-pc-windows-gnu/0.4.0 \
+    crate://crates.io/winapi-x86_64-pc-windows-gnu/0.4.0 \
+    crate://crates.io/winapi/0.3.9 \
+"
+
+RDEPENDS:${PN} += " \
+    ${PYTHON_PN}-asn1crypto \
+    ${PYTHON_PN}-cffi \
+    ${PYTHON_PN}-idna \
+    ${PYTHON_PN}-setuptools \
+    ${PYTHON_PN}-six \
+"
+
+RDEPENDS:${PN}:append:class-target = " \
+    ${PYTHON_PN}-numbers \
+    ${PYTHON_PN}-threading \
+"
+
+RDEPENDS:${PN}-ptest += " \
+    ${PYTHON_PN}-bcrypt \
+    ${PYTHON_PN}-cryptography-vectors \
+    ${PYTHON_PN}-hypothesis \
+    ${PYTHON_PN}-iso8601 \
+    ${PYTHON_PN}-pretend \
+    ${PYTHON_PN}-psutil \
+    ${PYTHON_PN}-pytest \
+    ${PYTHON_PN}-pytest-subtests \
+    ${PYTHON_PN}-pytz \
+"
+
+inherit ptest
+
+do_install_ptest() {
+    install -D ${WORKDIR}/check-memfree.py ${D}${PTEST_PATH}/
+    install -d ${D}${PTEST_PATH}/tests
+    cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+    install -d ${D}${PTEST_PATH}/tests/hazmat
+    cp -rf ${S}/tests/hazmat/* ${D}${PTEST_PATH}/tests/hazmat/
+    cp -r ${S}/pyproject.toml ${D}${PTEST_PATH}/
+}
+
+FILES:${PN}-ptest += " \
+    ${PTEST_PATH}/check-memfree.py \
+"
+FILES:${PN}-dbg += " \
+    ${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}/hazmat/bindings/.debug \
+"
+
+BBCLASSEXTEND = "native nativesdk"
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [oe] [meta-python][PATCH 4/7] python3-pyruvate: add recipe for v1.1.2
  2022-01-16  5:29 ` [meta-python][PATCH 4/7] python3-pyruvate: add recipe for v1.1.2 Tim Orling
@ 2022-01-18 17:15   ` Khem Raj
  2022-01-18 17:22     ` Tim Orling
  0 siblings, 1 reply; 13+ messages in thread
From: Khem Raj @ 2022-01-18 17:15 UTC (permalink / raw)
  To: Tim Orling; +Cc: openembeded-devel

this fail on mips see

https://errors.yoctoproject.org/Errors/Details/622699/

On Sat, Jan 15, 2022 at 9:29 PM Tim Orling <ticotimo@gmail.com> wrote:
>
> Pyruvate is a reasonably fast, multithreaded, non-blocking WSGI server
> implemented in Rust.
>
> This recipe uses the new setuptools3_rust and pyo3 classes.
>
> Signed-off-by: Tim Orling <tim.orling@konsulko.com>
> ---
>  .../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
>
> diff --git a/meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb b/meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb
> new file mode 100644
> index 0000000000..835cf9a93d
> --- /dev/null
> +++ b/meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb
> @@ -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: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [oe] [meta-python][PATCH 4/7] python3-pyruvate: add recipe for v1.1.2
  2022-01-18 17:15   ` [oe] " Khem Raj
@ 2022-01-18 17:22     ` Tim Orling
  0 siblings, 0 replies; 13+ messages in thread
From: Tim Orling @ 2022-01-18 17:22 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembeded-devel

[-- Attachment #1: Type: text/plain, Size: 7877 bytes --]

On Tue, Jan 18, 2022 at 9:15 AM Khem Raj <raj.khem@gmail.com> wrote:

> 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?


> On Sat, Jan 15, 2022 at 9:29 PM Tim Orling <ticotimo@gmail.com> wrote:
> >
> > Pyruvate is a reasonably fast, multithreaded, non-blocking WSGI server
> > implemented in Rust.
> >
> > This recipe uses the new setuptools3_rust and pyo3 classes.
> >
> > Signed-off-by: Tim Orling <tim.orling@konsulko.com>
> > ---
> >  .../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
> >
> > diff --git a/meta-python/recipes-devtools/python/
> python3-pyruvate_1.1.2.bb b/meta-python/recipes-devtools/python/
> python3-pyruvate_1.1.2.bb
> > new file mode 100644
> > index 0000000000..835cf9a93d
> > --- /dev/null
> > +++ b/meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb
> > @@ -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: openembedded-devel+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [
> raj.khem@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
>

[-- Attachment #2: Type: text/html, Size: 18698 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [oe] [meta-python][PATCH 0/7] setuptools-rust and python3-cryptography
  2022-01-16  5:28 [meta-python][PATCH 0/7] setuptools-rust and python3-cryptography Tim Orling
                   ` (6 preceding siblings ...)
  2022-01-16  5:29 ` [meta-python][PATCH 7/7] python3-cryptography: upgrade 3.3.2 -> 36.0.1 Tim Orling
@ 2022-01-19 12:13 ` Samuli Piippo
  2022-01-19 19:38   ` Tim Orling
  7 siblings, 1 reply; 13+ messages in thread
From: Samuli Piippo @ 2022-01-19 12:13 UTC (permalink / raw)
  To: Tim Orling; +Cc: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 6233 bytes --]

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

On Sun, 16 Jan 2022 at 07:29, Tim Orling <ticotimo@gmail.com> wrote:

> 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.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: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [
> samuli.piippo@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #2: Type: text/html, Size: 9982 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [oe] [meta-python][PATCH 7/7] python3-cryptography: upgrade 3.3.2 -> 36.0.1
  2022-01-16  5:29 ` [meta-python][PATCH 7/7] python3-cryptography: upgrade 3.3.2 -> 36.0.1 Tim Orling
@ 2022-01-19 12:51   ` Ross Burton
  0 siblings, 0 replies; 13+ messages in thread
From: Ross Burton @ 2022-01-19 12:51 UTC (permalink / raw)
  To: Tim Orling; +Cc: openembedded-devel

This results in a broken python3-cryptography-native:

$ bitbake trusted-firmware-m -c devshell
$ nativepython3
>>> 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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [oe] [meta-python][PATCH 0/7] setuptools-rust and python3-cryptography
  2022-01-19 12:13 ` [oe] [meta-python][PATCH 0/7] setuptools-rust and python3-cryptography Samuli Piippo
@ 2022-01-19 19:38   ` Tim Orling
  0 siblings, 0 replies; 13+ messages in thread
From: Tim Orling @ 2022-01-19 19:38 UTC (permalink / raw)
  To: Samuli Piippo; +Cc: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 6733 bytes --]

On Wed, Jan 19, 2022 at 4:13 AM Samuli Piippo <samuli.piippo@gmail.com>
wrote:

> 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
>
> We 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.


> 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.
>
> This warning seems to be harmless, but I don't know how to "fix it".


> -samuli
>
> On Sun, 16 Jan 2022 at 07:29, Tim Orling <ticotimo@gmail.com> wrote:
>
>> 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.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: openembedded-devel+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [
>> samuli.piippo@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
>>

[-- Attachment #2: Type: text/html, Size: 11174 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-01-19 19:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-16  5:28 [meta-python][PATCH 0/7] setuptools-rust and python3-cryptography Tim Orling
2022-01-16  5:28 ` [meta-python][PATCH 1/7] python3-setuptools-rust-native: add v1.1.2 recipe Tim Orling
2022-01-16  5:28 ` [meta-python][PATCH 2/7] pyo3.bbclass: add class for PyO3 cross-compilation Tim Orling
2022-01-16  5:29 ` [meta-python][PATCH 3/7] setuptools3_rust.bbclass: setuptoools Rust plugin Tim Orling
2022-01-16  5:29 ` [meta-python][PATCH 4/7] python3-pyruvate: add recipe for v1.1.2 Tim Orling
2022-01-18 17:15   ` [oe] " Khem Raj
2022-01-18 17:22     ` Tim Orling
2022-01-16  5:29 ` [meta-python][PATCH 5/7] python3-pytest-subtests: upgrade 0.5.0 -> 0.6.0 Tim Orling
2022-01-16  5:29 ` [meta-python][PATCH 6/7] python3-cryptography-vectors: upgrade 35.0.0 => 36.0.1 Tim Orling
2022-01-16  5:29 ` [meta-python][PATCH 7/7] python3-cryptography: upgrade 3.3.2 -> 36.0.1 Tim Orling
2022-01-19 12:51   ` [oe] " Ross Burton
2022-01-19 12:13 ` [oe] [meta-python][PATCH 0/7] setuptools-rust and python3-cryptography Samuli Piippo
2022-01-19 19:38   ` Tim Orling

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.