From: Daniel P. Berrangé Date: Fri, 10 Oct 2025 16:05:45 +0000 (+0100) Subject: gitlab: purge msys pacman cache X-Git-Tag: v10.2.0-rc1~60^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1d7fdee97b8959871d4093d89a79192155ca674f;p=thirdparty%2Fqemu.git gitlab: purge msys pacman cache For the Windows msys2 CI job we install many packages using pacman and use the GitLab cache to preserve the pacman cache across CI runs. While metadata still needs downloading, this avoids pacman re-downloading packages from msys2 if they have not changed. The problem is that pacman never automatically purges anything from its package cache. Thus the GitLab cache is growing without bound and packing/unpacking the cache is consuming an increasing amount of time in the CI job. If we run 'pacman -Sc' /after/ installing our desired package set, it will purge any cached downloaded packages that are not matching any installed package. This will (currently) cap the pacman download cache at approx 256 MB. Signed-off-by: Daniel P. Berrangé Reviewed-by: Yonggang Luo Reviewed-by: Thomas Huth Tested-by: Thomas Huth Reviewed-by: Peter Maydell Message-ID: <20251010160545.144760-1-berrange@redhat.com> Signed-off-by: Thomas Huth --- diff --git a/.gitlab-ci.d/windows.yml b/.gitlab-ci.d/windows.yml index 1e6a01bd9a..6e1135d8b8 100644 --- a/.gitlab-ci.d/windows.yml +++ b/.gitlab-ci.d/windows.yml @@ -87,6 +87,7 @@ msys2-64bit: mingw-w64-x86_64-pkgconf mingw-w64-x86_64-python mingw-w64-x86_64-zstd" + - .\msys64\usr\bin\bash -lc "pacman -Sc --noconfirm" - Write-Output "Running build at $(Get-Date -Format u)" - $env:JOBS = $(.\msys64\usr\bin\bash -lc nproc) - $env:CHERE_INVOKING = 'yes' # Preserve the current working directory