All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH 0/9] libgpiod: ptest improvements
@ 2021-06-02 14:14 Bartosz Golaszewski
  2021-06-02 14:14 ` [meta-oe][PATCH 1/9] libgpiod: coding style fixes Bartosz Golaszewski
                   ` (9 more replies)
  0 siblings, 10 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2021-06-02 14:14 UTC (permalink / raw)
  To: Khem Raj, Armin Kuster, openembedded-devel; +Cc: Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

This series improves the recipe for libgpiod with primary focus on ptest
parts. We bring in support for all test-suites available in the package.
We also tweak the recipe in other places to make it more readable and
robust in general.

Bartosz Golaszewski (9):
  libgpiod: coding style fixes
  libgpiod: list all packages in a single assignment
  libgpiod: fix RRECOMMENDS for python bindings
  libgpiod: correctly split output files into packages
  libgpiod: add RDEPENDS for tests
  libgpiod: redirect stdout from the ptest executable to a file
  libgpiod: ptest: run all test-suites if possible
  libgpiod: ptest: warn if the gpio-mockup kernel module is not selected
  libgpiod: ptest: add kernel-modules to RRECOMMENDS

 .../recipes-support/libgpiod/files/run-ptest  | 21 ++++---
 .../libgpiod/libgpiod_1.6.3.bb                | 61 +++++++++++++++----
 2 files changed, 64 insertions(+), 18 deletions(-)

-- 
2.30.1


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

* [meta-oe][PATCH 1/9] libgpiod: coding style fixes
  2021-06-02 14:14 [meta-oe][PATCH 0/9] libgpiod: ptest improvements Bartosz Golaszewski
@ 2021-06-02 14:14 ` Bartosz Golaszewski
  2021-06-02 14:14 ` [meta-oe][PATCH 2/9] libgpiod: list all packages in a single assignment Bartosz Golaszewski
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2021-06-02 14:14 UTC (permalink / raw)
  To: Khem Raj, Armin Kuster, openembedded-devel; +Cc: Bartosz Golaszewski

The recipe is getting bigger so try to keep a consistent coding style.
Use four spaces instead of tabs and use the common way of splitting
multi-line strings for minimum git diff lines at modification.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
 meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
index d9c251705..f51906a43 100644
--- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
+++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
@@ -4,8 +4,9 @@ AUTHOR = "Bartosz Golaszewski <bgolaszewski@baylibre.com>"
 LICENSE = "LGPLv2.1+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=2caced0b25dfefd4c601d92bd15116de"
 
-SRC_URI = "https://www.kernel.org/pub/software/libs/${BPN}/${BP}.tar.xz \
-           file://run-ptest \
+SRC_URI = " \
+    https://www.kernel.org/pub/software/libs/${BPN}/${BP}.tar.xz \
+    file://run-ptest \
 "
 
 SRC_URI[md5sum] = "28e79f6f70fee1da9079558d8b7b3736"
@@ -39,6 +40,6 @@ RRECOMMENDS_${PN}-python += "${RRECOMMENDS_PYTHON}"
 PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'tests', '', d)}"
 
 do_install_ptest() {
-	install -d ${D}${PTEST_PATH}/tests
-	cp ${B}/tests/.libs/gpiod-test ${D}${PTEST_PATH}/tests/
+    install -d ${D}${PTEST_PATH}/tests
+    cp ${B}/tests/.libs/gpiod-test ${D}${PTEST_PATH}/tests/
 }
-- 
2.30.1


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

