Skip to contentSkip to conversation

rpm-sequoia: upgrade 1.7.0 -> 1.9.0

PATCH New Gyorgy Sarvari 1 participant 1 message Aug 9, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v3 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

---
v3: move run-ptest script content to a file, and add some comments in it

v2: fix run-ptest script file permissions, link: https://lists.openembedded.org/g/openembedded-core/message/221671

v1: https://lists.openembedded.org/g/openembedded-core/message/221665

 ...-lib-for-symbols-tests-conditionally.patch |  41 ++
 .../rpm-sequoia/files/run-ptest               |  15 +
 .../rpm-sequoia/rpm-sequoia-crates.inc        | 522 ++++++++++--------
 ...-sequoia_1.7.0.bb => rpm-sequoia_1.9.0.bb} |   9 +-
 4 files changed, 345 insertions(+), 242 deletions(-)
 create mode 100644 meta/recipes-devtools/rpm-sequoia/files/0001-tests-build-lib-for-symbols-tests-conditionally.patch
 create mode 100644 meta/recipes-devtools/rpm-sequoia/files/run-ptest
 rename meta/recipes-devtools/rpm-sequoia/{rpm-sequoia_1.7.0.bb => rpm-sequoia_1.9.0.bb} (90%)
meta/recipes-devtools/rpm-sequoia/files/0001-tests-build-lib-for-symbols-tests-conditionally.patch new file +41 -0
new file mode 100644
index 0000000000..ddc897b86c
@@ -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/files/run-ptest new file +15 -0
new file mode 100644
index 0000000000..83e59b8031
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# This script doesn't seem to do much, but the recipe uses
+# the ptest-cargo bbclass, which appends its content to
+# the run-ptest script, if it can find an existing one.
+
+# The test that ptest-cargo class generates requires the
+# TEST_DONT_BUILD_LIB environment variable to be set before
+# it would be executed, and this is what this script does.
+# The "rc" variable is used by the script generated by
+# ptest-cargo, and is expected to exist, in case the
+# run-test script exists, and not created by that class.
+
+rc=0
+export TEST_DONT_BUILD_LIB=1
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 +5 -4
similarity index 90%
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
index 46f9ee8548..577acfdc86 100644
@@ -12,11 +12,12 @@ 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 \
+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 \
+           file://run-ptest \
 "
-
-SRCREV = "0667e04ae7fb8cf0490919978d69883d16400e41"
+SRCREV = "cd090b02119565c6d171fa9a892790c966cf10ef"
 
 require ${BPN}-crates.inc