From 133ea8eb461f518db136b0b52a890fb59edde9f7 Mon Sep 17 00:00:00 2001 From: Elias Toivola Date: Mon, 16 Sep 2024 17:05:57 +0300 Subject: [PATCH] Fix and define cache links for golang and upx Windows script to install golang tries to download a .exe file from cache while the install file is really a .msi file. Golang and upx are new packages to ci-files so let's define their directory paths as neatly as possible to prevent more clutter to ci-files. This amends: 337206334e90ce77f1dbfa09e67e8fd866d25b60 Pick-to: 6.7 Change-Id: If6cfa38304bfec207500fcd7a67e3acba994eb9f Reviewed-by: Eike Ziller Reviewed-by: Marcus Tillmanns (cherry picked from commit f6313247cc01da3178d376dd8cf0bdd2fdfe2737) Reviewed-by: Qt Cherry-pick Bot --- .../common/linux/install-golang.sh | 4 +-- coin/provisioning/common/linux/install-upx.sh | 4 +-- .../common/windows/install-golang.ps1 | 35 +++++++++++++------ .../common/windows/install-upx.ps1 | 4 +-- 4 files changed, 31 insertions(+), 16 deletions(-) diff --git a/coin/provisioning/common/linux/install-golang.sh b/coin/provisioning/common/linux/install-golang.sh index a4f4cd0d..1f0f272e 100755 --- a/coin/provisioning/common/linux/install-golang.sh +++ b/coin/provisioning/common/linux/install-golang.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (C) 2023 The Qt Company Ltd. +# Copyright (C) 2024 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only # shellcheck source=../unix/DownloadURL.sh @@ -25,7 +25,7 @@ case "$uname_m" in *) fatal "Unknown architecture in uname: $uname_m" 43 ;; esac -internalUrl="http://ci-files01-hki.ci.qt.io/input/go/$pkgname" +internalUrl="http://ci-files01-hki.ci.qt.io/input/go/linux/$pkgname" externalUrl="https://go.dev/dl/$pkgname" targetFile="$HOME/$pkgname" diff --git a/coin/provisioning/common/linux/install-upx.sh b/coin/provisioning/common/linux/install-upx.sh index e2225f09..8659bf19 100755 --- a/coin/provisioning/common/linux/install-upx.sh +++ b/coin/provisioning/common/linux/install-upx.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (C) 2023 The Qt Company Ltd. +# Copyright (C) 2024 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only # shellcheck source=../unix/DownloadURL.sh @@ -25,7 +25,7 @@ case "$uname_m" in *) fatal "Unknown architecture in uname: $uname_m" 43 ;; esac -internalUrl="http://ci-files01-hki.ci.qt.io/input/upx/$pkgname" +internalUrl="http://ci-files01-hki.ci.qt.io/input/upx/linux/$pkgname" externalUrl="https://github.com/upx/upx/releases/download/v$version/$pkgname" targetFile="$HOME/$pkgname" diff --git a/coin/provisioning/common/windows/install-golang.ps1 b/coin/provisioning/common/windows/install-golang.ps1 index d40bcce2..42a79f45 100644 --- a/coin/provisioning/common/windows/install-golang.ps1 +++ b/coin/provisioning/common/windows/install-golang.ps1 @@ -1,19 +1,34 @@ -# Copyright (C) 2022 The Qt Company Ltd. +# Copyright (C) 2024 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + . "$PSScriptRoot\helpers.ps1" -# Install Git - $version = "1.22.4" -if (Is64BitWinHost) { - $arch = "amd64" - $sha256 = "3c21105d7b584759b6e266383b777caf6e87142d304a10b539dbc66ab482bb5f" -} else { - $arch = "386" - $sha256 = "5c6446e2ea80bc6a971d2b34446f16e6517e638b0ff8d3ea229228d1931790b0" + +$cpu_arch = Get-CpuArchitecture +switch ($cpu_arch) { + x64 { + $arch = "amd64" + $sha256 = "3c21105d7b584759b6e266383b777caf6e87142d304a10b539dbc66ab482bb5f" + break + } + x86 { + $arch = "386" + $sha256 = "5c6446e2ea80bc6a971d2b34446f16e6517e638b0ff8d3ea229228d1931790b0" + break + } + arm64 { + $arch = "arm64" + $sha256 = "553cc6c460f4e3eb4fad5b897c0bb22cd8bbeb20929f0e3eeb939420320292ce" + break + } + default { + throw "Unknown architecture $cpu_arch" + } } + $goPackage = "C:\Windows\Temp\Go-" + $version + $arch + ".msi" -$url_cache = "\\ci-files01-hki.ci.qt.io\provisioning\windows\Go-" + $version + $arch + ".exe" +$url_cache = "https://ci-files01-hki.ci.qt.io/input/go/windows/go" + $version + ".windows-" + $arch + ".msi" $url_official = "https://go.dev/dl/go" + $version + ".windows-" + $arch + ".msi" Write-Host "Fetching Go $version..." diff --git a/coin/provisioning/common/windows/install-upx.ps1 b/coin/provisioning/common/windows/install-upx.ps1 index e29cc07b..abfb6712 100644 --- a/coin/provisioning/common/windows/install-upx.ps1 +++ b/coin/provisioning/common/windows/install-upx.ps1 @@ -1,4 +1,4 @@ -# Copyright (C) 2019 The Qt Company Ltd. +# Copyright (C) 2024 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only . "$PSScriptRoot\helpers.ps1" @@ -23,7 +23,7 @@ $filename_zip = $filename + ".zip" $zip = Get-DownloadLocation ($filename_zip) $officialurl = "https://github.com/upx/upx/releases/download/v" + $version + "/" + $filename_zip -$cachedurl = "https://ci-files01-hki.ci.qt.io/input/upx/" + $filename_zip +$cachedurl = "https://ci-files01-hki.ci.qt.io/input/upx/windows/" + $filename_zip Write-Host "Removing old UPX" Remove "C:\UPX"