OpenCC icon indicating copy to clipboard operation
OpenCC copied to clipboard

Support building the Python package for Apple M1 (arm64)

Open BYVoid opened this issue 3 years ago • 9 comments

@mingruimingrui

The current 'release-pypi-macos.sh' only builds for x86_64 for Mac.

It would be better if we can have *_arm64.whl, too.

BYVoid avatar Mar 04 '21 06:03 BYVoid

Let me take a look! There's a few things we need...

  • pybind11 compatibility
  • A way to compile for arm with github workflow

Will update when I got the answer

mingruimingrui avatar Mar 19 '21 05:03 mingruimingrui

any updates on this? @mingruimingrui

danielfree avatar Apr 26 '22 01:04 danielfree

我開發了 OpenCC 的下一代簡繁轉換工具:StarCC

https://github.com/StarCC0/starcc-py

ayaka14732 avatar Apr 26 '22 01:04 ayaka14732

I've compiled opencc via my m1 mac, which may help before the work find a way integrate into release pipeline or github workflow. https://github.com/p208p2002/OpenCC/releases/tag/v1.1.4

p208p2002 avatar Sep 21 '22 06:09 p208p2002

@p208p2002 What can I do to fix this issue? Should I publish a new release?

ayaka14732 avatar Sep 22 '22 01:09 ayaka14732

@ayaka14732 I think we should keep this issue open and do nothing, before find a stable way to build and compile macos-arm package via github workflow or other CI-system.

In my understanding github's macos runner currently is not support arm64, but in progress

https://github.com/actions/runner-images/issues/2187 https://github.com/github/roadmap/issues/528

I'm trying self-hosted runner or cross compile (maybe QEMU? i have a little experience on it) which may compatible with current opencc project setting to compile arm64 package via github's x86 machine. maybe i could push a PR after that work :D

p208p2002 avatar Sep 22 '22 03:09 p208p2002

@p208p2002 thank you for providing a build from M1. What's the easiest way to use that build? The following didn't work.

npm install [email protected]:p208p2002/OpenCC.git#v1.1.4

lannka avatar Apr 09 '23 16:04 lannka

@lannka It's a python package, you should download the .whl file then install via pip instead npm

p208p2002 avatar Apr 10 '23 00:04 p208p2002

@p208p2002 thank you for the prompt response. Unfortunately as NPM user I kinda stuck here as I don't have too much python experience. Extra tips are appreciated.

Given that it takes years for GitHub action to provide such a M1 environment, may I suggest a manual push of a M1 binary? So that NPM users can move smoothly from a Intel machine to a M1 machine without interruption.

I understand automating this can be the eventual goal, but given the project hasn't been updated that frequently, a manual release seems worth the effort and can benefit thousands of developers?

Thank you folks again for maintaining such a great project.

lannka avatar Apr 10 '23 18:04 lannka