From 13215b3aad8b5badf0cfc45db571b945ac8207ea Mon Sep 17 00:00:00 2001 From: Heikki Halmet Date: Wed, 5 Apr 2023 11:53:29 +0000 Subject: [PATCH] Provisioning: Use cached emsdk version 3.1.25 for Windows Task-number: QTQAINFRA-5458 Pick-to: 6.5 Change-Id: I6567f36e545b5100325dfa8e1895a24a41a4783c Reviewed-by: Ville-Pekka Karhu --- coin/provisioning/common/windows/emsdk.ps1 | 24 +++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/coin/provisioning/common/windows/emsdk.ps1 b/coin/provisioning/common/windows/emsdk.ps1 index adc67179..0ec4e923 100644 --- a/coin/provisioning/common/windows/emsdk.ps1 +++ b/coin/provisioning/common/windows/emsdk.ps1 @@ -1,6 +1,6 @@ ############################################################################ ## -## Copyright (C) 2021 The Qt Company Ltd. +## Copyright (C) 2023 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the provisioning scripts of the Qt Toolkit. @@ -42,16 +42,30 @@ # This script will install emscripten needed by WebAssembly $version = "3.1.25" +$zipVersion = $version -replace '\.', "_" +$temp = "$env:tmp" +$cacheUrl = "https://ci-files01-hki.ci.qt.io/input/emsdk/emsdk_windows_${zipVersion}.zip" +$sha = "cd180cae757e75316d50f2edc2f99a9d2eb83d5b" # Make sure python is in the path Prepend-Path "C:\Python27" cd "C:\\Utils" -C:\PROGRA~1\Git\bin\git clone https://github.com/emscripten-core/emsdk.git $installLocationEmsdk = "C:\\Utils\\emsdk" -cd $installLocationEmsdk -.\emsdk install $version -.\emsdk activate $version +try { + Write-Host "Fetching from cached location" + Download $cacheUrl $cacheUrl ${temp}\${zipVersion}.zip + Verify-Checksum ${temp}\${zipVersion}.zip $sha + Extract-7Zip ${temp}\${zipVersion}.zip C:\Utils\ + cd $installLocationEmsdk + .\emsdk activate $version +} catch { + Write-Host "Can't find cached emsdk. Cloning it" + C:\PROGRA~1\Git\bin\git clone https://github.com/emscripten-core/emsdk.git + cd $installLocationEmsdk + .\emsdk install $version + .\emsdk activate $version +} $versionWinPython = $($Env:EMSDK_PYTHON -split ('python\\') -split ('_64bit'))[1] $versionNode = $($Env:EMSDK_NODE -split ('node\\') -split ('_64bit'))[1]