Skip to contentSkip to conversation

meta-arm: add old version of python3-cryptography

PATCH Applied Ross Burton 2 participants 3 messages Jan 20, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 meta-arm: add old version of python3-cryptography

meta-python has upgraded to python3-cryptography 36, which has a problem when used in native recipes:

cryptography.exceptions.InternalError: Unknown OpenSSL error

This causes all builds of TF-M to fail.

Until this error is fixed, add the old version of python3-cryptography. A BBMASK is set so that it has to be explicitly opted-in, as it DEPENDS on recipes from meta-python which isn't a hard dependency for meta-arm.

---
 meta-arm-bsp/conf/layer.conf                  |  3 +
 .../python/python3-cryptography/h-test.patch  | 10 +++
 .../python3-cryptography/openssl3.patch       | 62 +++++++++++++++++
 .../python/python3-cryptography/run-ptest     |  2 +
 .../python/python3-cryptography_3.3.2.bb      | 68 +++++++++++++++++++
 5 files changed, 145 insertions(+)
 create mode 100644 meta-arm-bsp/recipes-devtools/python/python3-cryptography/h-test.patch
 create mode 100644 meta-arm-bsp/recipes-devtools/python/python3-cryptography/openssl3.patch
 create mode 100644 meta-arm-bsp/recipes-devtools/python/python3-cryptography/run-ptest
 create mode 100644 meta-arm-bsp/recipes-devtools/python/python3-cryptography_3.3.2.bb
meta-arm-bsp/conf/layer.conf +3 -0
index 7af156e8..45767866 100644
@@ -19,3 +19,6 @@ LAYERDEPENDS_meta-arm-bsp:append:musca-s1 = " meta-python"
 
 # Additional license directories.
 LICENSE_PATH += "${LAYERDIR}/custom-licenses"
+
+# Delete this when our downgrade of python3-cryptography is removed
+BBMASK += "meta-arm-bsp/recipes-devtools/python/python3-cryptography_3.3.2.bb"
meta-arm-bsp/recipes-devtools/python/python3-cryptography/h-test.patch new file +10 -0
new file mode 100644
index 00000000..9f07c738
@@ -0,0 +1,10 @@
+--- 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-arm-bsp/recipes-devtools/python/python3-cryptography/openssl3.patch new file +62 -0

62 lines not on this page · raw message

meta-arm-bsp/recipes-devtools/python/python3-cryptography/run-ptest new file +2 -0
new file mode 100644
index 00000000..0ba239c2
@@ -0,0 +1,2 @@
+#!/bin/sh
+py.test
meta-arm-bsp/recipes-devtools/python/python3-cryptography_3.3.2.bb new file +68 -0

68 lines not on this page · raw message

Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 meta-arm-bsp: use old python3-crytography on platforms using TF-M

As the latest python3-crytography breaks TF-M builds, downgrade those machines using TF-M (musca and corstone) to python3-crytography-native 3.3.2 temporarily.

---
 meta-arm-bsp/conf/layer.conf                       | 6 +++++-
 meta-arm-bsp/conf/machine/include/corstone1000.inc | 5 +++++
 meta-arm-bsp/conf/machine/musca-b1.conf            | 5 +++++
 meta-arm-bsp/conf/machine/musca-s1.conf            | 5 +++++
 4 files changed, 20 insertions(+), 1 deletion(-)
meta-arm-bsp/conf/layer.conf +5 -1
index 45767866..82230470 100644
@@ -21,4 +21,8 @@ LAYERDEPENDS_meta-arm-bsp:append:musca-s1 = " meta-python"
 LICENSE_PATH += "${LAYERDIR}/custom-licenses"
 
 # Delete this when our downgrade of python3-cryptography is removed
-BBMASK += "meta-arm-bsp/recipes-devtools/python/python3-cryptography_3.3.2.bb"
+META_ARM_PYCRYPTO = "meta-arm-bsp/recipes-devtools/python/python3-cryptography_3.3.2.bb"
+META_ARM_PYCRYPTO:corstone1000 = ""
+META_ARM_PYCRYPTO:musca-b1 = ""
+META_ARM_PYCRYPTO:musca-s1 = ""
+BBMASK += "${META_ARM_PYCRYPTO}"
meta-arm-bsp/conf/machine/include/corstone1000.inc +5 -0
index f9d301e4..019293b0 100644
@@ -63,3 +63,8 @@ SERIAL_CONSOLES ?= "115200;ttyAMA0"
 WKS_FILE_DEPENDS:append = " ${EXTRA_IMAGEDEPENDS}"
 
 WKS_FILE ?= "corstone1000-image.corstone1000.wks"
+
+# The latest python3-cryptography-native doesn't work
+# (cryptography.exceptions.InternalError: Unknown OpenSSL error) so use the
+# version before Rust was involved for now.
+PREFERRED_VERSION_python3-cryptography-native = "3.3.2"
meta-arm-bsp/conf/machine/musca-b1.conf +5 -0
index 073c466e..ec5ff4ee 100644
@@ -26,3 +26,8 @@ ZEPHYR_INHERIT_CLASSES += "zephyr-qemuboot"
 ARCH:musca-b1 = "arm"
 
 TFM_PLATFORM = "arm/musca_b1/sse_200"
+
+# The latest python3-cryptography-native doesn't work
+# (cryptography.exceptions.InternalError: Unknown OpenSSL error) so use the
+# version before Rust was involved for now.
+PREFERRED_VERSION_python3-cryptography-native = "3.3.2"
meta-arm-bsp/conf/machine/musca-s1.conf +5 -0
index d18c06c2..e5f63f76 100644
@@ -25,3 +25,8 @@ ZEPHYR_INHERIT_CLASSES += "zephyr-qemuboot"
 ARCH:musca-s1 = "arm"
 
 TFM_PLATFORM = "arm/musca_s1"
+
+# The latest python3-cryptography-native doesn't work
+# (cryptography.exceptions.InternalError: Unknown OpenSSL error) so use the
+# version before Rust was involved for now.
+PREFERRED_VERSION_python3-cryptography-native = "3.3.2"
Signature · 1 line
2.25.1
Applied
#2 lore raw
In reply to Ross Burton
Quoted 8 lines · Ross Burton

meta-python has upgraded to python3-cryptography 36, which has a problem when used in native recipes:

cryptography.exceptions.InternalError: Unknown OpenSSL error

This causes all builds of TF-M to fail.

[...]

Applied, thanks!

[1/2] meta-arm: add old version of python3-cryptography

      commit: a15c16068ab011e2ba91a6c4ca6e1251de0d8058
[2/2] meta-arm-bsp: use old python3-crytography on platforms using TF-M
      commit: 2a27bd4f47d09bb709a953f4a91ef2a2cf921255

Best regards,

Signature · 1 line
Jon Mason <[email protected]>