pyahocorasick icon indicating copy to clipboard operation
pyahocorasick copied to clipboard

Also build +test universal wheels on macOS ARM M1 chips

Open pombredanne opened this issue 2 years ago • 4 comments

Since ARM is Apple's new default, it would make sense to ensure things work on ARM M1 chips

pombredanne avatar Feb 21 '22 05:02 pombredanne

+1... I'm having trouble installing pyahocorasick on my Fusion Ubuntu machine running on Mac M1 ARM sillicon. This is a blocker to installing scancode @pombredanne.

  Running setup.py install for pyahocorasick ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for pyahocorasick did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      running install
      /home/rose/testenv/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_ext
      building 'ahocorasick' extension
      creating build
      creating build/temp.linux-aarch64-3.10
      aarch64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DAHOCORASICK_UNICODE= -I/home/rose/testenv/include -I/usr/include/python3.10 -c pyahocorasick.c -o build/temp.linux-aarch64-3.10/pyahocorasick.o
      error: command 'aarch64-linux-gnu-gcc' failed: No such file or directory
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pyahocorasick

note: This is an issue with the package mentioned above, not pip.

rnjudge avatar Dec 08 '22 18:12 rnjudge

@rnjudge I want to make this work: do you know if there is a free CI where I could run or test a macOS ARM builds? @heliocastro you are suffering too.

What could we do? Is there something to do to help? a Ci using QEMU? or someone sponsoring the expenses to run a macOS ARM CI?

pombredanne avatar Jan 14 '23 16:01 pombredanne

NB: the latest 2.0.0 will have a universal build for macOS..... the wheels may run on your machine. Fingers crossed.

pombredanne avatar Jan 14 '23 16:01 pombredanne

https://pypi.org/project/pyahocorasick/2.0.0/ is out ... @rnjudge @heliocastro do you mind testing this with this: note that this WILL NOT run out of the box on ARM Linux, but it should run natively on macOS ARM. Start with a clean ARM shell (not under rosetta):

mkdir venv 
wget -O venv/virtualenv.pyz https://bootstrap.pypa.io/virtualenv/virtualenv.pyz
python3 venv/virtualenv.pyz --never-download --seeder pip  \
  --pip embed --setuptools embed --wheel embed \
  --no-vcs-ignore --no-periodic-update ./venv
source venv/bin/activate
pip install pyahocorasick==2.0.0 pytest
git clone https://github.com/WojciechMula/pyahocorasick
cd pyahocorasick
pytest -vvs 

Thanks!

pombredanne avatar Jan 14 '23 17:01 pombredanne