From f084f4f5e0fb2d881975e266446e30e7ef5ad146 Mon Sep 17 00:00:00 2001 From: Even Oscar Andersen Date: Mon, 1 Sep 2025 09:06:36 +0200 Subject: [PATCH] wasm: Download chromedriver 139.0.7258.138 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We install the new driver alongside the old one, to make sure that existing builds work unmodified. The new chromedriver is needed for jspi to work. We set environment variables: -- for existing builds BROWSER_FOR_WASM CHROMEDRIVER_PATH -- for new builds WASM_BROWSER_JSPI WASM_BROWSER_JSPI_ARGS WASM_CHROMEDRIVER_PATH_JSPI WASM_CHROMEDRIVER_PATH_JSPI_ARGS Change-Id: Ia83d639ea2daf34cf44bd72bae455211fd64a441 Reviewed-by: Piotr WierciƄski Reviewed-by: Tero Heikkinen --- .../80-install-chrome.sh | 99 ++++++++++++++++--- 1 file changed, 88 insertions(+), 11 deletions(-) diff --git a/coin/provisioning/qtci-linux-openSUSE-15.6-x86_64/80-install-chrome.sh b/coin/provisioning/qtci-linux-openSUSE-15.6-x86_64/80-install-chrome.sh index 7901ea1a..4a1c1eb5 100644 --- a/coin/provisioning/qtci-linux-openSUSE-15.6-x86_64/80-install-chrome.sh +++ b/coin/provisioning/qtci-linux-openSUSE-15.6-x86_64/80-install-chrome.sh @@ -1,23 +1,100 @@ #!/usr/bin/env bash # Copyright (C) 2024 The Qt Company Ltd. -set -ex # This script will install up-to-date google Chrome needed for Webassembly auto tests. +# problems: +# The jspi browser require --enable-unsafe-swiftshader to work, the original browser don't +# Running the original browser after the jspi browser causes it to crash unless +# we make sure the cachedir is different. + # shellcheck source=../common/unix/DownloadURL.sh source "${BASH_SOURCE%/*}/../common/unix/SetEnvVar.sh" # shellcheck source=../common/unix/DownloadURL.sh source "${BASH_SOURCE%/*}/../common/unix/DownloadURL.sh" -chromeVersion="chrome-for-testing-131" -sha="006d8e0438980d5ca8809af6f036e2b802b13cc8" -cachedChromeUrl="https://ci-files01-hki.ci.qt.io/input/wasm/chrome/${chromeVersion}.zip" -officialChromeUrl="https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.204/linux64/chrome-linux64.zip" -target="/tmp/${chromeVersion}.zip" +# DownloadURL uses functions with exit status +set +ex -DownloadURL "$cachedChromeUrl" "$officialChromeUrl" "$sha" "$target" -sudo unzip -q "$target" -d "${HOME}" -sudo rm -f "$target" -chromePath="${HOME}/chrome-linux64/chrome" -SetEnvVar "BROWSER_FOR_WASM" "${chromePath}" +function Install { + sha=$1 + cached=$2 + official=$3 + home=$4 + target=$5 + + if [ -z "$home" ] + then + echo "No home" + exit 1 + fi + + if [ -z "$target" ] + then + echo "No target" + exit 1 + fi + + cachedUrl="https://ci-files01-hki.ci.qt.io/input/wasm/${cached}" + officialUrl="https://storage.googleapis.com/chrome-for-testing-public/${official}" + tmp="/tmp/${sha}.zip" + + if ! DownloadURL "$cachedUrl" "$officialUrl" "$sha" "$tmp" + then + echo "Download failed" + exit 1 + fi + + sudo rm -rf "${home}/${target}" + if ! unzip -q "$tmp" -d "${home}" + then + echo "Unzip failed" + exit 1 + fi + rm "$tmp" +} + +Install \ + "006d8e0438980d5ca8809af6f036e2b802b13cc8" \ + "chrome/chrome-for-testing-131.zip" \ + "131.0.6778.204/linux64/chrome-linux64.zip" \ + "${HOME}" \ + "chrome-linux64" + +Install \ + "53007a6778c4ba25763d066f12c598b982e72f74" \ + "chromedriver/chrome-for-testing-131.zip" \ + "131.0.6778.204/linux64/chromedriver-linux64.zip" \ + "${HOME}" \ + "chromedriver-linux64" + +Install \ + "9743a66a4427711e5b0cf1d569c1b893eab3c123" \ + "chrome/chrome-for-testing-139.zip" \ + "139.0.7258.138/linux64/chrome-linux64.zip" \ + "${HOME}/jspi" \ + "chrome-linux64" + +Install \ + "874a7870150ed0b20908ae77a5bd10d8cd5dea11" \ + "chromedriver/chrome-for-testing-139.zip" \ + "139.0.7258.138/linux64/chromedriver-linux64.zip" \ + "${HOME}/jspi" \ + "chromedriver-linux64" + +chromePath="${HOME}/chrome-linux64/" +chromeDriverPath="${HOME}/chromedriver-linux64/" +chromeJspiPath="${HOME}/jspi/chrome-linux64/" +chromeJspiDriverPath="${HOME}/jspi/chromedriver-linux64/" + +cp ${chromeDriverPath}chromedriver ${chromePath} +cp ${chromeJspiDriverPath}chromedriver ${chromeJspiPath} + +SetEnvVar "BROWSER_FOR_WASM" "${chromePath}chrome" +SetEnvVar "CHROMEDRIVER_PATH" "${chromePath}chromedriver" + +SetEnvVar "WASM_BROWSER_JSPI" "${chromeJspiPath}chrome" +SetEnvVar "WASM_BROWSER_JSPI_ARGS" "\"--headless --password-store=basic --enable-unsafe-swiftshader --user-data-dir=${HOME}/.cache/jspi\"" +SetEnvVar "WASM_CHROMEDRIVER_PATH_JSPI" "${chromeJspiPath}chromedriver" +SetEnvVar "WASM_CHROMEDRIVER_PATH_JSPI_ARGS" "\"--headless --password-store=basic --enable-unsafe-swiftshader --user-data-dir=${HOME}/.cache/jspi\""