SpotlightKid / python-rtmidi

Python bindings for the cross-platform MIDI I/O library RtMidi
https://spotlightkid.github.io/python-rtmidi/
Other
349 stars 64 forks source link

fix macOS binary wheel builds #159

Closed SpotlightKid closed 1 year ago

SpotlightKid commented 1 year ago

The binary wheels marked as for the arm64 architecture for release 1.5.0/1/2 contain dynlibs, which are compiled for x86_64 instead.

We need to fix the Github action workflow building these wheels and fix meson.build.

See also #149.

SpotlightKid commented 1 year ago

I opened this draft PR, so that we have proper place to discuss this and share our findings.

See previous discussion here: https://github.com/SpotlightKid/python-rtmidi/commit/b603f433d46eb3bda73ed1177a7ab7a6ea20f080#r118309787

SpotlightKid commented 1 year ago

So, it seems issue was the wrong syntax for the add_project_arguments call in meson.build.

For the -target compiler option value, it seems either arm64-apple-darwin or arm64-apple-macos works.

brunoenten commented 1 year ago

The right way to do cross compilation with meson is to use "cross build definition" files. That looks unnecessarily complicated, and I couldn't find any example of intel to apple silicon. https://mesonbuild.com/Cross-compilation.html

If the current solution works, let's go with that.

SpotlightKid commented 1 year ago

If the current solution works, let's go with that.

True, but #160 looks promising too. From what I've read, meson-python can create the cross-compilation definition files on the fly. I suspect that the current error in the CI for that PR is probably only due host_machine.system() not identifying the target platform correctly. I'll comment on that more in that PR.

SpotlightKid commented 1 year ago

Closing this in favour of #161.