Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building against Python 3.12 is broken #2182

Closed
dogtopus opened this issue Nov 18, 2023 · 6 comments · Fixed by #2185
Closed

Building against Python 3.12 is broken #2182

dogtopus opened this issue Nov 18, 2023 · 6 comments · Fixed by #2185

Comments

@dogtopus
Copy link

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):

  • OS: Fedora 39
  • inside proxmark3 client run the following commands and paste the output here.
  • hw version
  • hw status
  • data tune

Additional context
Add any other context about the problem here.

@strasharo
Copy link
Contributor

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
Copy link
Contributor

wh201906 commented Nov 24, 2023

@dogtopus
Copy link
Author

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

@wh201906
Copy link
Contributor

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
Copy link
Contributor

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

@iceman1001
Copy link
Collaborator

merged the fix.

closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants