All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] gpg_sign: avoid unsupported gpg-agent argument passing
@ 2026-12-02 12:53 Adarsh Jagadish Kamini
  2026-12-02 12:53 ` [PATCH v2 1/2] lib/oe/gpg_sign.py: serialize signing instead of passing agent options Adarsh Jagadish Kamini
  2026-12-02 12:53 ` [PATCH v2 2/2] oeqa: selftest: signing: test parallel signing and GPG_SIGN_SERIALIZE Adarsh Jagadish Kamini
  0 siblings, 2 replies; 5+ messages in thread
From: Adarsh Jagadish Kamini @ 2026-12-02 12:53 UTC (permalink / raw)
  To: openembedded-core

Replace the "--agent-program=gpg-agent|--auto-expand-secmem" hack with a
lock around signing, with GPG_SIGN_SERIALIZE = "0" as an opt-out. Neither
GETINFO nor gpgconf reports whether a running agent has
auto-expand-secmem (GnuPG 2.4.4 and 2.5.24), so this can't be decided
per agent.

A launcher was also tested: a script passed with --agent-program that
starts gpg-agent with --auto-expand-secmem. gpg only runs it if no
agent is already running for GPG_PATH.

Signed core-image-minimal --runall=package_write_rpm, 141 tasks,
BB_NUMBER_THREADS = 64, gnupg-native 2.5.24. "Plain" is an agent
started without auto-expand-secmem:

  agent before build        lock  launcher  failed tasks
  plain, already running    no    no        138
  plain, already running    no    yes       137
  plain, already running    yes   no          0
  none                      no    yes         0
  none (auto-expand-secmem  no    no          0
  set in gpg-agent.conf)

No clear slowdown was observed in this build: with auto-expand-secmem
enabled, medians were 929s with the lock and 924s without, over three
runs each. The cost for sstate signing, which also takes the lock, was
not measured. The lock only serializes signing that shares a TMPDIR.

Adarsh Jagadish Kamini (2):
  lib/oe/gpg_sign.py: serialize signing instead of passing agent options
  oeqa: selftest: signing: test parallel signing and GPG_SIGN_SERIALIZE

 meta/classes/sign_ipk.bbclass           |  3 +
 meta/classes/sign_package_feed.bbclass  |  3 +
 meta/classes/sign_rpm.bbclass           |  3 +
 meta/lib/oe/gpg_sign.py                 | 22 +++---
 meta/lib/oeqa/selftest/cases/signing.py | 98 ++++++++++++++++++++++++-
 5 files changed, 117 insertions(+), 12 deletions(-)


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

* [PATCH v2 1/2] lib/oe/gpg_sign.py: serialize signing instead of passing agent options
  2026-12-02 12:53 [PATCH v2 0/2] gpg_sign: avoid unsupported gpg-agent argument passing Adarsh Jagadish Kamini
@ 2026-12-02 12:53 ` Adarsh Jagadish Kamini
  2026-12-02 12:53 ` [PATCH v2 2/2] oeqa: selftest: signing: test parallel signing and GPG_SIGN_SERIALIZE Adarsh Jagadish Kamini
  1 sibling, 0 replies; 5+ messages in thread
From: Adarsh Jagadish Kamini @ 2026-12-02 12:53 UTC (permalink / raw)
  To: openembedded-core

The "--agent-program=gpg-agent|--auto-expand-secmem" syntax is what the
gpg manual calls a regression test suite hack, and it has no effect on
an agent that is already running, in which case parallel signing fails
with "Cannot allocate memory". Instead, take a lock in TMPDIR around
signing, which serializes OE signing operations that share a TMPDIR,
including sstate signing. Set GPG_SIGN_SERIALIZE = "0" to opt out when
the agent runs with auto-expand-secmem.

In a signed core-image-minimal build with an already running agent,
138 of 141 do_package_write_rpm tasks failed without the lock and none
with it, with no clear slowdown observed. The cost for sstate signing
was not measured. Tested with oe-selftest -r signing, not with TMPDIR
on a network file system.

