From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, "Yonggang Luo" <luoyonggang@gmail.com>,
"Michael Tokarev" <mjt@tls.msk.ru>,
"Thomas Huth" <thuth@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH] gitlab: purge msys pacman cache
Date: Fri, 10 Oct 2025 18:43:12 +0100 [thread overview]
Message-ID: <aOlFsILuVDwO_ISY@redhat.com> (raw)
In-Reply-To: <CAFEAcA-9WfE_vNKewpe=05bLs+mi8tQSN-3cYnAWwC0ErfQBmA@mail.gmail.com>
On Fri, Oct 10, 2025 at 06:23:22PM +0100, Peter Maydell wrote:
> On Fri, 10 Oct 2025 at 17:05, Daniel P. Berrangé <berrange@redhat.com> wrote:
> >
> > 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é <berrange@redhat.com>
> > ---
> > .gitlab-ci.d/windows.yml | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > See a test job with this change, plus a find across the msys
> > pacman cache, showing the cleanup effects....
> >
> > Before cleanup:
> >
> > https://gitlab.com/berrange/qemu/-/jobs/11679136531#L34
> >
> > After cleanup:
> >
> > https://gitlab.com/berrange/qemu/-/jobs/11679136531#L1126
> >
> > 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
> > --
>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
>
> Hopefully this will make the CI job take less time (for the
> record, currently in the main CI run it takes about 70 minutes,
> of which 10 minutes is "unpack the cache" at the start and
> 20 minutes is "repack the cache" at the end).
Based on how long it takes to pack/unpack the cache in my job, I'd
be expecting approx a 25 minute win.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2025-10-10 17:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-10 16:05 [PATCH] gitlab: purge msys pacman cache Daniel P. Berrangé
2025-10-10 17:23 ` Peter Maydell
2025-10-10 17:43 ` Daniel P. Berrangé [this message]
2025-10-10 17:59 ` Thomas Huth
2025-10-12 2:28 ` 罗勇刚(Yonggang Luo)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aOlFsILuVDwO_ISY@redhat.com \
--to=berrange@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=luoyonggang@gmail.com \
--cc=mjt@tls.msk.ru \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).