* [meta-oe][PATCH 2/9] libgpiod: list all packages in a single assignment
  2021-06-02 14:14 [meta-oe][PATCH 0/9] libgpiod: ptest improvements Bartosz Golaszewski
  2021-06-02 14:14 ` [meta-oe][PATCH 1/9] libgpiod: coding style fixes Bartosz Golaszewski
@ 2021-06-02 14:14 ` Bartosz Golaszewski
  2021-06-02 14:14 ` [meta-oe][PATCH 3/9] libgpiod: fix RRECOMMENDS for python bindings Bartosz Golaszewski
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2021-06-02 14:14 UTC (permalink / raw)
  To: Khem Raj, Armin Kuster, openembedded-devel; +Cc: Bartosz Golaszewski

Don't have assignments to PACKAGES scattered across the recipe - use a
single place for that before assigning FILES.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
 meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
index f51906a43..e1c0e8922 100644
--- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
+++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
@@ -27,11 +27,9 @@ EXTRA_OECONF = "--enable-tools"
 
 DEPENDS += "autoconf-archive-native"
 
-PACKAGES =+ "${PN}-tools libgpiodcxx"
+PACKAGES =+ "${PN}-tools libgpiodcxx ${PN}-python"
 FILES_${PN}-tools = "${bindir}/*"
 FILES_libgpiodcxx = "${libdir}/libgpiodcxx.so.*"
-
-PACKAGES =+ "${PN}-python"
 FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*.so"
 FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
 RRECOMMENDS_PYTHON = "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-python', '',d)}"
-- 
2.30.1


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

* [meta-oe][PATCH 3/9] libgpiod: fix RRECOMMENDS for python bindings
  2021-06-02 14:14 [meta-oe][PATCH 0/9] libgpiod: ptest improvements Bartosz Golaszewski
  2021-06-02 14:14 ` [meta-oe][PATCH 1/9] libgpiod: coding style fixes Bartosz Golaszewski
  2021-06-02 14:14 ` [meta-oe][PATCH 2/9] libgpiod: list all packages in a single assignment Bartosz Golaszewski
@ 2021-06-02 14:14 ` Bartosz Golaszewski
  2021-06-02 14:14 ` [meta-oe][PATCH 4/9] libgpiod: correctly split output files into packages Bartosz Golaszewski
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2021-06-02 14:14 UTC (permalink / raw)
  To: Khem Raj, Armin Kuster, openembedded-devel; +Cc: Bartosz Golaszewski

RRECOMMENDS for the python module doesn't work because it specifies
the module itself as its own RRECOMMENDS. Fix it to recommend the python
package if python3 is in PACKAGECONFIG for the main package.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
 meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
index e1c0e8922..43264782e 100644
--- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
+++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
@@ -32,8 +32,8 @@ FILES_${PN}-tools = "${bindir}/*"
 FILES_libgpiodcxx = "${libdir}/libgpiodcxx.so.*"
 FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*.so"
 FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
-RRECOMMENDS_PYTHON = "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-python', '',d)}"
-RRECOMMENDS_${PN}-python += "${RRECOMMENDS_PYTHON}"
+
+RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-python', '', d)}"
 
 PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'tests', '', d)}"
 
-- 
2.30.1


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

* [meta-oe][PATCH 4/9] libgpiod: correctly split output files into packages
  2021-06-02 14:14 [meta-oe][PATCH 0/9] libgpiod: ptest improvements Bartosz Golaszewski
                   ` (2 preceding siblings ...)
  2021-06-02 14:14 ` [meta-oe][PATCH 3/9] libgpiod: fix RRECOMMENDS for python bindings Bartosz Golaszewski
@ 2021-06-02 14:14 ` Bartosz Golaszewski
  2021-06-02 14:14 ` [meta-oe][PATCH 5/9] libgpiod: add RDEPENDS for tests Bartosz Golaszewski
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2021-06-02 14:14 UTC (permalink / raw)
  To: Khem Raj, Armin Kuster, openembedded-devel; +Cc: Bartosz Golaszewski

Currently, the files that should go into libgpiod-ptest are part of
either the main library package of libgpiod-tools. Use more fine-grained
values for package files variables.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
 .../recipes-support/libgpiod/libgpiod_1.6.3.bb   | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
index 43264782e..9e4bef7b4 100644
--- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
+++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
@@ -28,7 +28,21 @@ EXTRA_OECONF = "--enable-tools"
 DEPENDS += "autoconf-archive-native"
 
 PACKAGES =+ "${PN}-tools libgpiodcxx ${PN}-python"
-FILES_${PN}-tools = "${bindir}/*"
+FILES_${PN}-tools = " \
+    ${bindir}/gpiodetect \
+    ${bindir}/gpioinfo \
+    ${bindir}/gpioget \
+    ${bindir}/gpioset \
+    ${bindir}/gpiofind \
+    ${bindir}/gpiomon \
+"
+FILES_${PN}-ptest += " \
+    ${bindir}/gpiod-test \
+    ${bindir}/gpio-tools-test \
+    ${bindir}/gpio-tools-test.bats \
+    ${bindir}/gpiod-cxx-test \
+    ${libdir}/libgpiomockup.so.* \
+"
 FILES_libgpiodcxx = "${libdir}/libgpiodcxx.so.*"
 FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*.so"
 FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
-- 
2.30.1


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

* [meta-oe][PATCH 5/9] libgpiod: add RDEPENDS for tests
  2021-06-02 14:14 [meta-oe][PATCH 0/9] libgpiod: ptest improvements Bartosz Golaszewski
                   ` (3 preceding siblings ...)
  2021-06-02 14:14 ` [meta-oe][PATCH 4/9] libgpiod: correctly split output files into packages Bartosz Golaszewski
@ 2021-06-02 14:14 ` Bartosz Golaszewski
  2021-06-02 14:14 ` [meta-oe][PATCH 6/9] libgpiod: redirect stdout from the ptest executable to a file Bartosz Golaszewski
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2021-06-02 14:14 UTC (permalink / raw)
  To: Khem Raj, Armin Kuster, openembedded-devel; +Cc: Bartosz Golaszewski

The libgpiod-tools test-suite requires bats at run-time. The python
test-suite needs the packaging module. Add both to the RDEPENDS in the
tests PACKAGECONFIG option

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
 meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
index 9e4bef7b4..c0ebb8aa5 100644
--- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
+++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
@@ -14,7 +14,7 @@ SRC_URI[sha256sum] = "841be9d788f00bab08ef22c4be5c39866f0e46cb100a3ae49ed816ac9c
 
 inherit autotools pkgconfig python3native ptest
 
-PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,kmod udev glib-2.0 catch2"
+PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,kmod udev glib-2.0 catch2,bats python3-packaging"
 PACKAGECONFIG[cxx] = "--enable-bindings-cxx,--disable-bindings-cxx"
 PACKAGECONFIG[python3] = "--enable-bindings-python,--disable-bindings-python,python3"
 
-- 
2.30.1


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

* [meta-oe][PATCH 6/9] libgpiod: redirect stdout from the ptest executable to a file
  2021-06-02 14:14 [meta-oe][PATCH 0/9] libgpiod: ptest improvements Bartosz Golaszewski
                   ` (4 preceding siblings ...)
  2021-06-02 14:14 ` [meta-oe][PATCH 5/9] libgpiod: add RDEPENDS for tests Bartosz Golaszewski
@ 2021-06-02 14:14 ` Bartosz Golaszewski
  2021-06-02 14:14 ` [meta-oe][PATCH 7/9] libgpiod: ptest: run all test-suites if possible Bartosz Golaszewski
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2021-06-02 14:14 UTC (permalink / raw)
  To: Khem Raj, Armin Kuster, openembedded-devel; +Cc: Bartosz Golaszewski

Most tests redirect their standard output to a file. Let's make libgpiod
consistent with this pattern.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
 meta-oe/recipes-support/libgpiod/files/run-ptest | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-oe/recipes-support/libgpiod/files/run-ptest b/meta-oe/recipes-support/libgpiod/files/run-ptest
index 4cda05d44..3ad737dfc 100644
--- a/meta-oe/recipes-support/libgpiod/files/run-ptest
+++ b/meta-oe/recipes-support/libgpiod/files/run-ptest
@@ -4,7 +4,7 @@ testbin="gpiod-test"
 ptestdir=$(dirname "$(readlink -f "$0")")
 cd $ptestdir/tests
 
-./$testbin
+./$testbin > ./$testbin.out
 if [ $? -ne 0 ]; then
 	echo "FAIL: $testbin"
 else
-- 
2.30.1


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

* [meta-oe][PATCH 7/9] libgpiod: ptest: run all test-suites if possible
  2021-06-02 14:14 [meta-oe][PATCH 0/9] libgpiod: ptest improvements Bartosz Golaszewski
                   ` (5 preceding siblings ...)
  2021-06-02 14:14 ` [meta-oe][PATCH 6/9] libgpiod: redirect stdout from the ptest executable to a file Bartosz Golaszewski
@ 2021-06-02 14:14 ` Bartosz Golaszewski
  2021-06-02 14:15 ` [meta-oe][PATCH 8/9] libgpiod: ptest: warn if the gpio-mockup kernel module is not selected Bartosz Golaszewski
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2021-06-02 14:14 UTC (permalink / raw)
  To: Khem Raj, Armin Kuster, openembedded-devel; +Cc: Bartosz Golaszewski

We have four test-suites total in libgpiod: for the core C library,
gpio-tools and for C++ and Python bindings. Modify the recipe to install
all of them depending on build settings and make run-ptest execute them
if available.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
 .../recipes-support/libgpiod/files/run-ptest  | 21 ++++++++++++-------
 .../libgpiod/libgpiod_1.6.3.bb                | 20 +++++++++++++++++-
 2 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/meta-oe/recipes-support/libgpiod/files/run-ptest b/meta-oe/recipes-support/libgpiod/files/run-ptest
index 3ad737dfc..60c661fc1 100644
--- a/meta-oe/recipes-support/libgpiod/files/run-ptest
+++ b/meta-oe/recipes-support/libgpiod/files/run-ptest
@@ -1,12 +1,19 @@
 #!/bin/sh
 
-testbin="gpiod-test"
+testbins="gpiod-test gpio-tools-test gpiod-cxx-test gpiod_py_test.py"
+
 ptestdir=$(dirname "$(readlink -f "$0")")
 cd $ptestdir/tests
 
-./$testbin > ./$testbin.out
-if [ $? -ne 0 ]; then
-	echo "FAIL: $testbin"
-else
-	echo "PASS: $testbin"
-fi
+for testbin in $testbins; do
+	if test -e ./$testbin; then
+		./$testbin > ./$testbin.out
+		if [ $? -ne 0 ]; then
+			echo "FAIL: $testbin"
+		else
+			echo "PASS: $testbin"
+		fi
+	else
+		echo "SKIP: $testbin"
+	fi
+done
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
index c0ebb8aa5..874453fbd 100644
--- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
+++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
@@ -53,5 +53,23 @@ PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'tests
 
 do_install_ptest() {
     install -d ${D}${PTEST_PATH}/tests
-    cp ${B}/tests/.libs/gpiod-test ${D}${PTEST_PATH}/tests/
+
+    # These are the core C library tests
+    install -m 0755 ${B}/tests/.libs/gpiod-test ${D}${PTEST_PATH}/tests/
+
+    # Tools are always built so let's always install them for ptest even if
+    # we're not selecting libgpiod-tools.
+    install -m 0755 ${S}/tools/gpio-tools-test ${D}${PTEST_PATH}/tests/
+    install -m 0755 ${S}/tools/gpio-tools-test.bats ${D}${PTEST_PATH}/tests/
+    for tool in ${FILES_${PN}-tools}; do
+        install ${B}/tools/.libs/$(basename $tool) ${D}${PTEST_PATH}/tests/
+    done
+
+    if ${@bb.utils.contains('PACKAGECONFIG', 'cxx', 'true', 'false', d)}; then
+        install -m 0755 ${B}/bindings/cxx/tests/.libs/gpiod-cxx-test ${D}${PTEST_PATH}/tests/
+    fi
+
+    if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then
+        install -m 0755 ${S}/bindings/python/tests/gpiod_py_test.py ${D}${PTEST_PATH}/tests/
+    fi
 }
-- 
2.30.1


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

* [meta-oe][PATCH 8/9] libgpiod: ptest: warn if the gpio-mockup kernel module is not selected
  2021-06-02 14:14 [meta-oe][PATCH 0/9] libgpiod: ptest improvements Bartosz Golaszewski
                   ` (6 preceding siblings ...)
  2021-06-02 14:14 ` [meta-oe][PATCH 7/9] libgpiod: ptest: run all test-suites if possible Bartosz Golaszewski
@ 2021-06-02 14:15 ` Bartosz Golaszewski
  2021-06-05 22:16   ` Khem Raj
  2021-06-02 14:15 ` [meta-oe][PATCH 9/9] libgpiod: ptest: add kernel-modules to RRECOMMENDS Bartosz Golaszewski
  2021-06-03  0:03 ` [meta-oe][PATCH 0/9] libgpiod: ptest improvements Khem Raj
  9 siblings, 1 reply; 22+ messages in thread
From: Bartosz Golaszewski @ 2021-06-02 14:15 UTC (permalink / raw)
  To: Khem Raj, Armin Kuster, openembedded-devel; +Cc: Bartosz Golaszewski

libgpiod test-suites work with the gpio-mockup kernel module. When using
linux-yocto, it's enabled using the gpio/mockup.scc kernel feature. Check
if this feature is present in KERNEL_FEATURE and warn if not.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
 meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
index 874453fbd..febf625a6 100644
--- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
+++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
@@ -52,6 +52,13 @@ RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-py
 PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'tests', '', d)}"
 
 do_install_ptest() {
+    if [ "${PREFERRED_PROVIDER_virtual/kernel}" = "linux-yocto" ] && \
+       ${@bb.utils.contains('KERNEL_FEATURES', 'features/gpio/mockup.scc', 'false', 'true',d)}; then
+        bbwarn "libgpiod test-suites need the gpio-mockup
+module and will not work without it. Consider adding
+'features/gpio/mockup.scc' to KERNEL_FEATURES"
+    fi
+
     install -d ${D}${PTEST_PATH}/tests
 
     # These are the core C library tests
-- 
2.30.1


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

* [meta-oe][PATCH 9/9] libgpiod: ptest: add kernel-modules to RRECOMMENDS
  2021-06-02 14:14 [meta-oe][PATCH 0/9] libgpiod: ptest improvements Bartosz Golaszewski
                   ` (7 preceding siblings ...)
  2021-06-02 14:15 ` [meta-oe][PATCH 8/9] libgpiod: ptest: warn if the gpio-mockup kernel module is not selected Bartosz Golaszewski
@ 2021-06-02 14:15 ` Bartosz Golaszewski
  2021-06-03 16:48   ` Khem Raj
  2021-06-03  0:03 ` [meta-oe][PATCH 0/9] libgpiod: ptest improvements Khem Raj
  9 siblings, 1 reply; 22+ messages in thread
