polm / fugashi

A Cython MeCab wrapper for fast, pythonic Japanese tokenization and morphological analysis.
MIT License
402 stars 33 forks source link

Add macOS arm64, universal2 wheel build to CI #80

Closed nikitalita closed 1 year ago

nikitalita commented 1 year ago

Fixes #55

This adds building the arm64 and universal2 wheels for macOS to the CI via cross-compiling.

It was a huge bitch to figure out how to get autoconf to cross-compile using clang++, but I eventually figured out the right hacks to get it to work. Basically, we compile for both x86 and arm, and then combine all the objects with lipo, then install them.

This also pins the Cython dependency to 0.23.35. Cython upgraded to 3.0.0 sometime in the past few weeks, and the macOS CI fails when using 3.0.0.

polm commented 1 year ago

Thank you very much for this! Please give me a few days to review it.

polm commented 1 year ago

Sorry it took me a while to get to this - the code looks good! I have copied this branch to the main repo and tagged it as 1.3.0dev0. If the build goes right that should get a PyPI release that can be installed for testing. If we can confirm that works OK then this should be good to merge.

I can't directly confirm whether the wheel works myself due to lack of hardware, I'll ask if someone I know can verify it.

polm commented 1 year ago

Sorry it took me even longer to get to this, but I was able to get someone to test it for me and it seems fine, so I'll do an official release. Thanks again for the PR!