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

add armv7l support to scripts #712

Merged
merged 2 commits into from
May 7, 2022
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
6 changes: 5 additions & 1 deletion script/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ function packageApp() {
targetArch = os.arch()
}

if (targetArch === 'arm64' || targetArch === 'x64') {
if (
targetArch === 'arm64' ||
targetArch === 'x64' ||
targetArch === 'armv7l'
) {
return targetArch
}

Expand Down
8 changes: 6 additions & 2 deletions script/dist-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,22 @@ export function getReleaseSHA() {
return pieces[2]
}

export function getDistArchitecture(): 'arm64' | 'x64' {
export function getDistArchitecture(): 'arm64' | 'x64' | 'armv7l' {
// If a specific npm_config_arch is set, we use that one instead of the OS arch (to support cross compilation)
if (
process.env.npm_config_arch === 'arm64' ||
process.env.npm_config_arch === 'x64'
process.env.npm_config_arch === 'x64' ||
process.env.npm_config_arch === 'armv7l'
) {
return process.env.npm_config_arch
}

if (process.arch === 'arm64') {
return 'arm64'
}
if (process.arch === 'armv7l') {
return 'armv7l'
}

// TODO: Check if it's x64 running on an arm64 Windows with IsWow64Process2
// More info: https://www.rudyhuyn.com/blog/2017/12/13/how-to-detect-that-your-x86-application-runs-on-windows-on-arm/
Expand Down
2 changes: 1 addition & 1 deletion script/package-debian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type DebianOptions = {
// required
src: string
dest: string
arch: 'amd64' | 'i386' | 'arm64'
arch: 'amd64' | 'i386' | 'arm64' | 'armhf'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎨 As a first step for this work I'd happily take the API changes required to enable ARM support. I think the changes below this line will impact CI, but seeing this helps me think about how we could make this smoother (detect the environment and then pass this through to the packaging stages).

If you wanted to open a fresh PR with just those API changes let me know, otherwise I'll see if I can make time over the weekend to do the same...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I force pushed removed those changes. making the other api changes isn't too urgent (since dugite-native still needs changes to its buildscripts as well). but this is a start (and means less patching when I go to build)

// optional
description?: string
productDescription?: string
Expand Down