capstone icon indicating copy to clipboard operation
capstone copied to clipboard

Capstone can't be built on 3.12 due to distutils removal

Open rickmark opened this issue 2 years ago • 8 comments

The python bindings rely on classical distutils, which is removed in 3.12. In order to work on newer versions of python the setup.py file must be migrated to use setuputils instead.

rickmark avatar Dec 21 '23 01:12 rickmark

Should also be patched in 5.0.x series: https://github.com/capstone-engine/capstone/issues/2081

XVilka avatar Dec 21 '23 12:12 XVilka

Call me crazy but I'm looking at current next e3a2b4c4183b4eb5b1ade576aeb3c4e7ccc5f20f and the setup.py file still leverages distutils... you're saying it will be addressed in the 5 series? The messaged implied that it was patched in 5.x

rickmark avatar Dec 23 '23 17:12 rickmark

@rickmark no, I meant the fix should be cherry-picked to the capstone 5.x once it landed in next.

XVilka avatar Dec 24 '23 01:12 XVilka

@rickmark no, I meant the fix should be cherry-picked to the capstone 5.x once it landed in next.

Thank you for the clarity! I've been noodling on how to accomplish this PR anyway, the short answer is there might need to be a specialized capstone_builder.py module that gets integrated into the process to do the make of the libcapstone before. setuptools doesn't have great options for adding build phases/external build systems from my reading.

One element of note, I did submit a PR to use cmake on macOS as it can build libcapstone.dylib FAT (arm64/x86_64). Might it be wise to just use it for all build paths and deprecate / remove classical makefile based builds?

rickmark avatar Dec 26 '23 19:12 rickmark

I'd love it! @kabeor has the last say with this.

Rot127 avatar Dec 28 '23 10:12 Rot127

This is needed for the 6.0.0 release as well. @kabeor

XVilka avatar Jan 21 '24 03:01 XVilka

Yes, it's time to add a new python build system:) Seems there still some works need to do before releasing. I'm welling to check out this once I finished my busy work recently😄

kabeor avatar Jan 21 '24 03:01 kabeor

Definitely needs an update. __init__.py is using distutils.sysconfig which breaks 3.12 installs.

Also, current release v5.0.1 won't work for 3.12.x versions.

Merculous avatar Feb 14 '24 05:02 Merculous