Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify and correct arch detection #529

Merged
merged 1 commit into from
Jul 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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