From 4bc7b3b1a4bedb3780a4a722d90626ab5f0ed1f4 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Wed, 21 Aug 2019 17:37:30 -0400 Subject: [PATCH] build: start building Windows on Arm builds (#19780) * build: add zip manifest for Windows on Arm * ci: add Windows On Arm testing (cherry picked from commit 4064e1f4874ff7a37c52c2ad974f92418c7e71c4) * Fix path to invoke CI on WOA hardware * Explicitly call 7z.exe to unzip files * Make sure GCLIENT_EXTRA_ARGS set for WOA builds get prepended on release build * set proper arch for npm * Try using Compress-Archive/Expand-Archive * Revert "Try using Compress-Archive/Expand-Archive" * disable woa hardware test for now --- appveyor.yml | 11 ++- azure-pipelines-woa.yml | 84 +++++++++++++++++++ script/release/ci-release-build.js | 17 ++-- .../zip_manifests/dist_zip.win.arm64.manifest | 70 ++++++++++++++++ 4 files changed, 174 insertions(+), 8 deletions(-) create mode 100644 azure-pipelines-woa.yml create mode 100755 script/zip_manifests/dist_zip.win.arm64.manifest diff --git a/appveyor.yml b/appveyor.yml index a0821045cd2c..5478accc94c8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -60,7 +60,7 @@ build_script: - ps: $env:SCCACHE_PATH="$pwd\src\electron\external_binaries\sccache.exe" - ps: >- if ($env:GN_CONFIG -eq 'release') { - $env:GCLIENT_EXTRA_ARGS="--custom-var=checkout_boto=True --custom-var=checkout_requests=True" + $env:GCLIENT_EXTRA_ARGS="$env:GCLIENT_EXTRA_ARGS --custom-var=checkout_boto=True --custom-var=checkout_requests=True" } else { $env:NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es] " } @@ -89,6 +89,10 @@ build_script: - appveyor PushArtifact out/Default/dist.zip - appveyor PushArtifact out/Default/chromedriver.zip - appveyor PushArtifact out/ffmpeg/ffmpeg.zip + - 7z a node_headers.zip out\Default\gen\node_headers + - appveyor PushArtifact node_headers.zip + - appveyor PushArtifact out/Default/mksnapshot.zip + - appveyor PushArtifact out/Default/electron.lib - ps: >- if ($env:GN_CONFIG -eq 'release') { # Needed for msdia140.dll on 64-bit windows @@ -105,7 +109,7 @@ test_script: # Workaround for https://github.com/appveyor/ci/issues/2420 - set "PATH=%PATH%;C:\Program Files\Git\mingw64\libexec\git-core" - ps: >- - if ((-Not (Test-Path Env:\ELECTRON_RELEASE)) -And ($env:GN_CONFIG -in "testing", "release")) { + if ((-Not (Test-Path Env:\TEST_WOA)) -And (-Not (Test-Path Env:\ELECTRON_RELEASE)) -And ($env:GN_CONFIG -in "testing", "release")) { $env:RUN_TESTS="true" } - ps: >- @@ -133,4 +137,7 @@ deploy_script: Write-Output "Uploading Electron release distribution to github releases" & python script\release\uploaders\upload.py } + } elseif (Test-Path Env:\TEST_WOA) { + # node script/release/ci-release-build.js --job=electron-woa-testing --ci=VSTS --armTest --appveyorJobId=$env:APPVEYOR_JOB_ID $env:APPVEYOR_REPO_BRANCH + echo "Eventually run tests on WOA hardware at this step" } diff --git a/azure-pipelines-woa.yml b/azure-pipelines-woa.yml new file mode 100644 index 000000000000..cea7993fe30c --- /dev/null +++ b/azure-pipelines-woa.yml @@ -0,0 +1,84 @@ +steps: +- task: CopyFiles@2 + displayName: 'Copy Files to: src\electron' + inputs: + TargetFolder: src\electron + +- script: | + cd src\electron + npm install --verbose + displayName: 'NPM install' + +- powershell: | + $localArtifactPath = "$pwd\dist.zip" + $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/dist.zip" + Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" } + & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -osrc\out\Default -y $localArtifactPath + displayName: 'Download and extract dist.zip for test' + env: + APPVEYOR_TOKEN: $(APPVEYOR_TOKEN) + +- powershell: | + $localArtifactPath = "$pwd\ffmpeg.zip" + $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/ffmpeg.zip" + Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" } + & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -osrc\out\ffmpeg $localArtifactPath + displayName: 'Download and extract ffmpeg.zip for test' + env: + APPVEYOR_TOKEN: $(APPVEYOR_TOKEN) + +- powershell: | + $localArtifactPath = "$pwd\src\out\Default\mksnapshot.zip" + $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/mksnapshot.zip" + Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" } + cd src\out\Default + & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y mksnapshot.zip + displayName: 'Download and unzip mksnapshot.zip for test' + env: + APPVEYOR_TOKEN: $(APPVEYOR_TOKEN) + +- powershell: | + $localArtifactPath = "$pwd\src\node_headers.zip" + $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/node_headers.zip" + Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" } + cd src + & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y node_headers.zip + displayName: 'Download node headers for test' + env: + APPVEYOR_TOKEN: $(APPVEYOR_TOKEN) + +- powershell: | + $localArtifactPath = "$pwd\src\out\Default\electron.lib" + $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/electron.lib" + Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" } + displayName: 'Download electron.lib for test' + env: + APPVEYOR_TOKEN: $(APPVEYOR_TOKEN) + +- powershell: | + New-Item src\out\Default\gen\node_headers\Release -Type directory + Copy-Item -path src\out\Default\electron.lib -destination src\out\Default\gen\node_headers\Release\node.lib + displayName: 'Setup node headers' + +- script: | + cd src + set npm_config_nodedir=%cd%\out\Default\gen\node_headers + set npm_config_arch=arm64 + cd electron + node script/yarn test -- --ci --enable-logging --verbose + displayName: 'Run Electron tests' + env: + ELECTRON_OUT_DIR: Default + IGNORE_YARN_INSTALL_ERROR: 1 + +- script: | + cd src + echo "Verifying non proprietary ffmpeg" + python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg + displayName: 'Verify ffmpeg' + +- script: | + cd src + echo "Verifying mksnapshot" + python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd% + displayName: 'Verify mksnapshot' diff --git a/script/release/ci-release-build.js b/script/release/ci-release-build.js index c156358c0977..74e7f968f145 100644 --- a/script/release/ci-release-build.js +++ b/script/release/ci-release-build.js @@ -21,7 +21,8 @@ const circleCIJobs = [ const vstsArmJobs = [ 'electron-arm-testing', - 'electron-arm64-testing' + 'electron-arm64-testing', + 'electron-woa-testing' ] async function makeRequest (requestOptions, parseResponse) { @@ -38,12 +39,12 @@ async function makeRequest (requestOptions, parseResponse) { console.error('Error occurred while requesting:', requestOptions.url) if (parseResponse) { try { - console.log('Error: ', `(status ${res.statusCode})`, err || JSON.parse(res.body), requestOptions) + console.log('Error: ', `(status ${res.statusCode})`, err || JSON.parse(res.body)) } catch (err) { - console.log('Error: ', `(status ${res.statusCode})`, err || res.body, requestOptions) + console.log('Error: ', `(status ${res.statusCode})`, res.body) } } else { - console.log('Error: ', `(status ${res.statusCode})`, err || res.body, requestOptions) + console.log('Error: ', `(status ${res.statusCode})`, err || res.body) } reject(err) } @@ -141,7 +142,11 @@ async function buildVSTS (targetBranch, options) { } if (options.armTest) { - environmentVariables.CIRCLE_BUILD_NUM = options.circleBuildNum + if (options.circleBuildNum) { + environmentVariables.CIRCLE_BUILD_NUM = options.circleBuildNum + } else if (options.appveyorJobId) { + environmentVariables.APPVEYOR_JOB_ID = options.appveyorJobId + } } else { if (!options.ghRelease) { environmentVariables.UPLOAD_TO_S3 = 1 @@ -229,7 +234,7 @@ if (require.main === module) { if (args._.length < 1) { console.log(`Trigger CI to build release builds of electron. Usage: ci-release-build.js [--job=CI_JOB_NAME] [--ci=CircleCI|AppVeyor|VSTS] - [--ghRelease] [--armTest] [--circleBuildNum=xxx] TARGET_BRANCH + [--ghRelease] [--armTest] [--circleBuildNum=xxx] [--appveyorJobId=xxx] TARGET_BRANCH `) process.exit(0) } diff --git a/script/zip_manifests/dist_zip.win.arm64.manifest b/script/zip_manifests/dist_zip.win.arm64.manifest new file mode 100755 index 000000000000..9609afb4604c --- /dev/null +++ b/script/zip_manifests/dist_zip.win.arm64.manifest @@ -0,0 +1,70 @@ +LICENSE +LICENSES.chromium.html +chrome_100_percent.pak +chrome_200_percent.pak +electron.exe +ffmpeg.dll +icudtl.dat +libEGL.dll +libGLESv2.dll +locales/am.pak +locales/ar.pak +locales/bg.pak +locales/bn.pak +locales/ca.pak +locales/cs.pak +locales/da.pak +locales/de.pak +locales/el.pak +locales/en-GB.pak +locales/en-US.pak +locales/es-419.pak +locales/es.pak +locales/et.pak +locales/fa.pak +locales/fi.pak +locales/fil.pak +locales/fr.pak +locales/gu.pak +locales/he.pak +locales/hi.pak +locales/hr.pak +locales/hu.pak +locales/id.pak +locales/it.pak +locales/ja.pak +locales/kn.pak +locales/ko.pak +locales/lt.pak +locales/lv.pak +locales/ml.pak +locales/mr.pak +locales/ms.pak +locales/nb.pak +locales/nl.pak +locales/pl.pak +locales/pt-BR.pak +locales/pt-PT.pak +locales/ro.pak +locales/ru.pak +locales/sk.pak +locales/sl.pak +locales/sr.pak +locales/sv.pak +locales/sw.pak +locales/ta.pak +locales/te.pak +locales/th.pak +locales/tr.pak +locales/uk.pak +locales/vi.pak +locales/zh-CN.pak +locales/zh-TW.pak +natives_blob.bin +resources.pak +resources/default_app.asar +snapshot_blob.bin +swiftshader/libEGL.dll +swiftshader/libGLESv2.dll +v8_context_snapshot.bin +version