RfidResearchGroup / proxmark3

Iceman Fork - Proxmark3
http://www.icedev.se
GNU General Public License v3.0
3.72k stars 998 forks source link

Building against Python 3.12 is broken #2182

Closed dogtopus closed 8 months ago

dogtopus commented 9 months ago

Describe the bug

Python 3.12.0 has a bug (python/cpython#106560) that will cause the compilation of pm3 client to fail.

A workaround would simply be disabling -Werror for redundant-decls.

To Reproduce Steps to reproduce the behavior:

  1. Build proxmark3 client with Python 3.12.0
  2. See it fail with -Werror=redundant-decls

Expected behavior Build under Python 3.12.0 successfully.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

strasharo commented 8 months ago

Also hit it on latest Fedora 39:

[-] CC src/cmdscript.c
In file included from /usr/include/python3.12/Python.h:52,
                 from src/cmdscript.c:24:
/usr/include/python3.12/longobject.h:10:26: error: redundant redeclaration of ‘PyLong_Type’ [-Werror=redundant-decls]
   10 | PyAPI_DATA(PyTypeObject) PyLong_Type;
      |                          ^~~~~~~~~~~
In file included from /usr/include/python3.12/Python.h:44:
/usr/include/python3.12/object.h:226:26: note: previous declaration of ‘PyLong_Type’ with type ‘PyTypeObject’ {aka ‘struct _typeobject’}
  226 | PyAPI_DATA(PyTypeObject) PyLong_Type;
      |                          ^~~~~~~~~~~
In file included from /usr/include/python3.12/Python.h:54:
/usr/include/python3.12/boolobject.h:10:26: error: redundant redeclaration of ‘PyBool_Type’ [-Werror=redundant-decls]
   10 | PyAPI_DATA(PyTypeObject) PyBool_Type;
      |                          ^~~~~~~~~~~
/usr/include/python3.12/object.h:227:26: note: previous declaration of ‘PyBool_Type’ with type ‘PyTypeObject’ {aka ‘struct _typeobject’}
  227 | PyAPI_DATA(PyTypeObject) PyBool_Type;
      |                          ^~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:946: obj/cmdscript.o] Error 1
make: *** [Makefile:177: client/all] Error 2
wh201906 commented 8 months ago

Does the cmake work? https://github.com/RfidResearchGroup/proxmark3/blob/master/doc/md/Development/Makefile-vs-CMake.md

dogtopus commented 8 months ago

@wh201906 Presumably no since it's a Python issue, unless CMake didn't honor -Werror by default for some reason.

wh201906 commented 8 months ago

I don't have Fedora 39 so I did a test roughly and it seems to only affect the make command. Could you please help me to test cmake on Fedora 39 with Python 3.12? As for the Makefile, I've made PR #2185 to fix it.

strasharo commented 8 months ago

@wh201906 I tested using cmake on Fedora 39 and it builds fine. Thanks a lot.

iceman1001 commented 8 months ago

merged the fix.

closing