From: Bartosz Golaszewski @ 2021-06-02 14:15 UTC (permalink / raw)
  To: Khem Raj, Armin Kuster, openembedded-devel; +Cc: Bartosz Golaszewski

libgpiod needs the gpio-mockup kernel module to be loadable (not
built-in). Add kernel-modules to RRECOMMENDS.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
 meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
index febf625a6..8dda8a2a6 100644
--- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
+++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
@@ -48,6 +48,7 @@ FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*.so"
 FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
 
 RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-python', '', d)}"
+RRECOMMENDS_${PN}-ptest += "kernel-modules"
 
 PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'tests', '', d)}"
 
-- 
2.30.1


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

* Re: [meta-oe][PATCH 0/9] libgpiod: ptest improvements
  2021-06-02 14:14 [meta-oe][PATCH 0/9] libgpiod: ptest improvements Bartosz Golaszewski
                   ` (8 preceding siblings ...)
  2021-06-02 14:15 ` [meta-oe][PATCH 9/9] libgpiod: ptest: add kernel-modules to RRECOMMENDS Bartosz Golaszewski
@ 2021-06-03  0:03 ` Khem Raj
  2021-06-03  8:16   ` Bartosz Golaszewski
       [not found]   ` <CAMpxmJXBzL8QaAoLAB6cD8W8_mbBhjJ+d=gM8CGvQkBSPLDPtw@mail.gmail.com>
  9 siblings, 2 replies; 22+ messages in thread
From: Khem Raj @ 2021-06-03  0:03 UTC (permalink / raw)
  To: Bartosz Golaszewski; +Cc: Armin Kuster, openembeded-devel, Bartosz Golaszewski

Hi Bartosz

I am seeing this warning on AB

stdio: WARNING: libgpiod-1.6.3-r0 do_install_ptest_base: libgpiod
test-suites need the gpio-mockup

Can you look further into this please ?

On Wed, Jun 2, 2021 at 7:15 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> This series improves the recipe for libgpiod with primary focus on ptest
> parts. We bring in support for all test-suites available in the package.
> We also tweak the recipe in other places to make it more readable and
> robust in general.
>
> Bartosz Golaszewski (9):
>   libgpiod: coding style fixes
>   libgpiod: list all packages in a single assignment
>   libgpiod: fix RRECOMMENDS for python bindings
>   libgpiod: correctly split output files into packages
>   libgpiod: add RDEPENDS for tests
>   libgpiod: redirect stdout from the ptest executable to a file
>   libgpiod: ptest: run all test-suites if possible
>   libgpiod: ptest: warn if the gpio-mockup kernel module is not selected
>   libgpiod: ptest: add kernel-modules to RRECOMMENDS
>
>  .../recipes-support/libgpiod/files/run-ptest  | 21 ++++---
>  .../libgpiod/libgpiod_1.6.3.bb                | 61 +++++++++++++++----
>  2 files changed, 64 insertions(+), 18 deletions(-)
>
> --
> 2.30.1
>

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

* Re: [meta-oe][PATCH 0/9] libgpiod: ptest improvements
  2021-06-03  0:03 ` [meta-oe][PATCH 0/9] libgpiod: ptest improvements Khem Raj
