Building splitgpg2 for debian fails on Fedora 37

Hello! I’m trying to build Qubes, but make qubes fails when building splitgpg due to failing tests. Here is the relevant output:

-> Building app-linux-split-gpg (rpm_spec/gpg-split.spec) for fc35 vm (logfile: build-logs/app-linux-split-gpg-vm-fc35.log)
--> Done:
      qubes-src/app-linux-split-gpg/pkgs/vm-fc35/x86_64/qubes-gpg-split-2.0.63-1.fc35.x86_64.rpm
      qubes-src/app-linux-split-gpg/pkgs/vm-fc35/x86_64/qubes-gpg-split-debuginfo-2.0.63-1.fc35.x86_64.rpm
      qubes-src/app-linux-split-gpg/pkgs/vm-fc35/x86_64/qubes-gpg-split-debugsource-2.0.63-1.fc35.x86_64.rpm
      qubes-src/app-linux-split-gpg/pkgs/vm-fc35/x86_64/qubes-gpg-split-tests-2.0.63-1.fc35.x86_64.rpm
make[1]: Entering directory '/home/user/qubes-builder'
git -C /home/user/qubes-builder/chroot-dom0-fc32/home/user/qubes-src/app-linux-split-gpg2 clean -f -d -X
/home/user/qubes-builder/scripts/create-archive /home/user/qubes-builder/chroot-dom0-fc32/home/user/qubes-src/app-linux-split-gpg2 split-gpg2-0.1.tar.gz
~/qubes-builder/chroot-dom0-fc32/home/user/qubes-src/app-linux-split-gpg2 ~/qubes-builder
~/qubes-builder
-> Building app-linux-split-gpg2 (rpm_spec/split-gpg2-dom0.spec) for fc32 dom0 (logfile: build-logs/app-linux-split-gpg2-dom0-fc32.log)
--> Done:
      qubes-src/app-linux-split-gpg2/pkgs/dom0-fc32/noarch/split-gpg2-dom0-0.1-1.fc32.noarch.rpm
make[1]: Leaving directory '/home/user/qubes-builder'
# Make sure repo directory exists
-> Building app-linux-split-gpg2 (debian) for bullseye vm (logfile: build-logs/app-linux-split-gpg2-vm-bullseye.log)
--> build failed!

