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 + } }