@ 2021-06-03  8:16   ` Bartosz Golaszewski
       [not found]   ` <CAMpxmJXBzL8QaAoLAB6cD8W8_mbBhjJ+d=gM8CGvQkBSPLDPtw@mail.gmail.com>
  1 sibling, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2021-06-03  8:16 UTC (permalink / raw)
  To: Khem Raj; +Cc: Armin Kuster, openembeded-devel, Bartosz Golaszewski

On Thu, Jun 3, 2021 at 2:03 AM Khem Raj <raj.khem@gmail.com> wrote:
>
> Hi Bartosz
>
> I am seeing this warning on AB
>
> stdio: WARNING: libgpiod-1.6.3-r0 do_install_ptest_base: libgpiod
> test-suites need the gpio-mockup
>
> Can you look further into this please ?
>

I don't have to look into it - this is the behavior introduced by
patch 8/9. If using linux-yocto, building the ptest package for
libgpiod doesn't make sense without including feature/gpio/mockup.scc
in KERNEL_FEATURES. The test-suites simply won't work. I don't see any
way for implicitly pulling in kernel features so I thought that the
second best option is to warn if we don't detect it as already
configured.

Bart

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

* Re: [meta-oe][PATCH 0/9] libgpiod: ptest improvements
       [not found]   ` <CAMpxmJXBzL8QaAoLAB6cD8W8_mbBhjJ+d=gM8CGvQkBSPLDPtw@mail.gmail.com>
@ 2021-06-03 15:11     ` Khem Raj
  0 siblings, 0 replies; 22+ messages in thread
From: Khem Raj @ 2021-06-03 15:11 UTC (permalink / raw)
  To: Bartosz Golaszewski; +Cc: Armin Kuster, Bartosz Golaszewski, openembeded-devel

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

On Thu, Jun 3, 2021 at 1:10 AM Bartosz Golaszewski <
bgolaszewski@baylibre.com> wrote:

> On Thu, Jun 3, 2021 at 2:03 AM Khem Raj <raj.khem@gmail.com> wrote:
> >
> > Hi Bartosz
> >
> > I am seeing this warning on AB
> >
> > stdio: WARNING: libgpiod-1.6.3-r0 do_install_ptest_base: libgpiod
> > test-suites need the gpio-mockup
> >
> > Can you look further into this please ?
> >
>
> I don't have to look into it - this is the behavior introduced by
> patch 8/9. If using linux-yocto, building the ptest package for
> libgpiod doesn't make sense without including feature/gpio/mockup.scc
> in KERNEL_FEATURES. The test-suites simply won't work. I don't see any
> way for implicitly pulling in kernel features so I thought that the
> second best option is to warn if we don't detect it as already
> configured.


Right some way to inform user would be improvement

>
>
> Bart
>

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

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

* Re: [meta-oe][PATCH 9/9] libgpiod: ptest: add kernel-modules to RRECOMMENDS
  2021-06-02 14:15 ` [meta-oe][PATCH 9/9] libgpiod: ptest: add kernel-modules to RRECOMMENDS Bartosz Golaszewski
@ 2021-06-03 16:48   ` Khem Raj
  2021-06-04  8:04     ` Bartosz Golaszewski
  0 siblings, 1 reply; 22+ messages in thread
From: Khem Raj @ 2021-06-03 16:48 UTC (permalink / raw)
  To: Bartosz Golaszewski; +Cc: Armin Kuster, openembeded-devel

On Wed, Jun 2, 2021 at 7:15 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> libgpiod needs the gpio-mockup kernel module to be loadable (not
> built-in). Add kernel-modules to RRECOMMENDS.
>
> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
> ---
>  meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> index febf625a6..8dda8a2a6 100644
> --- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> +++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> @@ -48,6 +48,7 @@ FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*.so"
>  FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
>
>  RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-python', '', d)}"
> +RRECOMMENDS_${PN}-ptest += "kernel-modules"
>

do we need full swath of modules ? or can we be surgical ?

>  PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'tests', '', d)}"
>
> --
> 2.30.1
>

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

* Re: [meta-oe][PATCH 9/9] libgpiod: ptest: add kernel-modules to RRECOMMENDS
  2021-06-03 16:48   ` Khem Raj