======================================================================
FAIL: test_001_genkey (splitgpg2.test_server.TC_Server) [('ECDSA', 'ECDH', 'NIST P-521', 'NIST P-521')]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/qubes-src/app-linux-split-gpg2/.pybuild/cpython3_3.9_splitgpg2/build/splitgpg2/test_server.py", line 233, in do_test
    fpr, stdout = self.generate_key(ty, subkey_ty, key_param, subkey_param)
  File "/home/user/qubes-src/app-linux-split-gpg2/.pybuild/cpython3_3.9_splitgpg2/build/splitgpg2/test_server.py", line 194, in generate_key
    self.fail('gpg2 --gen-key exit with {}: {}{}'.format(
AssertionError: gpg2 --gen-key exit with 2: [GNUPG:] ERROR key_generate 67109888
[GNUPG:] KEY_NOT_CREATED  sHCS/5635OUmxgOmYQBtEIFtiBPBL35bcNjFXnOrrRA=
gpg: agent_genkey failed: User defined error code 1
gpg: key generation failed: User defined error code 1


======================================================================
FAIL: test_001_genkey (splitgpg2.test_server.TC_Server) [('ECDSA', 'ECDH', 'brainpoolP256r1', 'brainpoolP256r1')]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/qubes-src/app-linux-split-gpg2/.pybuild/cpython3_3.9_splitgpg2/build/splitgpg2/test_server.py", line 233, in do_test
    fpr, stdout = self.generate_key(ty, subkey_ty, key_param, subkey_param)
  File "/home/user/qubes-src/app-linux-split-gpg2/.pybuild/cpython3_3.9_splitgpg2/build/splitgpg2/test_server.py", line 194, in generate_key
    self.fail('gpg2 --gen-key exit with {}: {}{}'.format(
AssertionError: gpg2 --gen-key exit with 2: [GNUPG:] ERROR key_generate 67109888
[GNUPG:] KEY_NOT_CREATED  W8NPK1O/gsHptoC334mhQANqLxAZTcQRxhXLbp1W0hg=
gpg: agent_genkey failed: User defined error code 1
gpg: key generation failed: User defined error code 1


======================================================================
FAIL: test_001_genkey (splitgpg2.test_server.TC_Server) [('ECDSA', 'ECDH', 'brainpoolP384r1', 'brainpoolP384r1')]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/qubes-src/app-linux-split-gpg2/.pybuild/cpython3_3.9_splitgpg2/build/splitgpg2/test_server.py", line 233, in do_test
    fpr, stdout = self.generate_key(ty, subkey_ty, key_param, subkey_param)
  File "/home/user/qubes-src/app-linux-split-gpg2/.pybuild/cpython3_3.9_splitgpg2/build/splitgpg2/test_server.py", line 194, in generate_key
    self.fail('gpg2 --gen-key exit with {}: {}{}'.format(
AssertionError: gpg2 --gen-key exit with 2: [GNUPG:] ERROR key_generate 67109888
[GNUPG:] KEY_NOT_CREATED  qrp/O89+4a5aXVPsDP6733jjexKmbCSVqwBANhPXwBQ=
gpg: agent_genkey failed: User defined error code 1
gpg: key generation failed: User defined error code 1


======================================================================
FAIL: test_001_genkey (splitgpg2.test_server.TC_Server) [('ECDSA', 'ECDH', 'brainpoolP512r1', 'brainpoolP512r1')]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/qubes-src/app-linux-split-gpg2/.pybuild/cpython3_3.9_splitgpg2/build/splitgpg2/test_server.py", line 233, in do_test
    fpr, stdout = self.generate_key(ty, subkey_ty, key_param, subkey_param)
  File "/home/user/qubes-src/app-linux-split-gpg2/.pybuild/cpython3_3.9_splitgpg2/build/splitgpg2/test_server.py", line 194, in generate_key
    self.fail('gpg2 --gen-key exit with {}: {}{}'.format(
AssertionError: gpg2 --gen-key exit with 2: [GNUPG:] ERROR key_generate 67109888
[GNUPG:] KEY_NOT_CREATED  6C3pWdUerIuc693e0tViDd6r2QeKbWV9NPl0RRcYDPo=
gpg: agent_genkey failed: User defined error code 1
gpg: key generation failed: User defined error code 1


======================================================================
FAIL: test_001_genkey (splitgpg2.test_server.TC_Server) [('ECDSA', 'ECDH', 'secp256k1', 'secp256k1')]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/qubes-src/app-linux-split-gpg2/.pybuild/cpython3_3.9_splitgpg2/build/splitgpg2/test_server.py", line 233, in do_test
    fpr, stdout = self.generate_key(ty, subkey_ty, key_param, subkey_param)
  File "/home/user/qubes-src/app-linux-split-gpg2/.pybuild/cpython3_3.9_splitgpg2/build/splitgpg2/test_server.py", line 194, in generate_key
    self.fail('gpg2 --gen-key exit with {}: {}{}'.format(
AssertionError: gpg2 --gen-key exit with 2: [GNUPG:] ERROR key_generate 67109888
[GNUPG:] KEY_NOT_CREATED  jp6nDU2kHtQU36axPxY6vmJrveQpqvK5gYsJH9pe4Zg=
gpg: agent_genkey failed: User defined error code 1
gpg: key generation failed: User defined error code 1


======================================================================
FAIL: test_003_gen_and_list (splitgpg2.test_server.TC_Server)
Test automatic export after keygen
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/qubes-src/app-linux-split-gpg2/.pybuild/cpython3_3.9_splitgpg2/build/splitgpg2/test_server.py", line 321, in test_003_gen_and_list
    self.fail('gpg2 --quick-gen-key exit with {}: {}{}'.format(
AssertionError: gpg2 --quick-gen-key exit with 2: gpg: keybox '/tmp/tmpcmsvwvun/pubring.kbx' created
gpg: agent_genkey failed: User defined error code 1
gpg: key generation failed: User defined error code 1


======================================================================
FAIL: test_011_genkey_passphrase_empty (splitgpg2.test_server.TC_Server)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/qubes-src/app-linux-split-gpg2/.pybuild/cpython3_3.9_splitgpg2/build/splitgpg2/test_server.py", line 527, in test_011_genkey_passphrase_empty
    self.fail('Key generation failed')
AssertionError: Key generation failed

----------------------------------------------------------------------
Ran 18 tests in 8.800s

FAILED (failures=17, skipped=1)
E: pybuild pybuild:353: test: plugin distutils failed with: exit code=1: cd /home/user/qubes-src/app-linux-split-gpg2/.pybuild/cpython3_3.9_splitgpg2/build; python3.9 -m unittest discover -v 
dh_auto_test: error: pybuild --test -i python{version} -p 3.9 returned exit code 13
make: *** [debian/rules:10: build] Error 25
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
make[2]: *** [/home/user/qubes-builder/qubes-src/builder-debian//Makefile-legacy.debian:56: dist-package] Error 2
make[1]: *** [Makefile.generic:197: packages] Error 1
make: *** [Makefile:265: app-linux-split-gpg2-vm] Error 1
[user@localhost-live qubes-builder]$ cat /etc/os-release 
NAME="Fedora Linux"
VERSION="37 (Workstation Edition Prerelease)"
ID=fedora
VERSION_ID=37
VERSION_CODENAME=""
PLATFORM_ID="platform:f37"
PRETTY_NAME="Fedora Linux 37 (Workstation Edition Prerelease)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:37"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f37/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=37
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=37
VARIANT="Workstation Edition"
VARIANT_ID=workstation

What is your build qube?
Works for me on a bullseye build on F36 and bullseye. (works=worked last
week -I’ll check again when I have reply.)

I am not building via a qube, I use a fresh Fedora 37 KVM mashine.

Builds fine in a fedora 37 based qube, as of today.

Can you build with verbose set, and then post the final section of the
build log showing the error.