From 661f415b9d3eb1853bd43454f688f24f8c31fda0 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 24 Sep 2026 20:01:50 +0000 Subject: [PATCH 1/4] ci(gitlab,windows): provision GNU Rust for SDK-based MinGW builds The minimal Git for Windows SDK already supplies Git and GCC. The MinGW Makefile build needs the Rust toolchain that targets GCC (as opposed to the more common MSVC one), not another Git installation or Meson. Prepare the `install-dependencies.ps1` script to be able to install the GCC-targeting Rust toolchain. Assisted-by: GPT-6 Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- ci/install-dependencies.ps1 | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ci/install-dependencies.ps1 b/ci/install-dependencies.ps1 index e3b367fa54..8c68fb0cfc 100755 --- a/ci/install-dependencies.ps1 +++ b/ci/install-dependencies.ps1 @@ -1,5 +1,6 @@ param( - [string]$DownloadDirectory = '.dependencies' + [string]$DownloadDirectory = '.dependencies', + [switch]$Mingw ) $ErrorActionPreference = 'Stop' @@ -41,6 +42,17 @@ function Invoke-Installer { } } +$rustTarget = if ($Mingw) { 'gnu' } else { 'msvc' } +$rustMsi = Get-Installer "rust-$rustTarget.msi" ( + "https://static.rust-lang.org/dist/" + + "rust-$RustVersion-x86_64-pc-windows-$rustTarget.msi") +Invoke-Installer msiexec.exe @('/i', $rustMsi, 'INSTALLDIR=C:\Rust', + 'ADDLOCAL=Rustc,Cargo,Std', '/quiet', '/norestart') + +if ($Mingw) { + return +} + $gitAssetVersion = $GitVersion -replace '\.windows\.\d+$', '' $gitInstaller = Get-Installer "Git-Installer.exe" ` "https://github.com/git-for-windows/git/releases/download/v$GitVersion/PortableGit-$gitAssetVersion-64-bit.7z.exe" @@ -49,7 +61,3 @@ Invoke-Installer $gitInstaller @('-y', '-o"C:\Program Files\Git"') $mesonMsi = Get-Installer "meson.msi" ` "https://github.com/mesonbuild/meson/releases/download/$MesonVersion/meson-$MesonVersion-64.msi" Invoke-Installer msiexec.exe @('/i', $mesonMsi, 'INSTALLDIR=C:\Meson', '/quiet', '/norestart') - -$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') From 0af2d7af63a8402d2b906efb2c9dcf3d6111f27e Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 24 Sep 2026 20:01:51 +0000 Subject: [PATCH 2/4] ci(gitlab,windows): preserve exclusions during dependency setup Creating .git/info/exclude as a file with `New-Item` and `-Force` truncates existing contents. When install-dependencies.ps1 follows install-sdk.ps1, this discards the latter's /git-sdk exclusion and causes ci/lib.sh to reject SDK files as unignored build artifacts. Assisted-by: GPT-6 Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- ci/install-dependencies.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/install-dependencies.ps1 b/ci/install-dependencies.ps1 index 8c68fb0cfc..f6868dc670 100755 --- a/ci/install-dependencies.ps1 +++ b/ci/install-dependencies.ps1 @@ -12,7 +12,9 @@ $RustVersion = '1.96.0' New-Item -Path $DownloadDirectory -ItemType Directory -Force | Out-Null New-Item -Path .git/info -ItemType Directory -Force | Out-Null -New-Item -Path .git/info/exclude -ItemType File -Force | Out-Null +if (-not (Test-Path .git/info/exclude)) { + New-Item -Path .git/info/exclude -ItemType File | Out-Null +} Add-Content -Path .git/info/exclude -Value "/$DownloadDirectory" function Get-Installer { From e302a9189f0b47e5f4dae6add7baf14b6b5783e9 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 24 Sep 2026 20:01:52 +0000 Subject: [PATCH 3/4] ci(gitlab,windows): fix Rust setup for GitLab's MinGW build GitLab's MinGW job fails with "cargo: command not found": https://gitlab.com/git-scm/git/-/jobs/16576450182 86909a94db5d (ci(windows): build with Rust, 2026-09-13) enabled Rust in the shared CI configuration, but added the necessary setup only for GitHub Actions. The build needs Cargo to be reachable after the minimal SDK's login profile replaces PATH. Installing the toolchain alone is not enough. Assisted-by: GPT-6 Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1a8e90932c..95b2e8beb1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -138,8 +138,11 @@ build:mingw64: before_script: - *windows_before_script - ./ci/install-sdk.ps1 -directory "git-sdk" + - ./ci/install-dependencies.ps1 -Mingw script: - - git-sdk/usr/bin/bash.exe -l -c 'ci/make-test-artifacts.sh artifacts' + # The minimal SDK's profile resets PATH. + - git-sdk/usr/bin/bash.exe -l -c + 'PATH=$PATH:/c/Rust/bin ci/make-test-artifacts.sh artifacts' artifacts: paths: - artifacts From 1e5f522ef1d19117376a73a7d7730ba9593ddc51 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 24 Sep 2026 20:01:53 +0000 Subject: [PATCH 4/4] ci(gitlab,windows): provide GNU Rust's host-linker support GitLab's MinGW job cannot find `x86_64-w64-mingw32-gcc` when linking gitcore's build script: https://gitlab.com/dscho/git1/-/jobs/16593470275 Although gitcore is a static library, Cargo first links `build.rs` as a host executable. We omitted the Rust MSI's `Gcc` feature, which supplies the required linker and platform libraries: https://github.com/rust-lang/rust/blob/1.96.0/src/etc/installer/msi/rust.wxs Assisted-by: GPT-6 Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- ci/install-dependencies.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/install-dependencies.ps1 b/ci/install-dependencies.ps1 index f6868dc670..9b833b9370 100755 --- a/ci/install-dependencies.ps1 +++ b/ci/install-dependencies.ps1 @@ -49,7 +49,7 @@ $rustMsi = Get-Installer "rust-$rustTarget.msi" ( "https://static.rust-lang.org/dist/" + "rust-$RustVersion-x86_64-pc-windows-$rustTarget.msi") Invoke-Installer msiexec.exe @('/i', $rustMsi, 'INSTALLDIR=C:\Rust', - 'ADDLOCAL=Rustc,Cargo,Std', '/quiet', '/norestart') + "ADDLOCAL=Rustc,Cargo,Std$(if ($Mingw) { ',Gcc' })", '/quiet', '/norestart') if ($Mingw) { return