@ 2021-06-04  8:04     ` Bartosz Golaszewski
  0 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2021-06-04  8:04 UTC (permalink / raw)
  To: Khem Raj; +Cc: Armin Kuster, openembeded-devel

On Thu, Jun 3, 2021 at 6:48 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> On Wed, Jun 2, 2021 at 7:15 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >
> > libgpiod needs the gpio-mockup kernel module to be loadable (not
> > built-in). Add kernel-modules to RRECOMMENDS.
> >
> > Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
> > ---
> >  meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> > index febf625a6..8dda8a2a6 100644
> > --- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> > +++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> > @@ -48,6 +48,7 @@ FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*.so"
> >  FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
> >
> >  RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-python', '', d)}"
> > +RRECOMMENDS_${PN}-ptest += "kernel-modules"
> >
>
> do we need full swath of modules ? or can we be surgical ?
>

No, we don't - all we need is kernel-module-gpio-mockup. I wasn't
aware that each module is packaged separately. I will send a follow-up
just for this patch.

Bart

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

* Re: [meta-oe][PATCH 8/9] libgpiod: ptest: warn if the gpio-mockup kernel module is not selected
  2021-06-02 14:15 ` [meta-oe][PATCH 8/9] libgpiod: ptest: warn if the gpio-mockup kernel module is not selected Bartosz Golaszewski
@ 2021-06-05 22:16   ` Khem Raj
  2021-06-07  8:55     ` Bartosz Golaszewski
  0 siblings, 1 reply; 22+ messages in thread
From: Khem Raj @ 2021-06-05 22:16 UTC (permalink / raw)
  To: Bartosz Golaszewski; +Cc: Armin Kuster, openembeded-devel

