Skip to content

Tesseracts that use polars can fail to build on newer Macs #623

Description

@dionhaefner

Description

Adding polars to tesseract_requirements.txt can lead to build failures like this on some ARM Macs (reported on M3):

#33 [run_stage 17/18] RUN _TESSERACT_IS_BUILDING=1 /tesseract/entrypoint.sh tesseract-runtime check
#33 0.950 /python-env/lib/python3.11/site-packages/polars/_cpu_check.py:271: RuntimeWarning: Missing required CPU features.
#33 0.950 
#33 0.950 The following required CPU features were not detected:
#33 0.950     avx, avx2, fma, bmi1, bmi2, lzcnt, movbe
#33 0.950 Continuing to use this version of Polars on this processor will likely result in a crash.
#33 0.950 Install `polars[rtcompat]` instead of `polars` to run Polars with better compatibility.
#33 0.950 
#33 0.950 Hint: If you are on an Apple ARM machine (e.g. M1) this is likely due to running Python under Rosetta.
#33 0.950 It is recommended to install a native version of Python that does not run under Rosetta x86-64 emulation.
#33 0.950 
#33 0.950 If you believe this warning to be a false positive, you can set the `POLARS_SKIP_CPU_CHECK` environment variable to bypass this check.
#33 0.950 
#33 0.950   warnings.warn(
#33 0.959 Illegal instruction
#33 ERROR: process "/bin/sh -c _TESSERACT_IS_BUILDING=1 /tesseract/entrypoint.sh tesseract-runtime check" did not complete successfully: exit code: 132

It appears that polars is using instructions in their Linux ARM wheels that aren't available on those processors.

The workaround is to use polars[rtcompat] as a dependency instead.

Steps to reproduce

See above

Logs

See above

OS

Mac

Tesseract version

v1.11.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions