Re: [PATCH 7/7] gitlab-ci: fix hanging MSVC jobs
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Sep 30, 2026, 12:26 UTC
- Message-ID
- <CAOLa=ZShU_FhuudX6JSPO7q6w9xBR-QRyEd1UbCZ15o-S3xtqQ@mail.gmail.com>
- In-Reply-To
- <20260924-pks-meson-improvements-v1-7-90b7f79f1c4e@pks.im>
FPatrick Steinhardt <ps@pks.im> writes:
Show 34 quoted lines
> Starting with GitLab Runner 19.x, the runner executes `git credential
> reject` in its cleanup stage. This has bad interactions with our build
> environment because we install our own version of PortableGit, and the
> runner picks up that version of Git. The consequence is that we invoke
> PortableGit's default credential manager, which is Git Credential
> Manager for Windows. GCM then tries to use Windows Credential Manager,
> but it cannot and thus the job hangs in its cleanup phase forever.
>
> Fix this hang by unsetting the credential helper after installing
> PortableGit. This means that `git credential reject` becomes a no-op,
> and thus the cleanup succeeds again.
>
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
> ci/install-dependencies.ps1 | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/ci/install-dependencies.ps1 b/ci/install-dependencies.ps1
> index e3b367fa54..2ceb5dd99a 100755
> --- a/ci/install-dependencies.ps1
> +++ b/ci/install-dependencies.ps1
> @@ -53,3 +53,11 @@ Invoke-Installer msiexec.exe @('/i', $mesonMsi, 'INSTALLDIR=C:\Meson', '/quiet',
> $rustMsi = Get-Installer "rust.msi" `
> "https://static.rust-lang.org/dist/rust-$RustVersion-x86_64-pc-windows-msvc.msi"
> Invoke-Installer msiexec.exe @('/i', $rustMsi, 'INSTALLDIR=C:\Rust', 'ADDLOCAL=Rustc,Cargo,Std', '/quiet', '/norestart')
> +
> +# Disable Git Credential Manager, which is auto-configured by PortableGit.
> +# GitLab's runner picks up this Git in its cleanup stage and runs `git
> +# credential reject`, which hangs in GCM and makes the job time out.
> +& "C:\Program Files\Git\bin\git.exe" config unset --all --system credential.helper
> +if ($LASTEXITCODE -ne 0 -and $LASTEXITCODE -ne 5) {
> + throw "Failed to unset credential.helper with exit code $LASTEXITCODE"
> +}
>Nice, for reference the runner team also has a fix on their end to disable credential.helper on their side too [1].
[1]: gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/7470
> -- > 2.56.0.rc2.329.gd58861e689.dirty