On Wed, Jun 2, 2021 at 7:15 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> libgpiod test-suites work with the gpio-mockup kernel module. When using
> linux-yocto, it's enabled using the gpio/mockup.scc kernel feature. Check
> if this feature is present in KERNEL_FEATURE and warn if not.
>
> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
> ---
>  meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> index 874453fbd..febf625a6 100644
> --- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> +++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> @@ -52,6 +52,13 @@ RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-py
>  PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'tests', '', d)}"
>
>  do_install_ptest() {
> +    if [ "${PREFERRED_PROVIDER_virtual/kernel}" = "linux-yocto" ] && \
> +       ${@bb.utils.contains('KERNEL_FEATURES', 'features/gpio/mockup.scc', 'false', 'true',d)}; then
> +        bbwarn "libgpiod test-suites need the gpio-mockup
> +module and will not work without it. Consider adding
> +'features/gpio/mockup.scc' to KERNEL_FEATURES"
> +    fi
> +

perhaps turn this into a bbnote something like what libbpf is doing see
http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-kernel/libbpf/libbpf_0.3.bb?h=master

>      install -d ${D}${PTEST_PATH}/tests
>
>      # These are the core C library tests
> --
> 2.30.1
>

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

* Re: [meta-oe][PATCH 8/9] libgpiod: ptest: warn if the gpio-mockup kernel module is not selected
  2021-06-05 22:16   ` Khem Raj
@ 2021-06-07  8:55     ` Bartosz Golaszewski
  2021-06-07 15:14       ` Khem Raj
  0 siblings, 1 reply; 22+ messages in thread
From: Bartosz Golaszewski @ 2021-06-07  8:55 UTC (permalink / raw)
  To: Khem Raj; +Cc: Armin Kuster, openembeded-devel

On Sun, Jun 6, 2021 at 12:17 AM Khem Raj <raj.khem@gmail.com> wrote:
>
> On Wed, Jun 2, 2021 at 7:15 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >
> > libgpiod test-suites work with the gpio-mockup kernel module. When using
> > linux-yocto, it's enabled using the gpio/mockup.scc kernel feature. Check
> > if this feature is present in KERNEL_FEATURE and warn if not.
> >
> > Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
> > ---
> >  meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> > index 874453fbd..febf625a6 100644
> > --- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> > +++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> > @@ -52,6 +52,13 @@ RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-py
> >  PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'tests', '', d)}"
> >
> >  do_install_ptest() {
> > +    if [ "${PREFERRED_PROVIDER_virtual/kernel}" = "linux-yocto" ] && \
> > +       ${@bb.utils.contains('KERNEL_FEATURES', 'features/gpio/mockup.scc', 'false', 'true',d)}; then
> > +        bbwarn "libgpiod test-suites need the gpio-mockup
> > +module and will not work without it. Consider adding
> > +'features/gpio/mockup.scc' to KERNEL_FEATURES"
> > +    fi
> > +
>
> perhaps turn this into a bbnote something like what libbpf is doing see
> http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-kernel/libbpf/libbpf_0.3.bb?h=master
>

I really think that a warning is in order here. The ptests won't work
without this module. At the same time we can't really skip the package
altogether because the build may be using a different kernel recipe
with its own defconfig - this is why we first check if we're using
linux-yocto.

Bart

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

* Re: [meta-oe][PATCH 8/9] libgpiod: ptest: warn if the gpio-mockup kernel module is not selected
  2021-06-07  8:55     ` Bartosz Golaszewski
@ 2021-06-07 15:14       ` Khem Raj
  2021-06-07 15:54         ` Bartosz Golaszewski
  0 siblings, 1 reply; 22+ messages in thread
From: Khem Raj @ 2021-06-07 15:14 UTC (permalink / raw)
  To: Bartosz Golaszewski; +Cc: Armin Kuster, openembeded-devel

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

On Mon, Jun 7, 2021 at 1:55 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:

> On Sun, Jun 6, 2021 at 12:17 AM Khem Raj <raj.khem@gmail.com> wrote:
> >
> > On Wed, Jun 2, 2021 at 7:15 AM Bartosz Golaszewski <brgl@bgdev.pl>
> wrote:
> > >
> > > libgpiod test-suites work with the gpio-mockup kernel module. When
> using
> > > linux-yocto, it's enabled using the gpio/mockup.scc kernel feature.
> Check
> > > if this feature is present in KERNEL_FEATURE and warn if not.
> > >
> > > Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
> > > ---
> > >  meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb | 7 +++++++
> > >  1 file changed, 7 insertions(+)
> > >
> > > diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> > > index 874453fbd..febf625a6 100644
> > > --- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> > > +++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> > > @@ -52,6 +52,13 @@ RRECOMMENDS_${PN} +=
> "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-py
> > >  PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES',
> 'ptest', 'tests', '', d)}"
> > >
> > >  do_install_ptest() {
> > > +    if [ "${PREFERRED_PROVIDER_virtual/kernel}" = "linux-yocto" ] && \
> > > +       ${@bb.utils.contains('KERNEL_FEATURES',
> 'features/gpio/mockup.scc', 'false', 'true',d)}; then
> > > +        bbwarn "libgpiod test-suites need the gpio-mockup
> > > +module and will not work without it. Consider adding
> > > +'features/gpio/mockup.scc' to KERNEL_FEATURES"
> > > +    fi
> > > +
> >
> > perhaps turn this into a bbnote something like what libbpf is doing see
> >
> http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-kernel/libbpf/libbpf_0.3.bb?h=master
> >
>
> I really think that a warning is in order here. The ptests won't work
> without this module. At the same time we can't really skip the package
> altogether because the build may be using a different kernel recipe
> with its own defconfig - this is why we first check if we're using
> linux-yocto.


It should check for module being built in kernel irrespective of Linux
yocto that is right but we perhaps need a logic to consider the case where
I might have a kernel without this option and distro is using ptest feature

>
>
> Bart
>

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

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

* Re: [meta-oe][PATCH 8/9] libgpiod: ptest: warn if the gpio-mockup kernel module is not selected
  2021-06-07 15:14       ` Khem Raj
@ 2021-06-07 15:54         ` Bartosz Golaszewski
  2021-06-08  0:31           ` Khem Raj
  0 siblings, 1 reply; 22+ messages in thread
From: Bartosz Golaszewski @ 2021-06-07 15:54 UTC (permalink / raw)
  To: Khem Raj; +Cc: Armin Kuster, openembeded-devel

On Mon, Jun 7, 2021 at 5:14 PM Khem Raj <raj.khem@gmail.com> wrote:
>
>
>
> On Mon, Jun 7, 2021 at 1:55 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>>
>> On Sun, Jun 6, 2021 at 12:17 AM Khem Raj <raj.khem@gmail.com> wrote:
>> >
>> > On Wed, Jun 2, 2021 at 7:15 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>> > >
>> > > libgpiod test-suites work with the gpio-mockup kernel module. When using
>> > > linux-yocto, it's enabled using the gpio/mockup.scc kernel feature. Check
>> > > if this feature is present in KERNEL_FEATURE and warn if not.
>> > >
>> > > Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
>> > > ---
>> > >  meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb | 7 +++++++
>> > >  1 file changed, 7 insertions(+)
>> > >
>> > > diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
>> > > index 874453fbd..febf625a6 100644
>> > > --- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
>> > > +++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
>> > > @@ -52,6 +52,13 @@ RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-py
>> > >  PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'tests', '', d)}"
>> > >
>> > >  do_install_ptest() {
>> > > +    if [ "${PREFERRED_PROVIDER_virtual/kernel}" = "linux-yocto" ] && \
>> > > +       ${@bb.utils.contains('KERNEL_FEATURES', 'features/gpio/mockup.scc', 'false', 'true',d)}; then
>> > > +        bbwarn "libgpiod test-suites need the gpio-mockup
>> > > +module and will not work without it. Consider adding
>> > > +'features/gpio/mockup.scc' to KERNEL_FEATURES"
>> > > +    fi
>> > > +
>> >
>> > perhaps turn this into a bbnote something like what libbpf is doing see
>> > http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-kernel/libbpf/libbpf_0.3.bb?h=master
>> >
>>
>> I really think that a warning is in order here. The ptests won't work
>> without this module. At the same time we can't really skip the package
>> altogether because the build may be using a different kernel recipe
>> with its own defconfig - this is why we first check if we're using
>> linux-yocto.
>
>
> It should check for module being built in kernel irrespective of Linux yocto that is right but we perhaps need a logic to consider the case where I might have a kernel without this option and distro is using ptest feature

No, we should not check for the module if we're not using linux-yocto
because in this case we most likely won't be using yocto-linux-cache.

For the second part - a warning doesn't really stop the build - do you
really think it's too much? I mean, I can change it into a bbnote but
I don't see why.

Bart

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

* Re: [meta-oe][PATCH 8/9] libgpiod: ptest: warn if the gpio-mockup kernel module is not selected
  2021-06-07 15:54         ` Bartosz Golaszewski
@ 2021-06-08  0:31           ` Khem Raj
  2021-06-08 20:00             ` Bartosz Golaszewski
  0 siblings, 1 reply; 22+ messages in thread
From: Khem Raj @ 2021-06-08  0:31 UTC (permalink / raw)
  To: Bartosz Golaszewski; +Cc: Armin Kuster, openembeded-devel

On Mon, Jun 7, 2021 at 8:54 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> On Mon, Jun 7, 2021 at 5:14 PM Khem Raj <raj.khem@gmail.com> wrote:
> >
> >
> >
> > On Mon, Jun 7, 2021 at 1:55 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >>
> >> On Sun, Jun 6, 2021 at 12:17 AM Khem Raj <raj.khem@gmail.com> wrote:
> >> >
> >> > On Wed, Jun 2, 2021 at 7:15 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >> > >
> >> > > libgpiod test-suites work with the gpio-mockup kernel module. When using
> >> > > linux-yocto, it's enabled using the gpio/mockup.scc kernel feature. Check
> >> > > if this feature is present in KERNEL_FEATURE and warn if not.
> >> > >
> >> > > Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
> >> > > ---
> >> > >  meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb | 7 +++++++
> >> > >  1 file changed, 7 insertions(+)
> >> > >
> >> > > diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> >> > > index 874453fbd..febf625a6 100644
> >> > > --- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> >> > > +++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> >> > > @@ -52,6 +52,13 @@ RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-py
> >> > >  PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'tests', '', d)}"
> >> > >
> >> > >  do_install_ptest() {
> >> > > +    if [ "${PREFERRED_PROVIDER_virtual/kernel}" = "linux-yocto" ] && \
> >> > > +       ${@bb.utils.contains('KERNEL_FEATURES', 'features/gpio/mockup.scc', 'false', 'true',d)}; then
> >> > > +        bbwarn "libgpiod test-suites need the gpio-mockup
> >> > > +module and will not work without it. Consider adding
> >> > > +'features/gpio/mockup.scc' to KERNEL_FEATURES"
> >> > > +    fi
> >> > > +
> >> >
> >> > perhaps turn this into a bbnote something like what libbpf is doing see
> >> > http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-kernel/libbpf/libbpf_0.3.bb?h=master
> >> >
> >>
> >> I really think that a warning is in order here. The ptests won't work
> >> without this module. At the same time we can't really skip the package
> >> altogether because the build may be using a different kernel recipe
> >> with its own defconfig - this is why we first check if we're using
> >> linux-yocto.
> >
> >
> > It should check for module being built in kernel irrespective of Linux yocto that is right but we perhaps need a logic to consider the case where I might have a kernel without this option and distro is using ptest feature
>
> No, we should not check for the module if we're not using linux-yocto
> because in this case we most likely won't be using yocto-linux-cache.
>
> For the second part - a warning doesn't really stop the build - do you
> really think it's too much? I mean, I can change it into a bbnote but
> I don't see why.

I don't like warnings they mean same as errors in some ways, So either
have linux-yocto enable this module or turn it into a note
see AB https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/1309
it should be green :)

