From 92af4495d16ae1599c339d7cce54a762a056aa43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Petter=20Sk=C3=A5lerud?= Date: Fri, 24 Apr 2026 10:59:07 +0200 Subject: [PATCH] Windows, MSYS2: Confirm correct packages are installed There have been times where we have updated the list of packages to install, but prebuilt binaries have missed them. This change adds a check to confirm that the expected packages are installed. Pick-to: 6.11 Change-Id: I5f6e2b7917c45f7a220d41946e5e4030f63ca21d Reviewed-by: Elias Toivola Reviewed-by: Tero Heikkinen --- coin/provisioning/common/windows/install-msys2.ps1 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/coin/provisioning/common/windows/install-msys2.ps1 b/coin/provisioning/common/windows/install-msys2.ps1 index c8f3420f..6af8f6fe 100644 --- a/coin/provisioning/common/windows/install-msys2.ps1 +++ b/coin/provisioning/common/windows/install-msys2.ps1 @@ -20,6 +20,7 @@ $url_cache = "https://ci-files01-hki.ci.qt.io/input/windows/$package" $url_official = "http://repo.msys2.org/distrib/$arch/$package" $TargetLocation = "C:\Utils" +$required_packages = @("perl", "make", "yasm", "diffutils") if ((Test-Path $url_cache_prebuilt)) { $PackagePath = "C:\Windows\Temp\$package_prebuilt" @@ -35,7 +36,8 @@ if ((Test-Path $url_cache_prebuilt)) { # install perl make and yasm # Run these without 'Run-Executable' function. When using the function the gpg-agent will lock the needed tmp*.tmp file. - cmd /c "$msys `"-l`" `"-c`" `"rm -rf /etc/pacman.d/gnupg;pacman-key --init;pacman-key --populate msys2;pacman-key --refresh;pacman -S --noconfirm perl make yasm diffutils`"" + $required_packages_string = $required_packages -join ' ' + cmd /c "$msys `"-l`" `"-c`" `"rm -rf /etc/pacman.d/gnupg;pacman-key --init;pacman-key --populate msys2;pacman-key --refresh;pacman -S --noconfirm $required_packages_string`"" Start-Sleep -s 60 cmd /c "$msys `"-l`" `"-c`" `"echo y | cpan -i Text::Template Test::More`"" @@ -46,6 +48,16 @@ if ((Test-Path $url_cache_prebuilt)) { if (Get-Process -Name "dirmngr" -ErrorAction SilentlyContinue) { Stop-Process -Force -Name dirmngr } } +$msys = "C:\Utils\msys64\usr\bin\bash" +# Confirm that we have the correct packages installed, in case prebuilt MSYS +# binaries are missing them. +$installed = & "$msys" -lc "pacman -Qq" +$installedSet = $installed | Sort-Object -Unique +$missing_packages = $required_packages | Where-Object { $_ -notin $installedSet } +if ($missing_packages.Count -ne 0) { + throw "Missing MSYS packages: $($missing_packages -join ' ')" +} + Write-Host "Cleaning $PackagePath.." Remove "$PackagePath"