Merge branch 'js/gitlab-ci-windows-rust'

The Windows GitLab CI job has been updated to provision and use the
GCC-targeting Rust toolchain for MinGW builds, fixing job failures
caused by incomplete Rust setup and missing linker support.

* js/gitlab-ci-windows-rust:
  ci(gitlab,windows): provide GNU Rust's host-linker support
  ci(gitlab,windows): fix Rust setup for GitLab's MinGW build
  ci(gitlab,windows): preserve exclusions during dependency setup
  ci(gitlab,windows): provision GNU Rust for SDK-based MinGW builds
This commit is contained in:
Junio C Hamano committed 2026-10-06 10:13:31 -07:00
commit 76514ee87b
2 files changed
+20 -7

No files matched your search

+4 -1
View File
@@ -133,8 +133,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
+16 -6
View File
@@ -1,5 +1,6 @@
param(
[string]$DownloadDirectory = '.dependencies'
[string]$DownloadDirectory = '.dependencies',
[switch]$Mingw
)
$ErrorActionPreference = 'Stop'
@@ -11,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 {
@@ -41,6 +44,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$(if ($Mingw) { ',Gcc' })", '/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 +63,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')