>
> Bart

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

* Re: [meta-oe][PATCH 8/9] libgpiod: ptest: warn if the gpio-mockup kernel module is not selected
  2021-06-08  0:31           ` Khem Raj
@ 2021-06-08 20:00             ` Bartosz Golaszewski
  2021-06-09 19:26               ` Bartosz Golaszewski
  0 siblings, 1 reply; 22+ messages in thread
From: Bartosz Golaszewski @ 2021-06-08 20:00 UTC (permalink / raw)
  To: Khem Raj; +Cc: Armin Kuster, openembeded-devel

On Tue, Jun 8, 2021 at 2:31 AM Khem Raj <raj.khem@gmail.com> wrote:
>
> On Mon, Jun 7, 2021 at 8:54 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >
> > On Mon, Jun 7, 2021 at 5:14 PM Khem Raj <raj.khem@gmail.com> wrote:
> > >
> > >
> > >
> > > On Mon, Jun 7, 2021 at 1:55 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > >>
> > >> On Sun, Jun 6, 2021 at 12:17 AM Khem Raj <raj.khem@gmail.com> wrote:
> > >> >
> > >> > On Wed, Jun 2, 2021 at 7:15 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > >> > >
> > >> > > libgpiod test-suites work with the gpio-mockup kernel module. When using
> > >> > > linux-yocto, it's enabled using the gpio/mockup.scc kernel feature. Check
> > >> > > if this feature is present in KERNEL_FEATURE and warn if not.
> > >> > >
> > >> > > Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
> > >> > > ---
> > >> > >  meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb | 7 +++++++
> > >> > >  1 file changed, 7 insertions(+)
> > >> > >
> > >> > > diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> > >> > > index 874453fbd..febf625a6 100644
> > >> > > --- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> > >> > > +++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> > >> > > @@ -52,6 +52,13 @@ RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-py
> > >> > >  PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'tests', '', d)}"
> > >> > >
> > >> > >  do_install_ptest() {
> > >> > > +    if [ "${PREFERRED_PROVIDER_virtual/kernel}" = "linux-yocto" ] && \
> > >> > > +       ${@bb.utils.contains('KERNEL_FEATURES', 'features/gpio/mockup.scc', 'false', 'true',d)}; then
> > >> > > +        bbwarn "libgpiod test-suites need the gpio-mockup
> > >> > > +module and will not work without it. Consider adding
> > >> > > +'features/gpio/mockup.scc' to KERNEL_FEATURES"
> > >> > > +    fi
> > >> > > +
> > >> >
> > >> > perhaps turn this into a bbnote something like what libbpf is doing see
> > >> > http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-kernel/libbpf/libbpf_0.3.bb?h=master
> > >> >
> > >>
> > >> I really think that a warning is in order here. The ptests won't work
> > >> without this module. At the same time we can't really skip the package
> > >> altogether because the build may be using a different kernel recipe
> > >> with its own defconfig - this is why we first check if we're using
> > >> linux-yocto.
> > >
> > >
> > > It should check for module being built in kernel irrespective of Linux yocto that is right but we perhaps need a logic to consider the case where I might have a kernel without this option and distro is using ptest feature
> >
> > No, we should not check for the module if we're not using linux-yocto
> > because in this case we most likely won't be using yocto-linux-cache.
> >
> > For the second part - a warning doesn't really stop the build - do you
> > really think it's too much? I mean, I can change it into a bbnote but
> > I don't see why.
>
> I don't like warnings they mean same as errors in some ways, So either
> have linux-yocto enable this module or turn it into a note
> see AB https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/1309
> it should be green :)
>

So I went on to add it to OE-core and noticed this:

4e03f041396121f6143fd81bf5e429015146bfdc
Author: Sakib Sajal <sakib.sajal@windriver.com>
Date:   Wed Jan 27 13:03:32 2021 -0500

    linux-yocto*: add features/gpio/mockup.scc to KERNEL_FEATURES

    add features/gpio/mockup.scc to KERNEL_FEATURES when ptest
    is enabled as it is required for testing libgpiod.

    (From OE-Core rev: 906cde06bee319e788c76abb8f8295ed9921ccb1)

    Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

So I wonder - why do I see my warning if I don't add gpio-mockup to
kernel features myself? A quick check shows this:

$ bitbake -e core-image-minimal | grep ^DISTRO_FEATURES=
DISTRO_FEATURES="acl alsa argp bluetooth debuginfod ext2 ipv4 ipv6
largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc
x11 vfat seccomp largefile opengl ptest multiarch wayland vulkan
systemd pam pulseaudio gobject-introspection-data ldconfig"
$ bitbake -e core-image-minimal | grep ^KERNEL_FEATURES=
KERNEL_FEATURES=""

I don't have the time to debug this today but it looks like a bug -
the feature should actually be pulled in automatically.

Bart

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

* Re: [meta-oe][PATCH 8/9] libgpiod: ptest: warn if the gpio-mockup kernel module is not selected
  2021-06-08 20:00             ` Bartosz Golaszewski
