Skip to content

Commit

Permalink
simplify and correct arch detection
Browse files Browse the repository at this point in the history
'x32' is not a valid architecture in all released versions of node.js anymore. v8 dropped support for it in 2018
  • Loading branch information
theofficialgman committed Mar 15, 2023
1 parent 6fd1619 commit 4a1eb5f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
friendlyName: Windows
nodeVersion: 16
arch: x86
npm_config_arch: ia32
- os: ubuntu-22.04
friendlyName: Linux
timeout-minutes: 10
Expand All @@ -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
Expand Down
6 changes: 1 addition & 5 deletions script/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion script/update-embedded-git.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 4a1eb5f

Please sign in to comment.