diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cd6fd4a5047e87..3f2483550038f6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/ci/install-dependencies.ps1 b/ci/install-dependencies.ps1 index e3b367fa54d042..9b833b93700d69 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' @@ -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')