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 Windows ARM64 + Apple Silicon support #9691

Merged
merged 44 commits into from Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
44f8fbc
Set up CI with Azure Pipelines
dennisameling May 2, 2020
004f760
Add support for Windows ARM
dennisameling May 2, 2020
41fa46c
Update azure-pipelines.yml
dennisameling May 3, 2020
916c3f9
Fix space size for ia32
dennisameling May 3, 2020
50de301
Set variables in pipeline
dennisameling May 3, 2020
c401297
Increase Jest timeout to 100s
dennisameling May 3, 2020
aa3b1b1
Fix nativeTheme errors in tests on Windows 10 1809+ and Server 2019+
dennisameling May 4, 2020
ee0e30e
Set Azure Pipelines timeout to 90 minutes due to slow ARM64 32-bit em…
dennisameling May 4, 2020
06c35b4
Azure Pipelines: add job so that timeoutInMinutes property becomes av…
dennisameling May 4, 2020
3183e39
Revert "Fix nativeTheme errors in tests on Windows 10 1809+ and Serve…
dennisameling May 5, 2020
6910589
Revert setting Jest timeout to 100s
dennisameling May 6, 2020
4cfd03d
Update azure-pipelines.yml
dennisameling May 3, 2020
0f91f08
Increase Jest timeout to 100s
dennisameling May 3, 2020
bb3851c
Fix nativeTheme errors in tests on Windows 10 1809+ and Server 2019+
dennisameling May 4, 2020
2af4f66
Revert "Fix nativeTheme errors in tests on Windows 10 1809+ and Serve…
dennisameling May 5, 2020
9871b1d
Revert setting Jest timeout to 100s
dennisameling May 6, 2020
25b2d9b
Fix minor rebase glitches
dennisameling Sep 30, 2020
c863dab
Fix line endings
dennisameling Sep 30, 2020
a65219e
Add Windows arm64 to CI
dennisameling Sep 30, 2020
c70d60e
Fix mistake in CI config
dennisameling Sep 30, 2020
fb8306d
Another attempt to fix CI config
dennisameling Sep 30, 2020
a36241d
Try to fix CI config
dennisameling Sep 30, 2020
312f20a
Tweak CI config
dennisameling Sep 30, 2020
f703db4
Add friendly name for Windows arm64
dennisameling Sep 30, 2020
ed8f1e8
Default to NodeJS current arch
dennisameling Nov 3, 2020
3172a87
Download Windows arm64 node lib in CI
dennisameling Nov 13, 2020
001426d
Fix linting
dennisameling Nov 13, 2020
60f43aa
Update keytar to 7.1.0
dennisameling Nov 16, 2020
c348cea
Skip tests in CI on arm64
dennisameling Nov 16, 2020
c7f4865
Change the assumption of a x64 host to OS arch
dennisameling Nov 19, 2020
45e8d52
Cleanup & optimizations
dennisameling Nov 19, 2020
cc52125
Fix linting
dennisameling Nov 19, 2020
0060b6c
Bump Keytar to 7.2.0
dennisameling Nov 24, 2020
a452402
Merge remote-tracking branch 'upstream/development' into windows-arm-…
dennisameling Feb 11, 2021
ba6891c
Fix Windows arm64 NodeJS version to 14.15.4
dennisameling Feb 11, 2021
20f7b65
Fix NodeJS version to 14.15.4 to prevent future regressions in the ar…
dennisameling Feb 11, 2021
db66293
Update electron-winstaller to 5.0.0
dennisameling Feb 19, 2021
69882e8
Merge remote-tracking branch 'upstream/development' into windows-arm-…
dennisameling Feb 19, 2021
0840071
Also build macOS arm64
dennisameling Feb 19, 2021
4ab0f99
Fix GH Actions matrix
dennisameling Feb 19, 2021
9c6094b
Fix typo in GH Actions workflow
dennisameling Feb 19, 2021
5e0c672
Fix tests on Windows ARM64
dennisameling Feb 21, 2021
0c3f4c8
Merge branch 'windows-arm-support' of https://github.com/dennisamelin…
dennisameling Feb 21, 2021
cdbbd80
Merge branch 'development' into windows-arm-support
sergiou87 Apr 6, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 21 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -9,19 +9,23 @@ on:

