igrr / astyle_py

Python wrapper and pre-commit hook for Astyle formatter (http://astyle.sourceforge.net/)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could we support astyle on MAC with ARM arch

L-KAYA opened this issue · comments

commented

While running the pre-commit in idf-extra-components, the astyle check failed with following message:

astyle formatter.........................................................Failed
- hook id: astyle_py
- exit code: 1

Traceback (most recent call last):
  File "/Users/laokaiyao/.cache/pre-commit/repo18_z6sl8/py_env-python3.10/bin/astyle_py", line 5, in <module>
    from astyle_py.astyle_wrapper import main
  File "/Users/laokaiyao/.cache/pre-commit/repo18_z6sl8/py_env-python3.10/lib/python3.10/site-packages/astyle_py/astyle_wrapper.py", line 7, in <module>
    from wasmtime import (
  File "/Users/laokaiyao/.cache/pre-commit/repo18_z6sl8/py_env-python3.10/lib/python3.10/site-packages/wasmtime/__init__.py", line 17, in <module>
    from ._config import Config
  File "/Users/laokaiyao/.cache/pre-commit/repo18_z6sl8/py_env-python3.10/lib/python3.10/site-packages/wasmtime/_config.py", line 1, in <module>
    from . import _ffi as ffi
  File "/Users/laokaiyao/.cache/pre-commit/repo18_z6sl8/py_env-python3.10/lib/python3.10/site-packages/wasmtime/_ffi.py", line 25, in <module>
    raise RuntimeError("unsupported architecture for wasmtime: {}".format(machine))
RuntimeError: unsupported architecture for wasmtime: arm64

@L-KAYA sorry I've missed your issue. This tool should work on an arm64 Mac, that's what I'm also using now. I think the issue is that idf-extra-components .pre-commit-config.yml uses an older version of this tool (master branch, which is deprecated)

I'll make a PR to idf-extra-components to update it to the latest release.

@L-KAYA have fixed this in idf-extra-components in espressif/idf-extra-components@9d3971c.

commented

Thanks for the info!

commented

@L-KAYA Maybe you will be interested in https://pypi.org/project/astyle/. It uses native binary programs and doesn't need wasm.