actions / runner-images

GitHub Actions runner images
MIT License
9.31k stars 2.89k forks source link

(Public Beta) Windows Server 2022 with Visual Studio 2022 is now available #3949

Closed maxim-lobanov closed 2 years ago

maxim-lobanov commented 2 years ago

Windows Server 2022 availability 🚀

Hello everyone!

We are happy to announce that Windows Server 2022 is available for GitHub Actions and Azure DevOps users 🥳
You can use windows-2022 image label in your YAML to select this image.

GitHub Actions

jobs:
  jobName:
    runs-on: windows-2022

Azure DevOps

jobs:
- job: jobName
  pool:
    vmImage: 'windows-2022'

"Beta" status

The image is marked as "beta" for now. It means some software can be unstable on the new platform. Also there could be queueing issues as the capacity will be balanced only throughout the next weeks. Known issues:

Please report any problems with the new image to this repository. Any issues related to Azure DevOps tasks should be reported to https://github.com/microsoft/azure-pipelines-tasks.

Software differences

The full documentation of Windows Server 2022 image can be found in image README.
The software set is different between Windows Server 2019 and 2022. We have deprecated some legacy software with low usage and temporarily disabled software that is not supported on the new platform yet. Also, for tools with multiple installed versions we have reconsidered the list of versions based on usage.

Please find differences in the table below:

Tool name Windows 2019 Windows 2022 Notes
Windows Server 2019 (10.0.17763 Build 2061) 2022 (10.0.20348 Build 112)
Visual Studio 2019 (16.10.31515.178)
Workloads: recommended + custom + wix components
2022 Preview (17.0.31521.260)
Workloads: recommended set
Our policy is installing one VS version per platform. On Windows Server 2022, we install only VS 2022 (it is in Preview for now but will be released in future).
If your use-case requires using VS 2019, continue using Windows Server 2019 image. We don't have plans to deprecate it in near future.
Python Default version: 3.7.x
Architectures: x64 & x86
Pre-cached versions: 2.7, 3.5, 3.6, 3.7, 3.8, 3.9
Default version: 3.9.x
Architectures: x64
Pre-cached versions: 3.7, 3.8, 3.9
On GitHub Actions, actions/setup-python can install any version on-flight so this change doesn't impact users
PyPy 2.7, 3.6, 3.7 2.7, 3.7 Version 3.6 is officially deprecated in favor of 3.7 and is not updated anymore.
Ruby Default version: 2.5.x
Pre-cached versions: 2.4, 2.5, 2.6, 2.7, 3.0
Default version: 3.0.x
Pre-cached versions: 2.7, 3.0
On GitHub Actions, ruby/setup-ruby can install any version on-flight so this change doesn't impact users
Go Default version: 1.15.x
Pre-cached versions: 1.13, 1.14, 1.15, 1.16
Default version: 1.16.x
Pre-cached versions: 1.15, 1.16
If your use-case requires using any of these versions, consider using tasks to install Go on-flight:
- actions/setup-go (GitHub Actions)
- Go Tool Installer (Azure DevOps)
Java Default version: 8
Pre-installed versions: 8, 11, 13
Default version: 8
Pre-installed versions: 8, 11
Our policy is pre-installing only LTS versions of Java. if your use-case requires using non-LTS Java version, please consider using tasks to install it on-flight:
- actions/setup-java (GitHub Actions)
- Java Tool Installer (Azure DevOps)
Android Build-tools: >= 19.x
Platforms: >= 19.x
CMake: 3.10.2, 3.18.1
Google APIs: 21, 22, 23, 24
NDK: 21, 22
Build-tools: >= 27.x
Platforms: >= 27.x
CMake: 3.18.1
Google APIs: -
NDK: 21, 22
.NET Core SDK 2.1, 3.1, 5.0 3.1, 5.0 .NET Core 2.1 End Of Support is scheduled on August 21, 2021.
Please consider using tasks to install any version on-flight:
- actions/setup-dotnet (GitHub Actions)
- Use .NET Core (Azure DevOps)
Az modules Installed: 6.1.0
Zipped: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0, 3.5.0, 3.8.0, 4.3.0, 4.4.0, 4.7.0, 5.5.0, 5.9.0, 6.1.0
Installed: 6.1.0
Zipped: -
If your use-case requires using any of these versions, consider using tasks to install Az modules on-flight:
- azure-powershell-action (GitHub Actions)
- Azure PowerShell (Azure DevOps)
MSYS2 A lot of pre-installed msys packages Only pure MSYS2 is installed. No additional packages On Windows Server 2016 and 2019 we had a lot of pre-installed MSYS2 packages. We had a long discussion about "pre-installing them" vs "installing in runtime and caching". Our recommendation is using official setup-msys2 action to install packages on-flight and cache them.

The following software were not installed on Windows Server 2022 images by default: Miniconda, Google Cloud SDK, InnoSetup, NSIS, Perl, sbt, Cloud Foundry CLI, BizTalk Server and Client, WebPlatformInstaller, Windows Driver Kit

sylveon commented 2 years ago

I would recommend moving away from import std.core; and back to #include <thing> or import <thing>;

The standard library was not modularized for C++20 so you're using a non-standard extension. Using #include or import <thing>; does not require to install an additional component. If you really need them, you can simply run the VS setup from a powershell script:

Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
$InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Preview"
$componentsToAdd = @(
  # add components here, i don't know the name of the component with the standard library modules
)
[string]$workloadArgs = $componentsToAdd | ForEach-Object {" --add " +  $_}
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
if ($process.ExitCode -eq 0)
{
    Write-Host "components have been successfully added"
}
else
{
    Write-Host "components were not installed"
    exit 1
}
TheRustifyer commented 2 years ago

So I must add the modules component, copy paste your script into my project and create a new named action inside the current one?

That location (Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\") is the real location of the preinstalled msvc2022 on the windows-2022 machine?

sylveon commented 2 years ago

That location (Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer") is the real location of the preinstalled msvc2022 on the windows-2022 machine?

yes

TheRustifyer commented 2 years ago

I found the name of the component, but I am getting no success with this way

Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
$InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Preview"
$componentsToAdd = @(
    'Microsoft.VisualStudio.Component.VC.Modules.x86.x64'
)
[string]$workloadArgs = $componentsToAdd | ForEach-Object {" --add " +  $_}
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
if ($process.ExitCode -eq 0)
{
    Write-Host "components have been successfully added"
}
else
{
    Write-Host "components were not installed"
    exit 1
}

The output:

Run ./.github/scripts/setup_msvc.ps1
  ./.github/scripts/setup_msvc.ps1
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
  env:
    BUILD_TYPE: Release
components were not installed
Error: Process completed with exit code 1.
TheRustifyer commented 2 years ago

@sylveon sorry, but I am not being able of make the script works. I get the name of the component directly from the Microsoft page. Do you think I am missing something?

Thanks!

dougmassay commented 2 years ago

Not excited that InnoSetup is no longer included on windows-latest.

alexreinking commented 1 year ago

@Pyzyryab -- did you ever solve the C++ modules issue? It's been affecting me, too. The documentation makes it sound like Microsoft.VisualStudio.Component.VC.Modules.x86.x64 is already installed in the windows-2022 image.