@ 2021-06-09 19:26               ` Bartosz Golaszewski
  0 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2021-06-09 19:26 UTC (permalink / raw)
  To: Khem Raj; +Cc: Armin Kuster, openembeded-devel

On Tue, Jun 8, 2021 at 10:00 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> On Tue, Jun 8, 2021 at 2:31 AM Khem Raj <raj.khem@gmail.com> wrote:
> >
> > On Mon, Jun 7, 2021 at 8:54 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > >
> > > On Mon, Jun 7, 2021 at 5:14 PM Khem Raj <raj.khem@gmail.com> wrote:
> > > >
> > > >
> > > >
> > > > On Mon, Jun 7, 2021 at 1:55 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > > >>
> > > >> On Sun, Jun 6, 2021 at 12:17 AM Khem Raj <raj.khem@gmail.com> wrote:
> > > >> >
> > > >> > On Wed, Jun 2, 2021 at 7:15 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > > >> > >
> > > >> > > libgpiod test-suites work with the gpio-mockup kernel module. When using
> > > >> > > linux-yocto, it's enabled using the gpio/mockup.scc kernel feature. Check
> > > >> > > if this feature is present in KERNEL_FEATURE and warn if not.
> > > >> > >
> > > >> > > Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
> > > >> > > ---
> > > >> > >  meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb | 7 +++++++
> > > >> > >  1 file changed, 7 insertions(+)
> > > >> > >
> > > >> > > diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> > > >> > > index 874453fbd..febf625a6 100644
> > > >> > > --- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> > > >> > > +++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
> > > >> > > @@ -52,6 +52,13 @@ RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-py
> > > >> > >  PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'tests', '', d)}"
> > > >> > >
> > > >> > >  do_install_ptest() {
> > > >> > > +    if [ "${PREFERRED_PROVIDER_virtual/kernel}" = "linux-yocto" ] && \
> > > >> > > +       ${@bb.utils.contains('KERNEL_FEATURES', 'features/gpio/mockup.scc', 'false', 'true',d)}; then
> > > >> > > +        bbwarn "libgpiod test-suites need the gpio-mockup
> > > >> > > +module and will not work without it. Consider adding
> > > >> > > +'features/gpio/mockup.scc' to KERNEL_FEATURES"
> > > >> > > +    fi
> > > >> > > +
> > > >> >
> > > >> > perhaps turn this into a bbnote something like what libbpf is doing see
> > > >> > http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-kernel/libbpf/libbpf_0.3.bb?h=master
> > > >> >
> > > >>
> > > >> I really think that a warning is in order here. The ptests won't work
> > > >> without this module. At the same time we can't really skip the package
> > > >> altogether because the build may be using a different kernel recipe
> > > >> with its own defconfig - this is why we first check if we're using
> > > >> linux-yocto.
> > > >
> > > >
> > > > It should check for module being built in kernel irrespective of Linux yocto that is right but we perhaps need a logic to consider the case where I might have a kernel without this option and distro is using ptest feature
> > >
> > > No, we should not check for the module if we're not using linux-yocto
> > > because in this case we most likely won't be using yocto-linux-cache.
> > >
> > > For the second part - a warning doesn't really stop the build - do you
> > > really think it's too much? I mean, I can change it into a bbnote but
> > > I don't see why.
> >
> > I don't like warnings they mean same as errors in some ways, So either
> > have linux-yocto enable this module or turn it into a note
> > see AB https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/1309
> > it should be green :)
> >
>
> So I went on to add it to OE-core and noticed this:
>
> 4e03f041396121f6143fd81bf5e429015146bfdc
> Author: Sakib Sajal <sakib.sajal@windriver.com>
> Date:   Wed Jan 27 13:03:32 2021 -0500
>
>     linux-yocto*: add features/gpio/mockup.scc to KERNEL_FEATURES
>
>     add features/gpio/mockup.scc to KERNEL_FEATURES when ptest
>     is enabled as it is required for testing libgpiod.
>
>     (From OE-Core rev: 906cde06bee319e788c76abb8f8295ed9921ccb1)
>
>     Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
>     Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>
> So I wonder - why do I see my warning if I don't add gpio-mockup to
> kernel features myself? A quick check shows this:
>
> $ bitbake -e core-image-minimal | grep ^DISTRO_FEATURES=
> DISTRO_FEATURES="acl alsa argp bluetooth debuginfod ext2 ipv4 ipv6
> largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc
> x11 vfat seccomp largefile opengl ptest multiarch wayland vulkan
> systemd pam pulseaudio gobject-introspection-data ldconfig"
> $ bitbake -e core-image-minimal | grep ^KERNEL_FEATURES=
> KERNEL_FEATURES=""
>
> I don't have the time to debug this today but it looks like a bug -
> the feature should actually be pulled in automatically.
>
> Bart

Ok I see now. libgpiod recipe sees the global KERNEL_FEATURES as set
in local.conf and distro/machine config files, meanwhile linux-yocto
gets the global value and extends it with ptest features but only
locally, so libgpiod never sees those features even though they are
indeed included. In that case I suppose it's fine to revert this
change, I'll send a patch.

Bartosz

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

end of thread, other threads:[~2021-06-09 19:27 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02 14:14 [meta-oe][PATCH 0/9] libgpiod: ptest improvements Bartosz Golaszewski
2021-06-02 14:14 ` [meta-oe][PATCH 1/9] libgpiod: coding style fixes Bartosz Golaszewski
2021-06-02 14:14 ` [meta-oe][PATCH 2/9] libgpiod: list all packages in a single assignment Bartosz Golaszewski
2021-06-02 14:14 ` [meta-oe][PATCH 3/9] libgpiod: fix RRECOMMENDS for python bindings Bartosz Golaszewski
2021-06-02 14:14 ` [meta-oe][PATCH 4/9] libgpiod: correctly split output files into packages Bartosz Golaszewski
2021-06-02 14:14 ` [meta-oe][PATCH 5/9] libgpiod: add RDEPENDS for tests Bartosz Golaszewski
2021-06-02 14:14 ` [meta-oe][PATCH 6/9] libgpiod: redirect stdout from the ptest executable to a file Bartosz Golaszewski
2021-06-02 14:14 ` [meta-oe][PATCH 7/9] libgpiod: ptest: run all test-suites if possible Bartosz Golaszewski
2021-06-02 14:15 ` [meta-oe][PATCH 8/9] libgpiod: ptest: warn if the gpio-mockup kernel module is not selected Bartosz Golaszewski
2021-06-05 22:16   ` Khem Raj
2021-06-07  8:55     ` Bartosz Golaszewski
2021-06-07 15:14       ` Khem Raj
2021-06-07 15:54         ` Bartosz Golaszewski
2021-06-08  0:31           ` Khem Raj
2021-06-08 20:00             ` Bartosz Golaszewski
2021-06-09 19:26               ` Bartosz Golaszewski
2021-06-02 14:15 ` [meta-oe][PATCH 9/9] libgpiod: ptest: add kernel-modules to RRECOMMENDS Bartosz Golaszewski
2021-06-03 16:48   ` Khem Raj
2021-06-04  8:04     ` Bartosz Golaszewski
2021-06-03  0:03 ` [meta-oe][PATCH 0/9] libgpiod: ptest improvements Khem Raj
2021-06-03  8:16   ` Bartosz Golaszewski
     [not found]   ` <CAMpxmJXBzL8QaAoLAB6cD8W8_mbBhjJ+d=gM8CGvQkBSPLDPtw@mail.gmail.com>
2021-06-03 15:11     ` Khem Raj

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.