rpm-sequoia: upgrade 1.7.0 -> 1.9.0
PATCH v2 1/1 rpm-sequoia: upgrade 1.7.0 -> 1.9.0
The upstream project has extended the tests slightly, by adding a cargo command to ensure that the library is built before the tests would be executed. This doesn't really work for ptests, since it rebuilds the library from scratch on the target. As an attempt to solve this issue, introduce an environment variable with a patch, which, if present, will skip building the library before executing the test.
Changelog:
https://github.com/rpm-software-management/rpm-sequoia/compare/v1.7.0...v1.9.0
---
v2: set correct permissions on run-ptest script
...-lib-for-symbols-tests-conditionally.patch | 41 ++
.../rpm-sequoia/rpm-sequoia-crates.inc | 522 ++++++++++--------
...-sequoia_1.7.0.bb => rpm-sequoia_1.9.0.bb} | 14 +-
3 files changed, 334 insertions(+), 243 deletions(-)
create mode 100644 meta/recipes-devtools/rpm-sequoia/files/0001-tests-build-lib-for-symbols-tests-conditionally.patch
rename meta/recipes-devtools/rpm-sequoia/{rpm-sequoia_1.7.0.bb => rpm-sequoia_1.9.0.bb} (85%)meta/recipes-devtools/rpm-sequoia/files/0001-tests-build-lib-for-symbols-tests-conditionally.patch new file +41 -0
@@ -0,0 +1,41 @@ +From aaae1cc05c906b1d413e02f9da0b908e4cf9456d Mon Sep 17 00:00:00 2001 +From: Gyorgy Sarvari <[email protected]> +Date: Fri, 8 Aug 2025 18:17:39 +0200 +Subject: [PATCH] tests: build lib for symbols tests conditionally + +When the tests are executed, cargo might not be available, +however the library could be built already. + +An example of when this could happen is cross-compiling for +embedded systems: when the library is compiled for a different +(potentially low powered) system, then at runtime frequently +there is no rust toolchain available to build the library; +however the library is usually already built and installed. + +To be able to run the test on pre-built artifacts, introduce +an environment variable, "DONT_BUILD_TEST_LIB", which, if +present with any value, will skip building the library. + +Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm-sequoia/pull/99] + +Signed-off-by: Gyorgy Sarvari <[email protected]> +--- + tests/symbols.rs | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/tests/symbols.rs b/tests/symbols.rs +index c532a15..0c4d268 100644 +--- a/tests/symbols.rs ++++ b/tests/symbols.rs +@@ -9,7 +9,10 @@ use assert_cmd::assert::OutputAssertExt; + #[test] + fn symbols() -> anyhow::Result<()> { + // Make sure the library is built. +- Command::new("cargo").arg("build").ok()?; ++ let skip_build_library = env::var("TEST_DONT_BUILD_LIB").is_ok(); ++ if ! skip_build_library { ++ Command::new("cargo").arg("build").ok()?; ++ } + + // We want the location of the build directory (e.g., + // `/tmp/rpm-sequoia/debug`).
meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crates.inc +284 -238
757 lines not on this page · raw message
meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.9.0.bb renamed from meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.7.0.bb +9 -5
@@ -12,11 +12,10 @@ DEPENDS = "openssl" inherit pkgconfig rust cargo cargo-update-recipe-crates ptest-cargo -SRC_URI = "git://github.com/rpm-software-management/rpm-sequoia.git;protocol=https;branch=main \ - file://0001-Use-optional-env-vars-to-force-runtime-paths-in-test.patch \ -" - -SRCREV = "0667e04ae7fb8cf0490919978d69883d16400e41" +SRC_URI = "git://github.com/rpm-software-management/rpm-sequoia.git;protocol=https;branch=main;tag=v${PV} \ + file://0001-Use-optional-env-vars-to-force-runtime-paths-in-test.patch \ + file://0001-tests-build-lib-for-symbols-tests-conditionally.patch" +SRCREV = "cd090b02119565c6d171fa9a892790c966cf10ef" require ${BPN}-crates.inc
@@ -64,6 +63,11 @@ do_install:append () { do_install_ptest:append () { install -d ${D}${PTEST_PATH}/src install -m 644 ${S}/src/symbols.txt ${D}${PTEST_PATH}/src/symbols.txt + + echo "#!/bin/sh" > ${D}${PTEST_PATH}/run-ptest + echo "rc=0" >> ${D}${PTEST_PATH}/run-ptest + echo "export TEST_DONT_BUILD_LIB=1" >> ${D}${PTEST_PATH}/run-ptest + chmod 755 ${D}${PTEST_PATH}/run-ptest } # Tests need objdump
Hi,
Quoted 85 lines · Gyorgy Sarvari via lists.openembedded.org
The upstream project has extended the tests slightly, by adding a cargo command
to ensure that the library is built before the tests would be executed. This
doesn't really work for ptests, since it rebuilds the library from scratch on the
target. As an attempt to solve this issue, introduce an environment variable with
a patch, which, if present, will skip building the library before executing the test.Changelog:
https://github.com/rpm-software-management/rpm-sequoia/compare/v1.7.0...v1.9.0
Signed-off-by Gyorgy Sarvari <[email protected]>---
v2: set correct permissions on run-ptest script...-lib-for-symbols-tests-conditionally.patch | 41 ++ .../rpm-sequoia/rpm-sequoia-crates.inc | 522 ++++++++++-------- ...-sequoia_1.7.0.bb => rpm-sequoia_1.9.0.bb} | 14 +- 3 files changed, 334 insertions(+), 243 deletions(-) create mode 100644 meta/recipes-devtools/rpm-sequoia/files/0001-tests-build-lib-for-symbols-tests-conditionally.patch rename meta/recipes-devtools/rpm-sequoia/{rpm-sequoia_1.7.0.bb =>rpm-sequoia_1.9.0.bb} (85%)
diff --git
a/meta/recipes-devtools/rpm-sequoia/files/0001-tests-build-lib-for-symbols-tests-conditionally.patchb/meta/recipes-devtools/rpm-sequoia/files/0001-tests-build-lib-for-symbols-tests-conditionally.patchnew file mode 100644
index 0000000000..ddc897b86c
---/dev/null
+++b/meta/recipes-devtools/rpm-sequoia/files/0001-tests-build-lib-for-symbols-tests-conditionally.patch(quoted diff) +19
-0@@ -0,0 +1,41 @@ +From aaae1cc05c906b1d413e02f9da0b908e4cf9456d Mon Sep 17 00:00:00 2001 +From: Gyorgy Sarvari <[email protected]> +Date: Fri, 8 Aug 2025 18:17:39 +0200 +Subject: [PATCH] tests: build lib for symbols tests conditionally + +When the tests are executed, cargo might not be available, +however the library could be built already. + +An example of when this could happen is cross-compiling for +embedded systems: when the library is compiled for a different +(potentially low powered) system, then at runtime frequently +there is no rust toolchain available to build the library; +however the library is usually already built and installed. + +To be able to run the test on pre-built artifacts, introduce +an environment variable, "DONT_BUILD_TEST_LIB", which, if +present with any value, will skip building the library. + +Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm-sequoia/pull/99]
(quoted diff) +22
-0+ +Signed-off-by: Gyorgy Sarvari <[email protected]> +--- + tests/symbols.rs | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/tests/symbols.rs b/tests/symbols.rs +index c532a15..0c4d268 100644 +--- a/tests/symbols.rs ++++ b/tests/symbols.rs +@@ -9,7 +9,10 @@ use assert_cmd::assert::OutputAssertExt; + #[test] + fn symbols() -> anyhow::Result<()> { + // Make sure the library is built. +- Command::new("cargo").arg("build").ok()?; ++ let skip_build_library = env::var("TEST_DONT_BUILD_LIB").is_ok(); ++ if ! skip_build_library { ++ Command::new("cargo").arg("build").ok()?; ++ } + + // We want the location of the build directory (e.g., + // `/tmp/rpm-sequoia/debug`).meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crates.inc +0
-0
meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crates.inc SRC_URI += " \
Quoted 1 line
meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crates.inc +0
-0@@ -8,49 +8,51 @@ SRC_URI += " \
(quoted diff) +0 -0
Quoted 40 lines
b/meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.9.0.bb similarity index 85%
rename from meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.7.0.bb rename to meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.9.0.bb index46f9ee8548..418bfb574a100644meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.9.0.bb renamed from meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.7.0.bb +0
-1@@ -12,11 +12,10 @@ DEPENDS = "openssl" inherit pkgconfig rust cargo cargo-update-recipe-crates ptest-cargo -SRC_URI = "git://github.com/rpm-software-management/rpm-sequoia.git;protocol=https;branch=main \
meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.9.0.bb renamed from meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.7.0.bb +1
-4- file://0001-Use-optional-env-vars-to-force-runtime-paths-in-test.patch \ -" - -SRCREV = "0667e04ae7fb8cf0490919978d69883d16400e41" +SRC_URI = "git://github.com/rpm-software-management/rpm-sequoia.git;protocol=https;branch=main;tag=v${PV}
<http://github.com/rpm-software-management/rpm-sequoia.git;protocol=https;branch=main;tag=v$%7BPV%7D>
\meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.9.0.bb renamed from meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.7.0.bb +3
-0+ file://0001-Use-optional-env-vars-to-force-runtime-paths-in-test.patch \ + file://0001-tests-build-lib-for-symbols-tests-conditionally.patch" +SRCREV = "cd090b02119565c6d171fa9a892790c966cf10ef" require ${BPN}-crates.inc@@ -64,6 +63,11 @@ do_install:append () { do_install_ptest:append () { install -d ${D}${PTEST_PATH}/src install -m 644 ${S}/src/symbols.txt
${D}${PTEST_PATH}/src/symbols.txtmeta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.9.0.bb renamed from meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.7.0.bb +4
-0+ + echo "#!/bin/sh" > ${D}${PTEST_PATH}/run-ptest + echo "rc=0" >> ${D}${PTEST_PATH}/run-ptest + echo "export TEST_DONT_BUILD_LIB=1" >>
Quoted 3 lines
${D}${PTEST_PATH}/run-ptest
+ chmod 755 ${D}${PTEST_PATH}/run-ptest
Wouldn't that make run-ptest basically a no-op?
Maybe you can, either:
* rename the run-ptest generated by cargo-ptest and exec'ing it from your script to keep the envvar
* overwrite the run-ptest generated by cargo-ptest (but keep its current
content: e.g calling the test binaries in sequence, printing "PASS:" ...)
Best regards,
Quoted 15 lines
}
# Tests need objdump
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#221671):
https://lists.openembedded.org/g/openembedded-core/message/221671
Mute This Topic: https://lists.openembedded.org/mt/114612984/4316185
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 2 lines
Yoann Congal Smile ECS
Quoted 2 lines · Yoann Congal
Hi,
<snip>
Quoted 16 lines
require ${BPN}-crates.inc
@@ -64,6 +63,11 @@ do_install:append () {
do_install_ptest:append () {
install -d ${D}${PTEST_PATH}/src
install -m 644 ${S}/src/symbols.txt
${D}${PTEST_PATH}/src/symbols.txt
+
+ echo "#!/bin/sh" > ${D}${PTEST_PATH}/run-ptest
+ echo "rc=0" >> ${D}${PTEST_PATH}/run-ptest
+ echo "export TEST_DONT_BUILD_LIB=1" >>
${D}${PTEST_PATH}/run-ptest
+ chmod 755 ${D}${PTEST_PATH}/run-ptestQuoted 2 lines
Wouldn't that make run-ptest basically a no-op?
Thanks for reviewing.
It looks like a no-op, but it isn't. cargo-ptest checks if run-ptest script exist[1], and if it does, it appends its own content to it, so both are kept.
What came to my mind after sending it is to add this script simply as a file to SRC_URI instead of echoing it, but didn't want a v3 without someone asking for it.
[1]:
https://git.yoctoproject.org/poky/tree/meta/classes-recipe/ptest-cargo.bbclass#n102
Quoted 31 lines
Maybe you can, either:
* rename the run-ptest generated by cargo-ptest and exec'ing it from your script to keep the envvar
* overwrite the run-ptest generated by cargo-ptest (but keep its current content: e.g calling the test binaries in sequence, printing "PASS:" ...)Best regards,
} # Tests need objdump -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#221671): https://lists.openembedded.org/g/openembedded-core/message/221671 Mute This Topic: https://lists.openembedded.org/mt/114612984/4316185 Group Owner: [email protected] <mailto:openembedded-core%[email protected]> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-Signature · 2 lines
Yoann Congal Smile ECS
Quoted 33 lines · Gyorgy Sarvari
Quoted 2 lines · Yoann Congal
Hi,
<snip>
Quoted 16 lines
require ${BPN}-crates.inc @@ -64,6 +63,11 @@ do_install:append () { do_install_ptest:append () { install -d ${D}${PTEST_PATH}/src install -m 644 ${S}/src/symbols.txt ${D}${PTEST_PATH}/src/symbols.txt + + echo "#!/bin/sh" > ${D}${PTEST_PATH}/run-ptest + echo "rc=0" >> ${D}${PTEST_PATH}/run-ptest + echo "export TEST_DONT_BUILD_LIB=1" >> ${D}${PTEST_PATH}/run-ptest + chmod 755 ${D}${PTEST_PATH}/run-ptestQuoted 2 lines
Wouldn't that make run-ptest basically a no-op?
Thanks for reviewing.
It looks like a no-op, but it isn't. cargo-ptest checks if run-ptest script exist[1], and if it does, it appends its own content to it, so both are kept.
What came to my mind after sending it is to add this script simply as a file toSRC_URIinstead of echoing it, but didn't want a v3 without someone asking for it.
Quoted 2 lines
[1]:
https://git.yoctoproject.org/poky/tree/meta/classes-recipe/ptest-cargo.bbclass#n102
D'oh! You're right!
Since that is easy to miss, maybe add a comment stating that cargo-ptest will fill the rest of the script?
Also, I'm in favour of the run-ptest in SRC_URI instead of echoing it in do_install.
Thanks!
Quoted 35 lines
Quoted 33 lines
Maybe you can, either:
* rename the run-ptest generated by cargo-ptest and exec'ing it from your script to keep the envvar
* overwrite the run-ptest generated by cargo-ptest (but keep its current content: e.g calling the test binaries in sequence, printing "PASS:" ...)Best regards,
} # Tests need objdump -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#221671): https://lists.openembedded.org/g/openembedded-core/message/221671 Mute This Topic: https://lists.openembedded.org/mt/114612984/4316185 Group Owner: [email protected] <mailto:openembedded-core%[email protected]> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=---
Yoann Congal
Smile ECS