Bug 2416980 - ldns fails to build with Python 3.15: error: conflicting types for '__assert_single_arg'; have 'signed char(signed char)'
Summary: ldns fails to build with Python 3.15: error: conflicting types for '__assert_...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ldns
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Menšík
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.15 2418609
TreeView+ depends on / blocked
 
Reported: 2025-11-25 10:14 UTC by Karolina Surma
Modified: 2025-12-05 11:10 UTC (History)
9 users (show)

Fixed In Version: ldns-1.9.0-1.fc44
Clone Of:
Environment:
Last Closed: 2025-12-05 11:10:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources ldns pull-request 7 0 None None None 2025-12-04 16:46:24 UTC
Github NLnetLabs ldns pull 288 0 None open Skip definition of bool on -std=c23 or newer 2025-12-04 16:09:17 UTC

Description Karolina Surma 2025-11-25 10:14:06 UTC
ldns fails to build with Python 3.15.0a2.

In file included from ./ldns/buffer.h:16,
                 from ./include/ldns/ldns.h:96,
                 from ./contrib/python/ldns_wrapper.c:3547:
/usr/include/assert.h:109:14: error: conflicting types for '__assert_single_arg'; have 'signed char(signed char)'
  109 | extern _Bool __assert_single_arg (_Bool);
      |              ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.15/Python.h:20,
                 from ./contrib/python/ldns_wrapper.c:203:
/usr/include/assert.h:109:14: note: previous declaration of '__assert_single_arg' with type '_Bool(_Bool)'
  109 | extern _Bool __assert_single_arg (_Bool);
      |              ^~~~~~~~~~~~~~~~~~~
make: *** [Makefile:329: ldns_wrapper.lo] Error 1

https://docs.python.org/3.15/whatsnew/3.15.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.15/fedora-rawhide-x86_64/09824725-ldns/

For all our attempts to build ldns with Python 3.15, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/package/ldns/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.15:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/

Let us know here if you have any questions.

Python 3.15 is planned to be included in Fedora 45.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.15.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Fedor Vorobev 2025-12-04 15:41:57 UTC
This bug also blocks builds of dnscap.

After a bit of digging I found out that in Fedora Rawhide gcc uses the C23 standard,
which defines bool as a keyword and deprecates _Bool.

/usr/include/ldns/common.h doesn't find any previous boolean definition and ends up
defining its own _Bool to signed char, which clashes with the __assert_single_arg that
was previously defined with the proper _Bool type of C23. Compiling with an earlier C
standard seems to work fine.

Adding the following lines before the bool define check in ldns/common.h seems to resolve
this issue in C23, however, I'm unsure if it's the right solution.

#if (__STDC_VERSION__ >= 202300L)
# define __bool_true_false_are_defined 1
#endif

@pemensik

Comment 2 Petr Menšík 2025-12-04 16:09:17 UTC
Yes, something like this is needed. I added check also for __STDC_VERSION__ definition, because c++ compiler does not define it.

Comment 3 Fedora Update System 2025-12-05 10:20:38 UTC
FEDORA-2025-f74598b7d1 (ldns-1.9.0-1.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-f74598b7d1

Comment 4 Fedora Update System 2025-12-05 11:10:14 UTC
FEDORA-2025-f74598b7d1 (ldns-1.9.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.