jobs:
build:
name: ${{ matrix.friendlyName }}
name: ${{ matrix.friendlyName }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node: [14.x]
node: [14.15.4]
os: [macos-10.15, windows-2019]
arch: [x64, arm64]
include:
- os: macos-10.15
friendlyName: macOS
- os: windows-2019
friendlyName: Windows
timeout-minutes: 45
env:
# Needed for macOS arm64 until hosted macos-11.0 runners become available
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -44,8 +48,17 @@ jobs:
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-

# This step can be removed as soon as official Windows arm64 builds are published:
# https://github.com/nodejs/build/issues/2450#issuecomment-705853342
- name: Get NodeJS node-gyp lib for Windows arm64
if: ${{ matrix.os == 'windows-2019' && matrix.arch == 'arm64' }}
run: .\script\download-nodejs-win-arm64.ps1 ${{ matrix.node }}

- name: Install and build dependencies
run: yarn
env:
npm_config_arch: ${{ matrix.arch }}
TARGET_ARCH: ${{ matrix.arch }}
- name: Lint
run: yarn lint
- name: Validate changelog
Expand All @@ -62,13 +75,19 @@ jobs:
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
DESKTOPBOT_TOKEN: ${{ secrets.DESKTOPBOT_TOKEN }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
npm_config_arch: ${{ matrix.arch }}
TARGET_ARCH: ${{ matrix.arch }}
- name: Prepare testing environment
if: matrix.arch == 'x64'
run: yarn test:setup
- name: Run unit tests
if: matrix.arch == 'x64'
run: yarn test:unit:cov
- name: Run script tests
if: matrix.arch == 'x64'
run: yarn test:script:cov
- name: Run integration tests
if: matrix.arch == 'x64'
timeout-minutes: 5
run: yarn test:integration
- name: Publish production app
Expand Down
1 change: 0 additions & 1 deletion app/.npmrc
@@ -1,4 +1,3 @@
runtime = electron
disturl = https://atom.io/download/electron
target = 11.1.1
arch = x64
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -127,7 +127,7 @@
"@types/codemirror": "0.0.76",
"@types/deep-equal": "^1.0.1",
"@types/double-ended-queue": "^2.1.0",
"@types/electron-winstaller": "^2.6.0",
"@types/electron-winstaller": "^4.0.0",
"@types/event-kit": "^1.2.28",
"@types/express": "^4.11.0",
"@types/extract-text-webpack-plugin": "^3.0.3",
Expand Down Expand Up @@ -172,6 +172,6 @@
"electron": "^11.1.1",
"electron-builder": "^22.7.0",
"electron-packager": "^15.1.0",
"electron-winstaller": "4.0.2"
"electron-winstaller": "^5.0.0"
}
}
5 changes: 3 additions & 2 deletions script/build.ts
Expand Up @@ -4,6 +4,7 @@
import * as path from 'path'
import * as cp from 'child_process'
import * as fs from 'fs-extra'
import * as os from 'os'
import packager, {
OfficialArch,
OsxNotarizeOptions,
Expand Down Expand Up @@ -141,15 +142,15 @@ function packageApp() {

const toPackageArch = (targetArch: string | undefined): OfficialArch => {
if (targetArch === undefined) {
return 'x64'
targetArch = os.arch()
}

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

throw new Error(
`Building Desktop for architecture '${targetArch}' is not supported`
`Building Desktop for architecture '${targetArch}' is not supported`
)
}

Expand Down
11 changes: 10 additions & 1 deletion script/dist-info.ts
@@ -1,5 +1,6 @@
import * as Path from 'path'
import * as Fs from 'fs'
import * as os from 'os'

import { getProductName, getVersion } from '../app/package-info'
import { getReleaseBranchName } from './build-platforms'
Expand All @@ -16,9 +17,17 @@ export function getDistRoot() {
}

export function getDistPath() {
let arch = os.arch()

if (process.env.npm_config_arch) {
// If a specific npm_config_arch is set, we use that one instead of the OS arch (to support cross compilation)
console.log('npm_config_arch detected: ' + process.env.npm_config_arch)
arch = process.env.npm_config_arch
}

return Path.join(
getDistRoot(),
`${getExecutableName()}-${process.platform}-x64`
`${getExecutableName()}-${process.platform}-${arch}`
)
}

Expand Down
22 changes: 22 additions & 0 deletions script/download-nodejs-win-arm64.ps1
@@ -0,0 +1,22 @@
# This script can be removed as soon as official Windows arm64 builds are published:
# https://github.com/nodejs/build/issues/2450#issuecomment-705853342

$nodeVersion = $args[0]

If ($null -eq $nodeVersion) {
Write-Error "No NodeJS version given as argument to this file. Run it like download-nodejs-win-arm64.ps1 12.10.1"
exit 1
}

$url = "https://unofficial-builds.nodejs.org/download/release/v$nodeVersion/win-arm64/node.lib"
$cacheFolder = "$env:LOCALAPPDATA\node-gyp\Cache\$nodeVersion\arm64"

If (!(Test-Path $cacheFolder)) {
New-Item -ItemType Directory -Force -Path $cacheFolder
}

$output = "$cacheFolder\node.lib"
$start_time = Get-Date

Invoke-WebRequest -Uri $url -OutFile $output
Write-Output "Downloaded arm64 NodeJS lib $nodeVersion in $((Get-Date).Subtract($start_time).Seconds) second(s)"
2 changes: 0 additions & 2 deletions script/test-appveyor.bat

This file was deleted.

18 changes: 10 additions & 8 deletions yarn.lock
Expand Up @@ -743,10 +743,12 @@
resolved "https://registry.yarnpkg.com/@types/double-ended-queue/-/double-ended-queue-2.1.0.tgz#adc862d8d53bdf7d1b23a7d85559815ec1fbb92c"
integrity sha512-pCS41/Odn6GMQyqnt8aPTSTQFGriAryYQwVONKk1QhUEhulxueLPE1kDNqDOuJqiv34VLVWXxF4I1EKz3+ftzQ==

"@types/electron-winstaller@^2.6.0":
version "2.6.0"
resolved "https://registry.yarnpkg.com/@types/electron-winstaller/-/electron-winstaller-2.6.0.tgz#703073ee2109fefe8a958fdadb746dfc0a827918"
integrity sha512-pQke6avqSYtkNunEec7NF2dTDSFsf2e1Ti9VkaJFzI15UfTEOjwz22lKoImja7nXPLu8nINYSaVaPgw0XHJEkA==
"@types/electron-winstaller@^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@types/electron-winstaller/-/electron-winstaller-4.0.0.tgz#7377b2cdaab361956cbf1fc41419abb77172d8eb"
integrity sha512-IpgXedqMlSjBIq7+mpj7pkxxZHramuVnrQTyYZbV4M6eABRCNVkbLfXnD35F2+kW3lKFOW9qTcCDo5aGKn7rnQ==
dependencies:
electron-winstaller "*"

"@types/eslint-visitor-keys@^1.0.0":
version "1.0.0"
Expand Down Expand Up @@ -4128,10 +4130,10 @@ electron-publish@22.7.0:
lazy-val "^1.0.4"
mime "^2.4.5"

electron-winstaller@4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/electron-winstaller/-/electron-winstaller-4.0.2.tgz#e3aa7e95db8232eeb337b28c11ad80b93dcafe6d"
integrity sha512-tYmzIyi+W0CXd9o/jmR0VT+vwJ+nOaE/dQz8f64IlbQ/J9d2lpwsmmOKxx6veAVKeYiJHYQHR1eYsLzznNzd5g==
electron-winstaller@*, electron-winstaller@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/electron-winstaller/-/electron-winstaller-5.0.0.tgz#0db968f34d498b16c69566a40848f562e70e7bcc"
integrity sha512-V+jFda7aVAm0htCG8Q95buPUpmXZW9ujh1HdhSlWY6y4QnJnw4TfrmxTlQWV4p2ioF/71JMI/1YF+/qbSICogA==
dependencies:
asar "^2.0.1"
debug "^4.1.1"
Expand Down