From deb8d8a4e2a03aabcef6f2cc981923fc6b29ef99 Mon Sep 17 00:00:00 2001 From: Firas Cheaib <33319930+firsou@users.noreply.github.com> Date: Thu, 6 Mar 2025 01:40:24 +0100 Subject: [PATCH] fix: use correct libgcc for arm64 (#68) Signed-off-by: Firas Cheaib --- README.md | 2 +- action.yml | 2 +- src/setup-pdm.ts | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5725693..a208125 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ This action supports the following inputs: | -------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | `python-version` | Not specified | Version range or exact version of a Python version to use, using SemVer's version range syntax. | | `python-version-file` | `pyproject.toml` | File containing the Python version to use. Example: .`python-version` | -| `architecture` | `x64` | The target architecture (x86, x64) of the Python interpreter. | +| `architecture` | `x64` | The target architecture (x86, x64, arm64) of the Python interpreter. | | `allow-python-prereleases` | `false` | Allow prerelease versions of Python to be installed. | | `token` | `${{ github.token }}` | Used to pull python distributions from actions/python-versions. Since there's a default, this is typically not supplied by the user. | | `version` | Not specified | The version of PDM to install, or 'head' to install from the main branch. | diff --git a/action.yml b/action.yml index cfef456..c272034 100644 --- a/action.yml +++ b/action.yml @@ -8,7 +8,7 @@ inputs: python-version-file: description: 'File containing the Python version to use. Example: .python-version' architecture: - description: 'The target architecture (x86, x64) of the Python interpreter.' + description: 'The target architecture (x86, x64, arm64) of the Python interpreter.' required: false allow-python-prereleases: description: Allow prerelease versions of Python to be installed. diff --git a/src/setup-pdm.ts b/src/setup-pdm.ts index f833f9c..d1d89fc 100644 --- a/src/setup-pdm.ts +++ b/src/setup-pdm.ts @@ -45,7 +45,12 @@ async function run(): Promise { if (process.platform === 'linux') { // See https://github.com/actions/virtual-environments/issues/2803 - core.exportVariable('LD_PRELOAD', '/lib/x86_64-linux-gnu/libgcc_s.so.1') + if (process.arch === 'x64') { + core.exportVariable('LD_PRELOAD', '/lib/x86_64-linux-gnu/libgcc_s.so.1') + } + else if (process.arch === 'arm64') { + core.exportVariable('LD_PRELOAD', '/lib/aarch64-linux-gnu/libgcc_s.so.1') + } } await exec(IS_WINDOWS ? 'python' : 'python3', cmdArgs, { input: await utils.fetchUrlAsBuffer(INSTALL_SCRIPT_URL) }) const installOutput: InstallOutput = JSON.parse(await utils.readFile('install-output.json'))