Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] python3-pyyaml fix libyaml detection and enable ptest
@ 2024-02-09  2:18 Tim Orling
  2024-02-09  2:18 ` [PATCH 1/2] python3-pyyaml: add PACKAGECONFIG for libyaml Tim Orling
  2024-02-09  2:18 ` [PATCH 2/2] python3-pyyaml: enable ptest Tim Orling
  0 siblings, 2 replies; 3+ messages in thread
From: Tim Orling @ 2024-02-09  2:18 UTC (permalink / raw)
  To: openembedded-core

As pointed out by jdiez in #yocto IRC, python3-pyyaml will "helpfully" detect
libyaml in the build environment and compile with Python bindings for the C
library. This is non-deterministic and can result in host contamination (pulling
in the host's libyaml). Add a PACKAGECONFIG to make compiling with the faster
libyaml bindings as the default. Add very basic ptest to ensure the runtime is
viable.

The following changes since commit 71ac318a830b37f55cbd63794c55c6adc1904f1f:

  yocto-bsp: update reference boards to v6.6.15 (2024-02-08 23:15:18 +0000)

are available in the Git repository at:

  https://git.yoctoproject.org/poky-contrib timo/python3-pyyaml-libyaml-ptest
  https://git.yoctoproject.org/poky-contrib/log/?h=timo/python3-pyyaml-libyaml-ptest

Tim Orling (2):
  python3-pyyaml: add PACKAGECONFIG for libyaml
  python3-pyyaml: enable ptest

 .../distro/include/ptest-packagelists.inc     |  1 +
 .../python/python3-pyyaml/run-ptest           |  3 +++
 .../python/python3-pyyaml_6.0.1.bb            | 20 +++++++++++++++++++
 3 files changed, 24 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-pyyaml/run-ptest

-- 
2.34.1



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

* [PATCH 1/2] python3-pyyaml: add PACKAGECONFIG for libyaml
  2024-02-09  2:18 [PATCH 0/2] python3-pyyaml fix libyaml detection and enable ptest Tim Orling
@ 2024-02-09  2:18 ` Tim Orling
  2024-02-09  2:18 ` [PATCH 2/2] python3-pyyaml: enable ptest Tim Orling
  1 sibling, 0 replies; 3+ messages in thread
From: Tim Orling @ 2024-02-09  2:18 UTC (permalink / raw)
  To: openembedded-core

For some time now, we have probably been susceptible to host contamination
or at least non-deterministic behavior when libyaml was available in the
build environment.

The symptom is:
ERROR: python3-pyyaml-6.0-r0 do_package_qa: QA Issue:
/usr/lib/python3.11/site-packages/yaml/_yaml.cpython-311-aarch64-linux-gnu.so
contained in package python3-pyyaml requires libyaml-0.so.2()(64bit), but no
providers found in RDEPENDS:python3-pyyaml? [file-rdeps]

From the documentation:
"""
By default, the setup.py script checks whether LibYAML is installed and
if so, builds and installs LibYAML bindings. To skip the check and force
installation of LibYAML bindings, use the option --with-libyaml:
python setup.py --with-libyaml install

To disable the check and skip building and installing LibYAML bindings,
use --without-libyaml:
python setup.py --without-libyaml install
"""

Instead of leaving this to chance, add PACKAGECONFIG and by default build
with the faster libyaml bindings.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 meta/recipes-devtools/python/python3-pyyaml_6.0.1.bb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-devtools/python/python3-pyyaml_6.0.1.bb b/meta/recipes-devtools/python/python3-pyyaml_6.0.1.bb
index 61f7cbc6b36..102e2f2498b 100644
--- a/meta/recipes-devtools/python/python3-pyyaml_6.0.1.bb
+++ b/meta/recipes-devtools/python/python3-pyyaml_6.0.1.bb
@@ -12,6 +12,9 @@ inherit pypi python_setuptools_build_meta
 SRC_URI += "file://0001-Fix-builds-with-Cython-3.patch"
 SRC_URI[sha256sum] = "bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"
 
+PACKAGECONFIG ?= "libyaml"
+PACKAGECONFIG[libyaml] = "--with-libyaml,--without-libyaml,libyaml"
+
 RDEPENDS:${PN} += "\
     ${PYTHON_PN}-datetime \
     ${PYTHON_PN}-netclient \
-- 
2.34.1



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

* [PATCH 2/2] python3-pyyaml: enable ptest
  2024-02-09  2:18 [PATCH 0/2] python3-pyyaml fix libyaml detection and enable ptest Tim Orling
  2024-02-09  2:18 ` [PATCH 1/2] python3-pyyaml: add PACKAGECONFIG for libyaml Tim Orling
@ 2024-02-09  2:18 ` Tim Orling
  1 sibling, 0 replies; 3+ messages in thread
From: Tim Orling @ 2024-02-09  2:18 UTC (permalink / raw)
  To: openembedded-core

Upstream is in the process of migrating testing to pytest, backport
test_dump_load.py (the legacy_tests were throwing Errors and Failures).
We don't really need to run upstream's test suite, but we do need to verify
that our runtime is functional.

https://github.com/yaml/pyyaml/commit/a98fd6088e81d7aca571220c966bbfe2ac43c335

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---

All tests pass on qemuarm64 for core-image-ptest-python3-pyyaml via testimage

 meta/conf/distro/include/ptest-packagelists.inc |  1 +
 .../python/python3-pyyaml/run-ptest             |  3 +++
 .../python/python3-pyyaml_6.0.1.bb              | 17 +++++++++++++++++
 3 files changed, 21 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-pyyaml/run-ptest

diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index b590640edc2..0192146dbd0 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -69,6 +69,7 @@ PTESTS_FAST = "\
     python3-pluggy \
     python3-pyasn1 \
     python3-pytz \
+    python3-pyyaml \
     python3-trove-classifiers \
     python3-wcwidth \
     python3-webcolors \
diff --git a/meta/recipes-devtools/python/python3-pyyaml/run-ptest b/meta/recipes-devtools/python/python3-pyyaml/run-ptest
new file mode 100644
index 00000000000..8d2017d39ce
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-pyyaml/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+pytest --automake
diff --git a/meta/recipes-devtools/python/python3-pyyaml_6.0.1.bb b/meta/recipes-devtools/python/python3-pyyaml_6.0.1.bb
index 102e2f2498b..62be059df52 100644
--- a/meta/recipes-devtools/python/python3-pyyaml_6.0.1.bb
+++ b/meta/recipes-devtools/python/python3-pyyaml_6.0.1.bb
@@ -20,4 +20,21 @@ RDEPENDS:${PN} += "\
     ${PYTHON_PN}-netclient \
 "
 
+inherit ptest
+SRC_URI += "\
+    https://raw.githubusercontent.com/yaml/pyyaml/a98fd6088e81d7aca571220c966bbfe2ac43c335/tests/test_dump_load.py;name=test \
+    file://run-ptest \
+"
+SRC_URI[test.sha256sum] = "b6a8a2825d89fdc8aee226560f66b8196e872012a0ea7118cbef1a832359434a"
+
+RDEPENDS:${PN}-ptest += " \
+	${PYTHON_PN}-pytest \
+	${PYTHON_PN}-unittest-automake-output \
+"
+
+do_install_ptest() {
+	install -d ${D}${PTEST_PATH}/tests
+	cp -rf ${WORKDIR}/test_dump_load.py ${D}${PTEST_PATH}/tests/
+}
+
 BBCLASSEXTEND = "native nativesdk"
-- 
2.34.1



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

end of thread, other threads:[~2024-02-09  2:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-09  2:18 [PATCH 0/2] python3-pyyaml fix libyaml detection and enable ptest Tim Orling
2024-02-09  2:18 ` [PATCH 1/2] python3-pyyaml: add PACKAGECONFIG for libyaml Tim Orling
2024-02-09  2:18 ` [PATCH 2/2] python3-pyyaml: enable ptest Tim Orling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox