From 030de25e39b3a99fbcb3e67db3d2eeecb2f7b8a9 Mon Sep 17 00:00:00 2001 From: v-davit-ioramashvili Date: Fri, 14 Aug 2026 13:17:48 +0400 Subject: [PATCH] [Windows] Add aarch64-pc-windows-gnullvm Rust target on ARM64 (#14493) The Windows 11 ARM image only shipped the MSVC Rust target, while x64 ships both MSVC and the MinGW (x86_64-pc-windows-gnu) target. Add the LLVM-MinGW (gnullvm) target so ARM users can build against it without a manual 'rustup target add' in every workflow, bringing ARM in line with x64. Assert installed targets in Rust.Tests.ps1. Fixes #14491 Co-authored-by: Davit Ioramashvili <294214454+v-davit-ioramashvili@users.noreply.github.com> --- images/windows/scripts/build/Install-Rust.ps1 | 3 +++ images/windows/scripts/tests/Rust.Tests.ps1 | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/images/windows/scripts/build/Install-Rust.ps1 b/images/windows/scripts/build/Install-Rust.ps1 index 890b4103af..5545c29a95 100644 --- a/images/windows/scripts/build/Install-Rust.ps1 +++ b/images/windows/scripts/build/Install-Rust.ps1 @@ -36,6 +36,9 @@ $env:Path += ";$env:CARGO_HOME\bin" if (Test-IsArm64) { rustup target add aarch64-pc-windows-msvc + + # Add target for building LLVM-MinGW (gnullvm) binaries + rustup target add aarch64-pc-windows-gnullvm } else { # Add i686 target for building 32-bit binaries rustup target add i686-pc-windows-msvc diff --git a/images/windows/scripts/tests/Rust.Tests.ps1 b/images/windows/scripts/tests/Rust.Tests.ps1 index 4449d40561..3002fae3e0 100644 --- a/images/windows/scripts/tests/Rust.Tests.ps1 +++ b/images/windows/scripts/tests/Rust.Tests.ps1 @@ -28,6 +28,13 @@ Describe "Rust" { @{envVar = "CARGO_HOME"} ) + $rustTargetNames = if (Test-IsArm64) { + @("aarch64-pc-windows-msvc", "aarch64-pc-windows-gnullvm") + } else { + @("i686-pc-windows-msvc", "x86_64-pc-windows-gnu") + } + $rustTargets = $rustTargetNames | ForEach-Object { @{ Target = $_ } } + It "C:\Users\Default\.rustup and C:\Users\Default\.cargo folders exist" { "C:\Users\Default\.rustup", "C:\Users\Default\.cargo" | Should -Exist } @@ -40,4 +47,8 @@ Describe "Rust" { "$ToolName --version" | Should -ReturnZeroExitCode $binPath | Should -Exist } + + It " rustup target is installed" -TestCases $rustTargets { + (rustup target list --installed) | Should -Contain $Target + } }