CI: apply in-flight patches to fix python3-cryptography

Message ID 20220228142445.1862252-1-ross.burton@arm.com
State New
Headers show
Series CI: apply in-flight patches to fix python3-cryptography | expand

Commit Message

Ross Burton Feb. 28, 2022, 2:24 p.m. UTC
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 ...python3-cryptography-fix-wheel-build.patch | 30 ++++++++++++++
 ...tuptools-rust-native-fix-wheel-build.patch | 40 +++++++++++++++++++
 ci/meta-openembedded.yml                      |  7 ++++
 3 files changed, 77 insertions(+)
 create mode 100644 0001-python3-cryptography-fix-wheel-build.patch
 create mode 100644 0001-python3-setuptools-rust-native-fix-wheel-build.patch

Patch

diff --git a/0001-python3-cryptography-fix-wheel-build.patch b/0001-python3-cryptography-fix-wheel-build.patch
new file mode 100644
index 00000000..b28acf69
--- /dev/null
+++ b/0001-python3-cryptography-fix-wheel-build.patch
@@ -0,0 +1,30 @@ 
+From f82b518cb64005962dfdd789849dd4356a67d8cf Mon Sep 17 00:00:00 2001
+From: Tim Orling <ticotimo@gmail.com>
+Date: Fri, 25 Feb 2022 10:55:50 -0800
+Subject: [PATCH] python3-cryptography: fix wheel build
+
+Like python3-setuptools-rust-native, this is building its wheel in
+${S}/dist rather than ${B}/dist. Set PIP_INSTALL_DIST_PATH accordingly.
+
+Signed-off-by: Tim Orling <tim.orling@konsulko.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ .../recipes-devtools/python/python3-cryptography_36.0.1.bb      | 2 ++
+ 1 file changed, 2 insertions(+)
+
+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
+index abb15381f5..00791dce2d 100644
+--- a/meta-python/recipes-devtools/python/python3-cryptography_36.0.1.bb
++++ b/meta-python/recipes-devtools/python/python3-cryptography_36.0.1.bb
+@@ -20,6 +20,8 @@ SRC_URI += " \
+ 
+ inherit pypi setuptools3_rust
+ 
++PIP_INSTALL_DIST_PATH = "${S}/dist"
++
+ DEPENDS += " \
+     ${PYTHON_PN}-asn1crypto-native \
+     ${PYTHON_PN}-cffi-native \
+-- 
+2.25.1
+
diff --git a/0001-python3-setuptools-rust-native-fix-wheel-build.patch b/0001-python3-setuptools-rust-native-fix-wheel-build.patch
new file mode 100644
index 00000000..b66239d9
--- /dev/null
+++ b/0001-python3-setuptools-rust-native-fix-wheel-build.patch
@@ -0,0 +1,40 @@ 
+From 224eff9a28a4489504178621287b33f148a9f54a Mon Sep 17 00:00:00 2001
+From: Tim Orling <ticotimo@gmail.com>
+Date: Fri, 25 Feb 2022 09:31:51 -0800
+Subject: [PATCH] python3-setuptools-rust-native: fix wheel build
+
+Add comment that setuptools_build_meta is currently broken and stick
+with setuptools3 for now.
+
+For some reason, the wheel is built in ${S}/dist and not ${B}/dist.
+Set PIP_INSTALL_DIST_PATH accordingly as a workaround.
+
+Signed-off-by: Tim Orling <tim.orling@konsulko.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ .../python/python3-setuptools-rust-native_1.1.2.bb         | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+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
+index 34ff91241f..1afb3f0e0f 100644
+--- 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
+@@ -12,8 +12,15 @@ 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"
+ 
++# While this has a pyproject.toml and declares that setuptools_build_meta should work
++# it results in a wheel named UNKNOWN-0.0.0-py3-none-any.whl so stay with setuptools3
++# until that can be resolved
+ inherit cargo pypi setuptools3 native
+ 
++# For some reason the wheel is built in ${S} not ${B}
++PIP_INSTALL_DIST_PATH = "${S}/dist"
++
++
+ DEPENDS += "python3-setuptools-scm-native python3-wheel-native"
+ 
+ RDEPENDS:${PN}:class-native += " \
+-- 
+2.25.1
+
diff --git a/ci/meta-openembedded.yml b/ci/meta-openembedded.yml
index bed338da..4da829b5 100644
--- a/ci/meta-openembedded.yml
+++ b/ci/meta-openembedded.yml
@@ -9,3 +9,10 @@  repos:
       meta-networking:
       meta-oe:
       meta-python:
+    patches:
+      wheel1:
+        repo: meta-arm
+        path: 0001-python3-cryptography-fix-wheel-build.patch
+      wheel2:
+        repo: meta-arm
+        path: 0001-python3-setuptools-rust-native-fix-wheel-build.patch