Bug 15513 - Samba doesn't build with Python 3.12
Summary: Samba doesn't build with Python 3.12
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-08 08:58 UTC by Andreas Schneider
Modified: 2024-01-29 16:39 UTC (History)
2 users (show)

See Also:


Attachments
patch for 4.19 (67.64 KB, patch)
2023-11-21 07:44 UTC, Andreas Schneider
gd: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schneider 2023-11-08 08:58:04 UTC
Example:

In file included from /usr/include/python3.12/Python.h:44,
                 from ../../source4/param/provision.c:21:
/usr/include/python3.12/object.h: In function ‘Py_SIZE’:
/usr/include/python3.12/object.h:233:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
  233 |     PyVarObject *var_ob = _PyVarObject_CAST(ob);
      |     ^~~~~~~~~~~


Will open MR soon.
Comment 1 Ralph Böhme 2023-11-08 13:37:37 UTC
As this seems to be a Python bug, is there a Python PR for this?
Comment 2 Jo Sutton 2023-11-08 21:13:14 UTC
(In reply to Ralph Böhme from comment #1)
According to a CPython developer, C99 is required to build or include Python headers: https://github.com/python/cpython/issues/73401#issuecomment-1093736945

I suppose giving up “-Werror=declaration-after-statement” altogether is out of the question?
Comment 3 Volker Lendecke 2023-11-09 07:10:17 UTC
(In reply to Joseph Sutton from comment #2)
> I suppose giving up “-Werror=declaration-after-statement” altogether is out
> of the question?

If that gets us along with latest python, we should drop that. Maybe it's time to conclude the last millenium C-feature-wise...
Comment 4 Andreas Schneider 2023-11-09 07:16:52 UTC
I've added a -Wno-error=declaration-after-statement to all the python C files we build. We can also just drop it.
Comment 5 Samba QA Contact 2023-11-20 16:39:06 UTC
This bug was referenced in samba master:

f337fd995024283f6e1b3f8ec1cc2b3aeb55a2a6
9621a3d7a6949aa833425884cd22379387738cfa
c290052fd28bbfa5b885119f322cb0718073e507
362b0d69b16c5bbcd0ff7dd7ba12e1ac037a6b3d
938afb8b28973b0065cc3509b70ebe3f6986de47
Comment 6 Andreas Schneider 2023-11-21 07:44:44 UTC
Created attachment 18191 [details]
patch for 4.19
Comment 7 Guenther Deschner 2023-11-21 09:49:29 UTC
Comment on attachment 18191 [details]
patch for 4.19

LGTM, RB+ and thanks!
Comment 8 Guenther Deschner 2023-11-21 09:50:07 UTC
Jule, please add to v4.19, thanks!
Comment 9 Jule Anger 2023-11-21 10:18:54 UTC
Pushed to autobuild-v4-19-test.
Comment 10 Samba QA Contact 2023-11-21 11:16:05 UTC
This bug was referenced in samba v4-19-test:

2feaa755e25a980cd00ee24612917d9f6f96f3bc
ec5885982af6ad9d2b7330f199ddc29ed1678554
ec4893eea9cd7ee1490487b11789b1987eaf7534
2f5a1ac1c964ca509aa531ad3fefa151a8666ce2
b6c13c49153a4de962f14fd03537eb8afe9c8961
Comment 11 Jule Anger 2023-11-21 11:28:57 UTC
Closing out bug report.

Thanks!
Comment 12 Samba QA Contact 2023-11-27 12:12:52 UTC
This bug was referenced in samba v4-19-stable (Release samba-4.19.3):

2feaa755e25a980cd00ee24612917d9f6f96f3bc
ec5885982af6ad9d2b7330f199ddc29ed1678554
ec4893eea9cd7ee1490487b11789b1987eaf7534
2f5a1ac1c964ca509aa531ad3fefa151a8666ce2
b6c13c49153a4de962f14fd03537eb8afe9c8961
Comment 13 Samba QA Contact 2024-01-29 15:44:03 UTC
This bug was referenced in samba master:

f28966c1638806a5af1fa4e451b668af638491ce
5032ab712c6e9d6562cd10b1d840d2ee052d1d16
0ba05d5bbb1788b0b8cee26748bcda0c90c48baa
ec91204387bd7f5c5a8d8df8534c6ca59b491ac5
Comment 14 Samba QA Contact 2024-01-29 16:33:53 UTC
This bug was referenced in samba v4-20-test:

f28966c1638806a5af1fa4e451b668af638491ce
5032ab712c6e9d6562cd10b1d840d2ee052d1d16
0ba05d5bbb1788b0b8cee26748bcda0c90c48baa
ec91204387bd7f5c5a8d8df8534c6ca59b491ac5
Comment 15 Samba QA Contact 2024-01-29 16:39:48 UTC
This bug was referenced in samba v4-20-stable (Release samba-4.20.0rc1):

f28966c1638806a5af1fa4e451b668af638491ce
5032ab712c6e9d6562cd10b1d840d2ee052d1d16
0ba05d5bbb1788b0b8cee26748bcda0c90c48baa
ec91204387bd7f5c5a8d8df8534c6ca59b491ac5