From f18fca07290ac5e7d0eca39c98c1b662c22566b2 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Tue, 5 Nov 2019 17:18:08 -0500 Subject: [PATCH] build: speed up windows source retrieval (#20955) * ci: speed up src retrieval * Don't save zip on ia32 * Update external binaries if src zip already exists * Apply suggestions from code review Co-Authored-By: Jeremy Apthorp * Update appveyor.yml --- appveyor.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 168202b451..e98c970eab 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -76,7 +76,30 @@ build_script: --unmanaged %GCLIENT_EXTRA_ARGS% "https://github.com/electron/electron" - - gclient sync --with_branch_heads --with_tags --reset + - ps: >- + if ($env:GN_CONFIG -eq 'release') { + gclient sync --with_branch_heads --with_tags --reset + } else { + cd src\electron + node script\generate-deps-hash.js + $depshash = Get-Content .\.depshash -Raw + $zipfile = "Z:\$depshash.7z" + cd ..\.. + if (Test-Path -Path $zipfile) { + # file exists, unzip and then gclient sync + 7z x -y $zipfile -mmt=30 -aoa + # update external binaries + python src/electron/script/update-external-binaries.py + } else { + # file does not exist, gclient sync, then zip + gclient sync --with_branch_heads --with_tags --reset + if ($env:TARGET_ARCH -ne 'ia32') { + # archive current source for future use + # only run on x64/woa to avoid contention saving + 7z a $zipfile src -xr!android_webview -xr!electron -xr'!*\.git' -xr!third_party\WebKit\LayoutTests! -xr!third_party\blink\web_tests -xr!third_party\blink\perf_tests -slp -t7z -mmt=30 + } + } + } - cd src - ps: $env:BUILD_CONFIG_PATH="//electron/build/args/%GN_CONFIG%.gn" - gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") %GN_EXTRA_ARGS% cc_wrapper=\"%SCCACHE_PATH%\""