From 4a1eb5fccb140dd8829d9b1adaedf06c281d8491 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Wed, 15 Mar 2023 15:04:35 -0400 Subject: [PATCH] simplify and correct arch detection 'x32' is not a valid architecture in all released versions of node.js anymore. v8 dropped support for it in 2018 --- .github/workflows/ci.yml | 3 ++- script/config.js | 6 +----- script/update-embedded-git.js | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a497929..8a9625ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,7 @@ jobs: friendlyName: Windows nodeVersion: 16 arch: x86 + npm_config_arch: ia32 - os: ubuntu-22.04 friendlyName: Linux timeout-minutes: 10 @@ -44,7 +45,7 @@ jobs: - name: Install and build dependencies run: yarn env: - npm_config_arch: ${{ matrix.arch }} + npm_config_arch: ${{ matrix.npm_config_arch }} - name: Build run: yarn build - name: Lint diff --git a/script/config.js b/script/config.js index 753fef8c..e9d4aa37 100644 --- a/script/config.js +++ b/script/config.js @@ -14,6 +14,7 @@ function getConfig() { tempFile: '' } + // Possible values are ‘x64’, ‘arm’, ‘arm64’, ‘s390’, ‘s390x’, ‘mipsel’, ‘ia32’, ‘mips’, ‘ppc’ and ‘ppc64’ let arch = os.arch(); if (process.env.npm_config_arch) { @@ -28,11 +29,6 @@ function getConfig() { arch = 'ia32'; } - // Os.arch() calls it x32, we use x86 in actions, dugite-native calls it x86 and our embedded-git.json calls it ia32 - if (arch === 'x32' || arch === 'x86') { - arch = 'ia32' - } - const key = `${process.platform}-${arch}` const entry = embeddedGit[key] diff --git a/script/update-embedded-git.js b/script/update-embedded-git.js index dd0056a3..7c9fde4e 100644 --- a/script/update-embedded-git.js +++ b/script/update-embedded-git.js @@ -14,7 +14,7 @@ get(`https://api.github.com/repos/desktop/dugite-native/releases/latest`).then( 'darwin-x64': await findMacOSx64BitRelease(assets), 'darwin-arm64': await findMacOSARM64BitRelease(assets), 'linux-x64': await findLinux64BitRelease(assets), - 'linux-x86': await findLinux32BitRelease(assets), + 'linux-ia32': await findLinux32BitRelease(assets), 'linux-arm': await findLinuxARM32BitRelease(assets), 'linux-arm64': await findLinuxARM64BitRelease(assets) }