[windows] Add windows-11-arm64 image generation code#13879
[windows] Add windows-11-arm64 image generation code#13879shamil-mubarakshin wants to merge 50 commits intoactions:mainfrom
Conversation
This reverts commit 23dd906.
This reverts commit 23dd906.
There was a problem hiding this comment.
Pull request overview
This PR adds Packer/template and toolset support to generate new Windows 11 ARM64 runner images (including a VS2026 variant), and updates Windows build/tests/docs-gen scripts to handle Windows 11 and ARM64-specific differences.
Changes:
- Add new Windows 11 ARM64 toolset definitions and Packer build templates (base + VS2026).
- Introduce OS/arch detection helpers (
Test-IsWin11,Test-IsArm64) and update installers to download/install ARM64-compatible binaries where needed. - Adjust Pester tests and software-report generation to skip/omit components not present on Windows 11 images.
Reviewed changes
Copilot reviewed 52 out of 52 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| images/windows/toolsets/toolset-win-11-vs2026-arm64.json | New toolset definition for Windows 11 ARM64 with VS2026. |
| images/windows/toolsets/toolset-win-11-arm64.json | New toolset definition for Windows 11 ARM64 with VS2022. |
| images/windows/templates/locals.windows.pkr.hcl | Register new Windows 11 ARM64 image variants and source SKUs/disk sizing. |
| images/windows/templates/build.windows-11-vs2026-arm64.pkr.hcl | New Packer build pipeline for Windows 11 ARM64 + VS2026. |
| images/windows/templates/build.windows-11-arm64.pkr.hcl | New Packer build pipeline for Windows 11 ARM64 (VS2022). |
| images/windows/scripts/tests/Wix.Tests.ps1 | Skip WiX validation on Windows 11. |
| images/windows/scripts/tests/WindowsFeatures.Tests.ps1 | Adjust update expectations; skip WSL2 checks on Windows 11. |
| images/windows/scripts/tests/VisualStudio.Tests.ps1 | Skip Windows 10 SDK validation on Windows 11. |
| images/windows/scripts/tests/Toolset.Tests.ps1 | Remove PyPy tool executable checks on Windows 11. |
| images/windows/scripts/tests/Tools.Tests.ps1 | Skip Service Fabric/Zstd on Windows 11; add CMake/Ninja functional tests. |
| images/windows/scripts/tests/Shell.Tests.ps1 | Skip MSYS2 shell wrapper validation on Windows 11. |
| images/windows/scripts/tests/MSYS2.Tests.ps1 | Skip MSYS2 package validation on Windows 11. |
| images/windows/scripts/tests/Miniconda.Tests.ps1 | Skip Miniconda validation on Windows 11. |
| images/windows/scripts/tests/Java.Tests.ps1 | Make JAVA_HOME env var expectations architecture-aware (X64 vs AARCH64). |
| images/windows/scripts/tests/Haskell.Tests.ps1 | Skip Haskell validation on Windows 11 and prevent discovery-time failures. |
| images/windows/scripts/tests/Docker.Tests.ps1 | Skip Docker validations on Windows 11. |
| images/windows/scripts/tests/Databases.Tests.ps1 | Skip MongoDB/PostgreSQL validations on Windows 11. |
| images/windows/scripts/tests/ChocoPackages.Tests.ps1 | Skip SVN on Windows 11; skip CMake/Ninja choco checks on ARM64. |
| images/windows/scripts/tests/Android.Tests.ps1 | Skip Android SDK validation on Windows 11. |
| images/windows/scripts/helpers/VisualStudioHelpers.ps1 | Add Visual Studio installer architecture parameter support. |
| images/windows/scripts/helpers/InstallHelpers.ps1 | Add Test-IsArm64 and Test-IsWin11 helper functions. |
| images/windows/scripts/helpers/ImageHelpers.psm1 | Export new helper functions via module. |
| images/windows/scripts/docs-gen/SoftwareReport.Java.psm1 | Make Java software report arch-aware for JAVA_HOME_* variables. |
| images/windows/scripts/docs-gen/SoftwareReport.Common.psm1 | Omit CONDA env var from report on Windows 11. |
| images/windows/scripts/docs-gen/SoftwareReport.CachedTools.psm1 | Conditionally omit PyPy cached tool reporting on Windows 11. |
| images/windows/scripts/docs-gen/Generate-SoftwareReport.ps1 | Omit multiple tool/report sections on Windows 11. |
| images/windows/scripts/build/Install-WDK.ps1 | Add Windows 11 WDK URL path. |
| images/windows/scripts/build/Install-VisualStudio.ps1 | Pass architecture into Visual Studio installer flow. |
| images/windows/scripts/build/Install-Rust.ps1 | Make Rust bootstrap arch-aware; adjust tool installs based on OS. |
| images/windows/scripts/build/Install-Ruby.ps1 | Make Ruby installer selection arch-aware and pass toolcache arch. |
| images/windows/scripts/build/Install-R.ps1 | Adjust R path resolution for ARM64 environments. |
| images/windows/scripts/build/Install-PowershellCore.ps1 | Download PowerShell MSI matching detected arch. |
| images/windows/scripts/build/Install-OpenSSL.ps1 | Choose OpenSSL arch parameter based on ARM64 detection. |
| images/windows/scripts/build/Install-NodeJS.ps1 | Download Node MSI matching detected arch. |
| images/windows/scripts/build/Install-Ninja.ps1 | New ARM64-only Ninja install implementation. |
| images/windows/scripts/build/Install-Nginx.ps1 | Avoid failing when w3svc service doesn’t exist. |
| images/windows/scripts/build/Install-NativeImages.ps1 | Skip NGen update on Windows 11. |
| images/windows/scripts/build/Install-LLVM.ps1 | Add ARM64 LLVM install via GitHub release archive. |
| images/windows/scripts/build/Install-JavaTools.ps1 | Install and set JAVA_HOME env vars based on architecture. |
| images/windows/scripts/build/Install-GitHub-CLI.ps1 | Download GitHub CLI installer matching arch. |
| images/windows/scripts/build/Install-Git.ps1 | Download Git for Windows installer matching arch. |
| images/windows/scripts/build/Install-Firefox.ps1 | Download Firefox and geckodriver matching arch. |
| images/windows/scripts/build/Install-EdgeDriver.ps1 | Download Edge WebDriver matching arch. |
| images/windows/scripts/build/Install-DotnetSDK.ps1 | Validate SDK archive hash by arch; apply manifest workaround unconditionally. |
| images/windows/scripts/build/Install-CMake.ps1 | New ARM64-only CMake install implementation with checksum validation. |
| images/windows/scripts/build/Install-Chrome.ps1 | Download Chrome installer matching arch. |
| images/windows/scripts/build/Install-Apache.ps1 | Avoid failing when w3svc service doesn’t exist. |
| images/windows/scripts/build/Configure-User.ps1 | Skip TortoiseSVN-related config on Windows 11 (and Win25). |
| images/windows/scripts/build/Configure-Toolset.ps1 | Make Go env var naming arch-aware (X64 vs AARCH64). |
| images/windows/scripts/build/Configure-Shell.ps1 | Don’t create MSYS2 bash wrapper on Windows 11. |
| images/windows/scripts/build/Configure-ImageDataFile.ps1 | Add Windows 11 ARM64 image label/URLs to imagedata metadata. |
| images/windows/scripts/build/Configure-BaseImage.ps1 | Avoid failing when ServerManager scheduled task isn’t present. |
images/windows/scripts/docs-gen/SoftwareReport.CachedTools.psm1
Outdated
Show resolved
Hide resolved
…rakshin/runner-images into shamilm/add-win11-arm-vs2026
|
|
||
| Write-Host "Disable Server Manager on Logon" | ||
| Get-ScheduledTask -TaskName ServerManager | Disable-ScheduledTask | ||
| Get-ScheduledTask -TaskName ServerManager -ErrorAction SilentlyContinue | Disable-ScheduledTask |
There was a problem hiding this comment.
curious why it is not required for arm64.
I wonder if we want to wrap it to Test-IsArm64 instead of silentlyContinue to avoid problems.
There was a problem hiding this comment.
Remote Access Management Tools optional feature is not enabled on windows-11
| New-Item -Path $shellPath -ItemType Directory | Out-Null | ||
|
|
||
| # add a wrapper for C:\msys64\usr\bin\bash.exe | ||
| if (-not (Test-IsWin11)) { |
There was a problem hiding this comment.
I think it should be -not (Test-IsArm64) or Test-IsX64
| } elseif ((Test-IsWin11) -and (Test-IsArm64) -and $env:INSTALL_VS_2026) { | ||
| $imageLabel = "windows-11-vs2026-arm64" | ||
| $softwareUrl = "${githubUrl}/win11-vs2026-arm64/$imageMajorVersion.$imageMinorVersion/images/windows/Windows11-VS2026-Arm64-Readme.md" | ||
| $releaseUrl = "https://github.com/actions/runner-images/releases/tag/win11-vs2026-arm64%2F$imageMajorVersion.$imageMinorVersion" | ||
| } elseif ((Test-IsWin11) -and (Test-IsArm64)) { |
There was a problem hiding this comment.
Consider changing helpers to include architecture:
- rename
Test-IsWin25toTest-IsWin25-X64 - rename
Test-IsWin22toTest-IsWin22-X64 - rename
Test-IsWin11toTest-IsWin11-Arm64 - add helper
Test-IsX64
| # TortoiseSVN not installed on Windows 2025 image due to Sysprep issues | ||
| if (-not (Test-IsWin25)) { | ||
| # TortoiseSVN not installed on Windows 2025 and Windows 11 due to Sysprep issues | ||
| if (-not (Test-IsWin25) -and -not (Test-IsWin11)) { |
There was a problem hiding this comment.
to avoid extending this condition every time when add a new image
| if (-not (Test-IsWin25) -and -not (Test-IsWin11)) { | |
| if (Test-IsWin22) { |
| if (-not (Test-IsArm64)) { | ||
| exit 0 | ||
| } |
There was a problem hiding this comment.
can we just not add it to x64 template? If we keep it as it is, it could be very confusing. packer logs will show that script is completed.
| binGhcPath = $binGhcPath | ||
| Describe "Haskell" -Skip:(Test-IsWin11) { | ||
| BeforeDiscovery { | ||
| if (Test-IsWin11) { return } |
There was a problem hiding this comment.
curious why do we need this line if we skip test completely?
| } | ||
|
|
||
| It "Make a simple ninja project" { | ||
| "cmake -GNinja $ninjaProjectPath" | Should -ReturnZeroExitCode |
| if (Test-IsWin11) { | ||
| $toolsExecutables.Remove("PyPy") | ||
| } |
There was a problem hiding this comment.
may be add if x64 to improve readability?
$toolsExecutables = @{
Python = @(
@{ Binary = "python.exe"; Arguments = "--version" },
@{ Binary = "Scripts\pip.exe"; Arguments = "--version" }
)
Node = @(
@{ Binary = "node.exe"; Arguments = "--version" },
@{ Binary = "npm"; Arguments = "--version" }
)
Go = @(
@{ Binary = "bin\go.exe"; Arguments = "version" }
)
Ruby = @(
@{ Binary = "bin\ruby.exe"; Arguments = "--version" }
)
}
if (Test-IsX64) {
$toolsExecutables.Add("PyPy", @(
@{ Binary = "python.exe"; Arguments = "--version" },
@{ Binary = "Scripts\pip.exe"; Arguments = "--version" }
))
}| "Set-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon' -Name AutoAdminLogon -Value 1 -type String", | ||
| "Set-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon' -Name DefaultUsername -Value \"${var.install_user}\" -type String", | ||
| "Set-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon' -Name DefaultPassword -Value \"${var.install_password}\" -type String", |
There was a problem hiding this comment.
could you please add comments with explanation why do we need these lines?
| "Remove-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon' -Name AutoAdminLogon", | ||
| "Remove-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon' -Name DefaultUsername", | ||
| "Remove-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon' -Name DefaultPassword", |
There was a problem hiding this comment.
could you please add comment with explanation why do we need it?
Description
This PR:
Related issue: https://github.com/github/hosted-runners-images/issues/608
Check list