actions / setup-python

Set up your GitHub Actions workflow with a specific version of Python
MIT License
1.59k stars 505 forks source link

Python 3.7/8/9/10 on Darwin runners fails: Library not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib #875

Closed arcivanov closed 1 day ago

arcivanov commented 1 month ago

Description:

Builds that used to work started failing with the below message. The failures are for 3.7-3.10. 3.11 and 3.12 work.

Example is here: https://github.com/karellen/wheel-axle/actions/runs/9215648920/job/25354463928

Run actions/setup-python@v5
  with:
    python-version: 3.7
    architecture: x64
    check-latest: false
    token: ***
    update-environment: true
    allow-prereleases: false
  env:
    GITHUB_TOKEN: ***
    PYB_EXTRA_ARGS: --no-venvs
    SETUPTOOLS_VER: ~=63.0
    PIP_VER: ~=22.3
    PYTHON: python3
Installed versions
  Version 3.7 was not found in the local cache
  Version 3.7 is available for downloading
  Download from "https://github.com/actions/python-versions/releases/download/3.7.17-5356448435/python-3.7.17-darwin-x64.tar.gz"
  Extract downloaded archive
  /usr/bin/tar xz -C /Users/runner/work/_temp/bfcff778-fb76-4756-abaa-879217f6f46c -f /Users/runner/work/_temp/c5cec3db-4ab0-42f3-a186-7e7d5e0d2bc4
  Execute installation script
  Check if Python hostedtoolcache folder exist...
  Create Python 3.7.17 folder
  Copy Python binaries to hostedtoolcache folder
  Create additional symlinks (Required for the UsePythonVersion Azure Pipelines task and the setup-python GitHub Action)
  Upgrading pip...
  Error: dyld[3251]: Library not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib
    Referenced from: <FA1C5C30-D202-30DA-B1C2-8EFF35C22F2B> /Users/runner/hostedtoolcache/Python/3.7.17/x64/bin/python3.7
    Reason: tried: '/usr/local/opt/gettext/lib/libintl.8.dylib' (no such fi
  Error: le), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/gettext/lib/libintl.8.dylib' (no such file), '/usr/local/opt/gettext/lib/libintl.8.dylib' (no such file), '/usr/local/lib/libintl.8.dylib' (no such file), '/usr/lib/libintl.8.dylib' (no such file, not in dyld cache)
  ./setup.sh: line 52:  3251 Abort trap: 6           ./python -m ensurepip
  Error: The process '/bin/bash' failed with exit code 134

Action version: v5

Platform:

Runner type:

Tools version: N/A

Repro steps:
Simply attempt to install Python and observe the failure.

Expected behavior: Successful installation

Actual behavior: Failed installation

aparnajyothi-y commented 1 month ago

Hello @arcivanov, Thank you for creating this issue and we will look into it :)

arcivanov commented 1 month ago

This is really hurting all of the automation as the build gates are failing.

mayeut commented 3 weeks ago

This is a duplicate of #855 Best to stay on macos-13 to test the x64 architecture on macOS (or remove the architecture key if you want to test on arm64 using macos-14/macos-latest).

arcivanov commented 3 weeks ago

I'm fairly sure I'm running x86, let me check

arcivanov commented 3 weeks ago

@mayeut oh wow, you're right, at some point GHA defaulted to running MacOS 14 on arm64 by default. Thank you!

aparnajyothi-y commented 1 day ago

Hello Everyone, The actions/setup-python repository does not support x64 packages for Python <3.11 version on macOS arm64 runners due to compatibility and build issues. The build process for Python versions less than 3.11 involves downloading the official Python sources from python.org and building them using the make tool on the oldest available version of macOS that was available when that Python version was released. This is done to ensure backward compatibility for those Python versions as mentioned in this python-versions documentation. However, this build process can run into compatibility issues on macOS arm64 runners. The arm64 architecture is used in Apple's newer Mac models that use Apple Silicon processors, which are based on a different instruction set than the x86-64 processors used in older models. Therefore, the built Python packages for versions less than 3.11 may trigger the issues like few modules missing on macOS arm64 runners. This is why the actions/setup-python repository does not support x64 packages for <Python 3.11 versions on macOS arm64 runners. For Python versions 3.11 and onwards, the actions/setup-python repository uses the official macOS universal2 Python binaries from python.org, which are compatible with both x86-64 and arm64 architectures. These can be used on macOS arm64 runners without any issues. For Arm64 platform, we use official macOS universal2 Python binaries and provide only versions which are provided by Python org. Hence we are closing this issue as x64 packages for < python 3.11 from source will not be supported by macos arm64 runners. Please feel free to reach us needed to reopen this issue for more clarifications.