[YOCTO #16480]

AI-Generated: Uses Kiro (claude-opus-5.5)
Signed-off-by: Adarsh Jagadish Kamini <adarsh.jagadish.kamini@est.tech>
---
 meta/classes/sign_ipk.bbclass          |  3 +++
 meta/classes/sign_package_feed.bbclass |  3 +++
 meta/classes/sign_rpm.bbclass          |  3 +++
 meta/lib/oe/gpg_sign.py                | 22 ++++++++++++----------
 4 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/meta/classes/sign_ipk.bbclass b/meta/classes/sign_ipk.bbclass
index de11b9f32f..9782bc66c2 100644
--- a/meta/classes/sign_ipk.bbclass
+++ b/meta/classes/sign_ipk.bbclass
@@ -24,6 +24,9 @@
 #           signing.
 # GPG_PATH
 #           Optional variable for specifying the gnupg "home" directory:
+# GPG_SIGN_SERIALIZE
+#           Optional variable; "1" (default) serializes signing operations
+#           that share a TMPDIR, "0" allows parallel signing.
 #
 
 IPK_SIGN_PACKAGES = '1'
diff --git a/meta/classes/sign_package_feed.bbclass b/meta/classes/sign_package_feed.bbclass
index d33e850dbc..2077b00668 100644
--- a/meta/classes/sign_package_feed.bbclass
+++ b/meta/classes/sign_package_feed.bbclass
@@ -27,6 +27,9 @@
 #           signing.
 # GPG_PATH
 #           Optional variable for specifying the gnupg "home" directory:
+# GPG_SIGN_SERIALIZE
+#           Optional variable; "1" (default) serializes signing operations
+#           that share a TMPDIR, "0" allows parallel signing.
 #
 
 PACKAGE_FEED_SIGN = '1'
diff --git a/meta/classes/sign_rpm.bbclass b/meta/classes/sign_rpm.bbclass
index 62a5e72475..ac124b8096 100644
--- a/meta/classes/sign_rpm.bbclass
+++ b/meta/classes/sign_rpm.bbclass
@@ -30,6 +30,9 @@
 #           invocation
 # GPG_PATH
 #           Optional variable for specifying the gnupg "home" directory:
+# GPG_SIGN_SERIALIZE
+#           Optional variable; "1" (default) serializes signing operations
+#           that share a TMPDIR, "0" allows parallel signing.
 
 RPM_SIGN_PACKAGES = '1'
 RPM_SIGN_FILES ?= '0'
diff --git a/meta/lib/oe/gpg_sign.py b/meta/lib/oe/gpg_sign.py
index ede6186c84..c2debfa968 100644
--- a/meta/lib/oe/gpg_sign.py
+++ b/meta/lib/oe/gpg_sign.py
@@ -18,13 +18,13 @@ class LocalSigner(object):
         self.gpg_bin = d.getVar('GPG_BIN') or \
                   bb.utils.which(os.getenv('PATH'), 'gpg')
         self.gpg_cmd = [self.gpg_bin]
-        self.gpg_agent_bin = bb.utils.which(os.getenv('PATH'), "gpg-agent")
-        # Without this we see "Cannot allocate memory" errors when running processes in parallel
-        # It needs to be set for any gpg command since any agent launched can stick around in memory
-        # and this parameter must be set.
-        if self.gpg_agent_bin:
-            self.gpg_cmd += ["--agent-program=%s|--auto-expand-secmem" % (self.gpg_agent_bin)]
         self.gpg_path = d.getVar('GPG_PATH')
+        # Concurrent signing can exhaust gpg-agent's secure memory unless it
+        # runs with auto-expand-secmem, so by default serialize signing
+        # operations that share a TMPDIR. (AI-generated: Kiro)
+        self.sign_lock = None
+        if bb.utils.to_boolean(d.getVar('GPG_SIGN_SERIALIZE'), True):
+            self.sign_lock = os.path.join(d.getVar('TMPDIR'), 'gpg-sign.lock')
         self.rpm_bin = bb.utils.which(os.getenv('PATH'), "rpmsign")
         self.gpg_version = self.get_gpg_version()
 
@@ -43,7 +43,7 @@ class LocalSigner(object):
         """Sign RPM files"""
 
         cmd = self.rpm_bin + " --addsign --define '_gpg_name %s'  " % keyid
-        gpg_args = '--no-permission-warning --batch --passphrase=%s --agent-program=%s|--auto-expand-secmem' % (passphrase, self.gpg_agent_bin)
+        gpg_args = '--no-permission-warning --batch --passphrase=%s' % passphrase
         if self.gpg_version > (2,1,):
             gpg_args += ' --pinentry-mode=loopback'
         cmd += "--define '_gpg_sign_cmd_extra_args %s' " % gpg_args
@@ -59,7 +59,8 @@ class LocalSigner(object):
 
         # Sign in chunks
         for i in range(0, len(files), sign_chunk):
-            subprocess.check_output(shlex.split(cmd + ' '.join(files[i:i+sign_chunk])), stderr=subprocess.STDOUT)
+            with bb.utils.fileslocked([self.sign_lock]):
+                subprocess.check_output(shlex.split(cmd + ' '.join(files[i:i+sign_chunk])), stderr=subprocess.STDOUT)
 
     def detach_sign(self, input_file, keyid, passphrase_file, passphrase=None, armor=True, output_suffix=None, use_sha256=False):
         """Create a detached signature of a file"""
@@ -96,8 +97,9 @@ class LocalSigner(object):
 
                 cmd += [input_file]
 
-                job = subprocess.Popen(cmd, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
-                (_, stderr) = job.communicate(passphrase.encode("utf-8"))
+                with bb.utils.fileslocked([self.sign_lock]):
+                    job = subprocess.Popen(cmd, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
+                    (_, stderr) = job.communicate(passphrase.encode("utf-8"))
 
                 if job.returncode:
                     bb.fatal("GPG exited with code %d: %s" % (job.returncode, stderr.decode("utf-8")))

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

* [PATCH v2 2/2] oeqa: selftest: signing: test parallel signing and GPG_SIGN_SERIALIZE
  2026-12-02 12:53 [PATCH v2 0/2] gpg_sign: avoid unsupported gpg-agent argument passing Adarsh Jagadish Kamini
  2026-12-02 12:53 ` [PATCH v2 1/2] lib/oe/gpg_sign.py: serialize signing instead of passing agent options Adarsh Jagadish Kamini
@ 2026-12-02 12:53 ` Adarsh Jagadish Kamini
  2026-12-03  6:43   ` [OE-core] " Mathieu Dubois-Briand
  1 sibling, 1 reply; 5+ messages in thread
From: Adarsh Jagadish Kamini @ 2026-12-02 12:53 UTC (permalink / raw)
  To: openembedded-core

The existing tests enable auto-expand-secmem, so they can't catch
gpg-agent running out of secure memory. Sign 64 files in parallel
against an agent started without it; 44 failed before the previous
commit. Also check that signing waits for a held lock by default but
not with GPG_SIGN_SERIALIZE = "0".

[YOCTO #16480]

AI-Generated: Uses Kiro (claude-opus-5.5)
Signed-off-by: Adarsh Jagadish Kamini <adarsh.jagadish.kamini@est.tech>
---
 meta/lib/oeqa/selftest/cases/signing.py | 98 ++++++++++++++++++++++++-
 1 file changed, 96 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/signing.py b/meta/lib/oeqa/selftest/cases/signing.py
index 6269536d1d..6a86d71bfe 100644
--- a/meta/lib/oeqa/selftest/cases/signing.py
+++ b/meta/lib/oeqa/selftest/cases/signing.py
@@ -16,13 +16,32 @@ from contextlib import contextmanager
 from oeqa.utils.ftools import write_file
 
 
+def detach_sign_worker(args):
+    import bb.data
+    import oe.gpg_sign
+
+    gpg_bin, gpg_path, tmpdir, path, serialize = args
+    d = bb.data.init()
+    d.setVar('GPG_BIN', gpg_bin)
+    d.setVar('GPG_PATH', gpg_path)
+    d.setVar('TMPDIR', tmpdir)
+    if serialize is not None:
+        d.setVar('GPG_SIGN_SERIALIZE', serialize)
+    try:
+        signer = oe.gpg_sign.get_signer(d, 'local')
+        signer.detach_sign(path, 'testuser', None, 'test123', armor=False)
+    except Exception as e:
+        return '%s: %s' % (path, repr(e))
+    return None
+
+
 class Signing(OESelftestTestCase):
 
     gpg_dir = ""
     pub_key_path = ""
     secret_key_path = ""
 
-    def setup_gpg(self):
+    def setup_gpg(self, agent_conf="auto-expand-secmem\n"):
         bitbake('gnupg-native -c addto_recipe_sysroot')
 
         self.gpg_dir = tempfile.mkdtemp(prefix="oeqa-signing-")
@@ -34,7 +53,7 @@ class Signing(OESelftestTestCase):
         nsysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "gnupg-native")
 
         with open(os.path.join(self.gpg_dir, "gpg-agent.conf"), "w") as f:
-            f.write("auto-expand-secmem\n")
+            f.write(agent_conf)
 
         runCmd('gpg --batch --homedir %s --import %s %s' % (self.gpg_dir, self.pub_key_path, self.secret_key_path), native_sysroot=nsysroot)
         return nsysroot
@@ -176,6 +195,81 @@ class Signing(OESelftestTestCase):
             # gpg: Good signature from "testuser (nocomment) <testuser@email.com>"
             self.assertIn('gpg: Good signature from', ret.output, 'Package signed incorrectly.')
 
+    def test_signing_parallel_existing_agent(self):
+        """
+        Summary:     Test parallel signing with an already running gpg-agent
+        Expected:    All signatures are created even though the running
+                     gpg-agent was started without auto-expand-secmem
+        Product:     oe-core
+        """
+        import multiprocessing
+
+        # No auto-expand-secmem; disable-scdaemon makes the failure reproducible.
+        # (Test written with AI assistance: Kiro)
+        nsysroot = self.setup_gpg(agent_conf="disable-scdaemon\n")
+        gpg_bindir = os.path.join(nsysroot, 'usr', 'bin')
+        self.add_command_to_tearDown('%s/gpgconf --homedir %s --kill gpg-agent' % (gpg_bindir, self.gpg_dir))
+        ret = runCmd('gpg-connect-agent --homedir %s --no-autostart "GETINFO pid" /bye' % self.gpg_dir, native_sysroot=nsysroot)
+        self.assertRegex(ret.output, r'(?m)^D \d+$', 'No gpg-agent running after key import')
+
+        datadir = tempfile.mkdtemp(prefix="oeqa-signing-data-")
+        self.track_for_cleanup(datadir)
+        files = []
+        for i in range(64):
+            path = os.path.join(datadir, 'file%d' % i)
+            with open(path, 'wb') as f:
+                f.write(os.urandom(4096))
+            files.append(path)
+
+        gpg_bin = os.path.join(gpg_bindir, 'gpg')
+        tmpdir = get_bb_var('TMPDIR')
+        with multiprocessing.get_context('fork').Pool(32) as pool:
+            errors = pool.map(detach_sign_worker, [(gpg_bin, self.gpg_dir, tmpdir, f, None) for f in files])
+        errors = [e for e in errors if e]
+        self.assertEqual(errors, [], '%d of %d parallel signatures failed' % (len(errors), len(files)))
+
+        for f in files:
+            runCmd('gpg --homedir %s --verify %s.sig %s' % (self.gpg_dir, f, f), native_sysroot=nsysroot)
+
+    def test_signing_serialize_option(self):
+        """
+        Summary:     Test that GPG_SIGN_SERIALIZE controls the signing lock
+        Expected:    With "0" signing completes while the lock is held; by
+                     default signing waits until the lock is released
+        Product:     oe-core
+        """
+        import multiprocessing
+
+        nsysroot = self.setup_gpg()
+        gpg_bindir = os.path.join(nsysroot, 'usr', 'bin')
+        self.add_command_to_tearDown('%s/gpgconf --homedir %s --kill gpg-agent' % (gpg_bindir, self.gpg_dir))
+        gpg_bin = os.path.join(gpg_bindir, 'gpg')
+
+        tmpdir = tempfile.mkdtemp(prefix="oeqa-signing-tmpdir-")
+        self.track_for_cleanup(tmpdir)
+        args = {}
+        for serialize in ("0", None):
+            path = os.path.join(tmpdir, 'file-%s' % serialize)
+            with open(path, 'wb') as f:
+                f.write(os.urandom(4096))
+            args[serialize] = ((gpg_bin, self.gpg_dir, tmpdir, path, serialize),)
+
+        # Fork the workers before taking the lock so they don't inherit it
+        with multiprocessing.get_context('fork').Pool(2) as pool:
+            lock = bb.utils.lockfile(os.path.join(tmpdir, 'gpg-sign.lock'))
+            try:
+                optout = pool.apply_async(detach_sign_worker, args["0"])
+                optout.wait(timeout=60)
+                self.assertTrue(optout.ready(), 'Signing with GPG_SIGN_SERIALIZE = "0" waited for the lock')
+                self.assertIsNone(optout.get(), 'Signing with GPG_SIGN_SERIALIZE = "0" failed')
+                default = pool.apply_async(detach_sign_worker, args[None])
+                default.wait(timeout=10)
+                self.assertFalse(default.ready(), 'Default signing did not wait for the lock')
+            finally:
+                bb.utils.unlockfile(lock)
+            default.wait(timeout=60)
+            self.assertTrue(default.ready(), 'Default signing did not finish after the lock was released')
+            self.assertIsNone(default.get(), 'Default signing failed after the lock was released')
 
 class LockedSignatures(OESelftestTestCase):
 

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

* Re: [OE-core] [PATCH v2 2/2] oeqa: selftest: signing: test parallel signing and GPG_SIGN_SERIALIZE
  2026-12-02 12:53 ` [PATCH v2 2/2] oeqa: selftest: signing: test parallel signing and GPG_SIGN_SERIALIZE Adarsh Jagadish Kamini
@ 2026-12-03  6:43   ` Mathieu Dubois-Briand
  2026-12-03 13:48     ` Adarsh Jagadish Kamini
  0 siblings, 1 reply; 5+ messages in thread
From: Mathieu Dubois-Briand @ 2026-12-03  6:43 UTC (permalink / raw)
  To: Adarsh Jagadish Kamini, openembedded-core

On Wed Dec 2, 2026 at 1:53 PM CET, Adarsh Jagadish Kamini wrote:
> The existing tests enable auto-expand-secmem, so they can't catch
> gpg-agent running out of secure memory. Sign 64 files in parallel
> against an agent started without it; 44 failed before the previous
> commit. Also check that signing waits for a held lock by default but
> not with GPG_SIGN_SERIALIZE = "0".
>
> [YOCTO #16480]
>
> AI-Generated: Uses Kiro (claude-opus-5.5)
> Signed-off-by: Adarsh Jagadish Kamini <adarsh.jagadish.kamini@est.tech>
> ---

Hi,

Thanks for the new version. It looks like the two added selftests are
failing here:

2026-12-02 18:26:38,236 - oe-selftest - INFO - signing.Signing.test_signing_parallel_existing_agent (subunit.RemotedTestCase)
2026-12-02 18:26:38,250 - oe-selftest - INFO -  ... FAIL

Stderr:
NOTE: Reconnecting to bitbake server...
2026-12-02 18:26:38,230 - oe-selftest - WARNING - tearDown commands have failed: /srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1788684/tmp/work/x86_64-linux/gnupg-native/2.5.24/recipe-sysroot-native/usr/bin/usr/bin/gpgconf --homedir /tmp/oeqa-signing-jmobdi9i --kill gpg-agent
/usr/lib64/python3.12/unittest/case.py:580: RuntimeWarning: TestResult has no addDuration method
  warnings.warn("TestResult has no addDuration method",

2026-12-02 18:26:38,250 - oe-selftest - INFO - 5: 43/46 543/842 (9.53s) (1 failed) (signing.Signing.test_signing_parallel_existing_agent)
2026-12-02 18:26:38,251 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/layers/openembedded-core/meta/lib/oeqa/selftest/cases/signing.py", line 214, in test_signing_parallel_existing_agent
    self.assertRegex(ret.output, r'(?m)^D \d+$', 'No gpg-agent running after key import')
  File "/usr/lib64/python3.12/unittest/case.py", line 1347, in assertRegex
    raise self.failureException(msg)
AssertionError: Regex didn't match: '(?m)^D \\d+$' not found in 'gpg-connect-agent: no gpg-agent running in this session' : No gpg-agent running after key import

2026-12-02 18:26:49,390 - oe-selftest - INFO - signing.Signing.test_signing_serialize_option (subunit.RemotedTestCase)
2026-12-02 18:26:49,392 - oe-selftest - INFO -  ... FAIL

Stderr:
NOTE: Reconnecting to bitbake server...
2026-12-02 18:26:49,382 - oe-selftest - WARNING - tearDown commands have failed: /srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1788684/tmp/work/x86_64-linux/gnupg-native/2.5.24/recipe-sysroot-native/usr/bin/usr/bin/gpgconf --homedir /tmp/oeqa-signing-r5u6wlgn --kill gpg-agent
/usr/lib64/python3.12/unittest/case.py:580: RuntimeWarning: TestResult has no addDuration method
  warnings.warn("TestResult has no addDuration method",

2026-12-02 18:26:49,392 - oe-selftest - INFO - 5: 44/46 546/842 (11.16s) (2 failed) (signing.Signing.test_signing_serialize_option)
2026-12-02 18:26:49,392 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/layers/openembedded-core/meta/lib/oeqa/selftest/cases/signing.py", line 265, in test_signing_serialize_option
    self.assertIsNone(optout.get(), 'Signing with GPG_SIGN_SERIALIZE = "0" failed')
  File "/usr/lib64/python3.12/unittest/case.py", line 1281, in assertIsNone
    self.fail(self._formatMessage(msg, standardMsg))
  File "/usr/lib64/python3.12/unittest/case.py", line 715, in fail
    raise self.failureException(msg)
AssertionError: "/tmp/oeqa-signing-tmpdir-lkw6gwnx/file-0: FileNotFoundError(2, 'No such file or directory')" is not None : Signing with GPG_SIGN_SERIALIZE = "0" failed

https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/5201
https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/5397
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/5419

Can you have a look at the issue?

Thanks,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


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

* Re: [OE-core] [PATCH v2 2/2] oeqa: selftest: signing: test parallel signing and GPG_SIGN_SERIALIZE
  2026-12-03  6:43   ` [OE-core] " Mathieu Dubois-Briand
@ 2026-12-03 13:48     ` Adarsh Jagadish Kamini
  0 siblings, 0 replies; 5+ messages in thread
From: Adarsh Jagadish Kamini @ 2026-12-03 13:48 UTC (permalink / raw)
  To: Mathieu Dubois-Briand, openembedded-core@lists.openembedded.org

Hi,
I can have a look.

Thanks!

________________________________________
From: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Sent: Thursday, December 3, 2026 07:43
To: Adarsh Jagadish Kamini; openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2 2/2] oeqa: selftest: signing: test parallel signing and GPG_SIGN_SERIALIZE

On Wed Dec 2, 2026 at 1:53 PM CET, Adarsh Jagadish Kamini wrote:
> The existing tests enable auto-expand-secmem, so they can't catch
> gpg-agent running out of secure memory. Sign 64 files in parallel
> against an agent started without it; 44 failed before the previous
> commit. Also check that signing waits for a held lock by default but
> not with GPG_SIGN_SERIALIZE = "0".
>
> [YOCTO #16480]
>
> AI-Generated: Uses Kiro (claude-opus-5.5)
> Signed-off-by: Adarsh Jagadish Kamini <adarsh.jagadish.kamini@est.tech>
> ---

Hi,

Thanks for the new version. It looks like the two added selftests are
failing here:

2026-12-02 18:26:38,236 - oe-selftest - INFO - signing.Signing.test_signing_parallel_existing_agent (subunit.RemotedTestCase)
2026-12-02 18:26:38,250 - oe-selftest - INFO -  ... FAIL

Stderr:
NOTE: Reconnecting to bitbake server...
2026-12-02 18:26:38,230 - oe-selftest - WARNING - tearDown commands have failed: /srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1788684/tmp/work/x86_64-linux/gnupg-native/2.5.24/recipe-sysroot-native/usr/bin/usr/bin/gpgconf --homedir /tmp/oeqa-signing-jmobdi9i --kill gpg-agent
/usr/lib64/python3.12/unittest/case.py:580: RuntimeWarning: TestResult has no addDuration method
  warnings.warn("TestResult has no addDuration method",

2026-12-02 18:26:38,250 - oe-selftest - INFO - 5: 43/46 543/842 (9.53s) (1 failed) (signing.Signing.test_signing_parallel_existing_agent)
2026-12-02 18:26:38,251 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/layers/openembedded-core/meta/lib/oeqa/selftest/cases/signing.py", line 214, in test_signing_parallel_existing_agent
    self.assertRegex(ret.output, r'(?m)^D \d+$', 'No gpg-agent running after key import')
  File "/usr/lib64/python3.12/unittest/case.py", line 1347, in assertRegex
    raise self.failureException(msg)
AssertionError: Regex didn't match: '(?m)^D \\d+$' not found in 'gpg-connect-agent: no gpg-agent running in this session' : No gpg-agent running after key import

2026-12-02 18:26:49,390 - oe-selftest - INFO - signing.Signing.test_signing_serialize_option (subunit.RemotedTestCase)
2026-12-02 18:26:49,392 - oe-selftest - INFO -  ... FAIL

Stderr:
NOTE: Reconnecting to bitbake server...
2026-12-02 18:26:49,382 - oe-selftest - WARNING - tearDown commands have failed: /srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1788684/tmp/work/x86_64-linux/gnupg-native/2.5.24/recipe-sysroot-native/usr/bin/usr/bin/gpgconf --homedir /tmp/oeqa-signing-r5u6wlgn --kill gpg-agent
/usr/lib64/python3.12/unittest/case.py:580: RuntimeWarning: TestResult has no addDuration method
  warnings.warn("TestResult has no addDuration method",

2026-12-02 18:26:49,392 - oe-selftest - INFO - 5: 44/46 546/842 (11.16s) (2 failed) (signing.Signing.test_signing_serialize_option)
2026-12-02 18:26:49,392 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/layers/openembedded-core/meta/lib/oeqa/selftest/cases/signing.py", line 265, in test_signing_serialize_option
    self.assertIsNone(optout.get(), 'Signing with GPG_SIGN_SERIALIZE = "0" failed')
  File "/usr/lib64/python3.12/unittest/case.py", line 1281, in assertIsNone
    self.fail(self._formatMessage(msg, standardMsg))
  File "/usr/lib64/python3.12/unittest/case.py", line 715, in fail
    raise self.failureException(msg)
AssertionError: "/tmp/oeqa-signing-tmpdir-lkw6gwnx/file-0: FileNotFoundError(2, 'No such file or directory')" is not None : Signing with GPG_SIGN_SERIALIZE = "0" failed

https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/5201
https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/5397
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/5419

Can you have a look at the issue?

Thanks,
Mathieu

--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


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

end of thread, other threads:[~2026-12-03 13:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 12:53 [PATCH v2 0/2] gpg_sign: avoid unsupported gpg-agent argument passing Adarsh Jagadish Kamini
2026-12-02 12:53 ` [PATCH v2 1/2] lib/oe/gpg_sign.py: serialize signing instead of passing agent options Adarsh Jagadish Kamini
2026-12-02 12:53 ` [PATCH v2 2/2] oeqa: selftest: signing: test parallel signing and GPG_SIGN_SERIALIZE Adarsh Jagadish Kamini
2026-12-03  6:43   ` [OE-core] " Mathieu Dubois-Briand
2026-12-03 13:48     ` Adarsh Jagadish Kamini

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.