Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .config/configuration.vsEnterprise.winget
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Usage: winget configure -f .config/configuration.vsEnterprise.winget
#
# Visual Studio 2022 Enterprise edition. For other editions use:
# Visual Studio 2026 Enterprise edition. For other editions use:
# .config/configuration.winget (Community, default)
# .config/configuration.vsProfessional.winget (Professional)
properties:
Expand All @@ -26,10 +26,10 @@ properties:
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: vsPackage
directives:
description: Install Visual Studio 2022 Enterprise
description: Install Visual Studio 2026 Enterprise
securityContext: elevated
settings:
id: Microsoft.VisualStudio.2022.Enterprise
id: Microsoft.VisualStudio.Enterprise
source: winget
- resource: Microsoft.VisualStudio.DSC/VSComponents
dependsOn:
Expand All @@ -40,6 +40,6 @@ properties:
securityContext: elevated
settings:
productId: Microsoft.VisualStudio.Product.Enterprise
channelId: VisualStudio.17.Release
channelId: VisualStudio.18.Release
vsConfigFile: '${WinGetConfigRoot}\..\.vsconfig'
configurationVersion: 0.2.0
8 changes: 4 additions & 4 deletions .config/configuration.vsProfessional.winget
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Usage: winget configure -f .config/configuration.vsProfessional.winget
#
# Visual Studio 2022 Professional edition. For other editions use:
# Visual Studio 2026 Professional edition. For other editions use:
# .config/configuration.winget (Community, default)
# .config/configuration.vsEnterprise.winget (Enterprise)
properties:
Expand All @@ -26,10 +26,10 @@ properties:
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: vsPackage
directives:
description: Install Visual Studio 2022 Professional
description: Install Visual Studio 2026 Professional
securityContext: elevated
settings:
id: Microsoft.VisualStudio.2022.Professional
id: Microsoft.VisualStudio.Professional
source: winget
- resource: Microsoft.VisualStudio.DSC/VSComponents
dependsOn:
Expand All @@ -40,6 +40,6 @@ properties:
securityContext: elevated
settings:
productId: Microsoft.VisualStudio.Product.Professional
channelId: VisualStudio.17.Release
channelId: VisualStudio.18.Release
vsConfigFile: '${WinGetConfigRoot}\..\.vsconfig'
configurationVersion: 0.2.0
6 changes: 3 additions & 3 deletions .config/configuration.winget
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ properties:
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: vsPackage
directives:
description: Install Visual Studio 2022 Community
description: Install Visual Studio 2026 Community
securityContext: elevated
settings:
id: Microsoft.VisualStudio.2022.Community
id: Microsoft.VisualStudio.Community
source: winget
- resource: Microsoft.VisualStudio.DSC/VSComponents
dependsOn:
Expand All @@ -40,6 +40,6 @@ properties:
securityContext: elevated
settings:
productId: Microsoft.VisualStudio.Product.Community
channelId: VisualStudio.17.Release
channelId: VisualStudio.18.Release
vsConfigFile: '${WinGetConfigRoot}\..\.vsconfig'
configurationVersion: 0.2.0
6 changes: 3 additions & 3 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ When adding settings to `src/shared/configfile/`:
- Visual Studio with these components:
- Windows SDK 26100
- MSBuild
- Universal Windows platform support for v143 build tools (X64 and ARM64)
- MSVC v143 - VS 2022 C++ ARM64 build tools (Latest + Spectre) (X64 and ARM64)
- Universal Windows platform support for v145 build tools (X64 and ARM64)
- MSVC v145 - VS 2026 C++ ARM64 build tools (Latest + Spectre) (X64 and ARM64)
- C++ core features
- C++ ATL for latest v143 tools (X64 and ARM64)
- C++ ATL for latest v145 tools (X64 and ARM64)
- C++ Clang compiler for Windows
- .NET desktop development
- .NET WinUI app development tools
Expand Down
6 changes: 4 additions & 2 deletions .pipelines/build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ jobs:
workingDirectory: "."
cmakeArgs: . --fresh -A ${{ parameters.platform }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_VERSION=10.0.26100.0 -DPACKAGE_VERSION=$(version.WSL_PACKAGE_VERSION) -DWSL_NUGET_PACKAGE_VERSION=$(version.WSL_NUGET_PACKAGE_VERSION) -DSKIP_PACKAGE_SIGNING=${{ parameters.isRelease }} -DOFFICIAL_BUILD=${{ parameters.isRelease }} -DINCLUDE_PACKAGE_STAGE=${{ or(parameters.isRelease, parameters.isNightly) }} -DPIPELINE_BUILD_ID=$(Build.BuildId) -DVSO_ORG=${{ parameters.vsoOrg }} -DVSO_PROJECT=${{ parameters.vsoProject }} -DWSL_BUILD_WSL_SETTINGS=true -DWSL_INCLUDE_SDK_CSHARP=true $(packageInputDirArg)\${{ parameters.platform }}

# Workaround for WSL Settings NuGet restore authentication issue
- script: _deps\nuget.exe restore -NonInteractive
# Workaround for WSL Settings NuGet restore authentication issue.
# Pass -SolutionDirectory since the VS2026 generator emits wsl.slnx (not wsl.sln),
# which NuGet 5.10 cannot auto-detect to locate the packages folder.
- script: _deps\nuget.exe restore -SolutionDirectory . -NonInteractive

- ${{ each target in parameters.targets }}:
- script: cmake --build . --config Release --target ${{ target.target }} -- -m
Expand Down
6 changes: 3 additions & 3 deletions .pipelines/wsl-build-nightly-onebranch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ schedules:
always: true

variables:
WindowsContainerImage: "onebranch.azurecr.io/windows/ltsc2022/vse2022:latest"
WindowsHostVersion: '1ESWindows2022'
WindowsContainerImage: "onebranch.azurecr.io/windows/ltsc2025/vse2026:latest"

resources:
repositories:
Expand All @@ -26,7 +25,8 @@ extends:
name: "windows_undocked"
featureFlags:
EnableCDPxPAT: false
WindowsHostVersion: 1ESWindows2022
WindowsHostVersion:
Version: 2025
globalSdl:
credscan:
enabled: true
Expand Down
6 changes: 3 additions & 3 deletions .pipelines/wsl-build-pr-onebranch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ trigger:
- release/*

variables:
WindowsContainerImage: "onebranch.azurecr.io/windows/ltsc2022/vse2022:latest"
WindowsHostVersion: '1ESWindows2022'
WindowsContainerImage: "onebranch.azurecr.io/windows/ltsc2025/vse2026:latest"

Comment thread
benhillis marked this conversation as resolved.
resources:
repositories:
Expand All @@ -22,7 +21,8 @@ extends:
name: "windows_undocked"
featureFlags:
EnableCDPxPAT: false
WindowsHostVersion: 1ESWindows2022
WindowsHostVersion:
Version: 2025
globalSdl:
suppression:
suppressionFile: $(Build.SourcesDirectory)\.gdnsuppress
Expand Down
6 changes: 3 additions & 3 deletions .pipelines/wsl-build-release-onebranch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ trigger:
include: ['*.*.*']

variables:
WindowsContainerImage: "onebranch.azurecr.io/windows/ltsc2022/vse2022:latest"
WindowsHostVersion: '1ESWindows2022'
WindowsContainerImage: "onebranch.azurecr.io/windows/ltsc2025/vse2026:latest"

resources:
repositories:
Expand All @@ -41,7 +40,8 @@ extends:
name: "windows_undocked"
featureFlags:
EnableCDPxPAT: false
WindowsHostVersion: 1ESWindows2022
WindowsHostVersion:
Version: 2025
globalSdl:
credscan:
enabled: true
Expand Down
1 change: 1 addition & 0 deletions .vsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"Microsoft.VisualStudio.Component.VC.ATL.Spectre",
"Microsoft.VisualStudio.Component.VC.ATL.ARM64.Spectre",
"Microsoft.VisualStudio.Component.VC.Llvm.Clang",
"Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset",
"Microsoft.VisualStudio.Component.Windows11SDK.26100",
"Microsoft.VisualStudio.Component.UWP.VC.ARM64",
"Microsoft.VisualStudio.Workload.ManagedDesktop",
Expand Down
16 changes: 2 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,7 @@ else()
endif()

# Determine the Visual Studio installation directory which contains LLVM tools.
# Supported versions: VS2022 and VS2026.
# Prefer VS2022 to keep local clang-format output aligned with pipeline expectations.
# Supported version: VS2026.
function(find_vs_install_dir VERSION_RANGE OUTPUT_VAR)
Comment thread
benhillis marked this conversation as resolved.
execute_process(
COMMAND "${VSWHERE_SOURCE_DIR}/vswhere.exe" -version "${VERSION_RANGE}" -products * -requires Microsoft.VisualStudio.Component.VC.Llvm.Clang -property installationPath -prerelease -latest
Expand All @@ -380,23 +379,12 @@ function(find_vs_install_dir VERSION_RANGE OUTPUT_VAR)
set(${OUTPUT_VAR} "${_vs_install_dir}" PARENT_SCOPE)
endfunction()

find_vs_install_dir("[17.0,18.0)" VS_INSTALL_DIR)

if (NOT VS_INSTALL_DIR)
find_vs_install_dir("[18.0,19.0)" VS_INSTALL_DIR)
if (VS_INSTALL_DIR)
message(WARNING "Visual Studio 2022 was not found; using Visual Studio 2026 instead. clang-format output may differ from pipeline expectations.")
endif()
endif()
find_vs_install_dir("[18.0,19.0)" VS_INSTALL_DIR)

if (NOT VS_INSTALL_DIR)
message(FATAL_ERROR "Could not determine Visual Studio installation directory.")
endif()

# Pick the first line returned from vswhere, in case multiple versions are returned.
# TODO: Remove this and require VS 2026 once the CI supports it.
string(REGEX MATCH "([^\n\r]+)" VS_INSTALL_DIR "${VS_INSTALL_DIR}")

if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "AMD64")
set(LLVM_INSTALL_DIR "${VS_INSTALL_DIR}/VC/Tools/Llvm/x64/bin")
else()
Expand Down
2 changes: 1 addition & 1 deletion doc/docs/api-reference/csharp/core-classes/session.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Authenticates to a registry and returns an identity token string.
string token = session.Authenticate(
new Uri("https://registry.example.com"),
"user1",
"p@ssw0rd");
"<password>");
```

## Session.GetImages()
Expand Down
6 changes: 3 additions & 3 deletions doc/docs/dev-loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ All prerequisites can be installed automatically by running:
tools\setup-dev-env.ps1
```

This uses [WinGet Configuration](https://learn.microsoft.com/windows/package-manager/configuration/) to install Developer Mode, CMake, Visual Studio 2022, and the required workloads from [`.vsconfig`](https://github.com/microsoft/WSL/blob/master/.vsconfig). If VS 2022 is already installed, the script detects your edition (Community, Professional, or Enterprise) and uses the matching configuration. If no VS 2022 is found, it defaults to Community.
This uses [WinGet Configuration](https://learn.microsoft.com/windows/package-manager/configuration/) to install Developer Mode, CMake, Visual Studio 2026, and the required workloads from [`.vsconfig`](https://github.com/microsoft/WSL/blob/master/.vsconfig). If VS 2026 is already installed, the script detects your edition (Community, Professional, or Enterprise) and uses the matching configuration. If no VS 2026 is found, it defaults to Community.

You can also run a WinGet configuration directly for your edition:

Expand All @@ -28,9 +28,9 @@ If you prefer to install prerequisites manually:

- CMake >= 3.25
- Can be installed with `winget install Kitware.CMake`
- Visual Studio 2022 with the required components:
- Visual Studio 2026 with the required components:
- Use VS Installer → More → Import configuration and select [`.vsconfig`](https://github.com/microsoft/WSL/blob/master/.vsconfig)
- Or: `winget install Microsoft.VisualStudio.2022.Community --override "--wait --quiet --config .vsconfig"`
- Or: `winget install Microsoft.VisualStudio.Community --override "--wait --quiet --config .vsconfig"`
- Enable [Developer Mode](https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development) in Windows Settings, or run builds with Administrator privileges (required for symbolic link support)

</details>
Expand Down
4 changes: 2 additions & 2 deletions doc/samples/WSLC-HelloWorld/WSLCHelloWorld.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.37027.9 d17.14
# Visual Studio Version 18
VisualStudioVersion = 18.7.11903.348
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WSLCHelloWorld", "WSLCHelloWorld.vcxproj", "{2B5C2E11-2C0A-4F1B-9F3D-7E8A1C2D3E4F}"
EndProject
Expand Down
2 changes: 1 addition & 1 deletion doc/samples/WSLC-HelloWorld/WSLCHelloWorld.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<VCProjectVersion>18.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{2B5C2E11-2C0A-4F1B-9F3D-7E8A1C2D3E4F}</ProjectGuid>
<RootNamespace>WSLCHelloWorld</RootNamespace>
Expand Down
4 changes: 2 additions & 2 deletions doc/samples/WSLC-Neofetch/WSLCNeofetch.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.37027.9 d17.14
# Visual Studio Version 18
VisualStudioVersion = 18.7.11903.348
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WSLCNeofetch", "WSLCNeofetch.vcxproj", "{35158918-896E-42B7-B4E8-CF98816259AA}"
EndProject
Expand Down
2 changes: 1 addition & 1 deletion doc/samples/WSLC-Neofetch/WSLCNeofetch.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<VCProjectVersion>18.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{35158918-896e-42b7-b4e8-cf98816259aa}</ProjectGuid>
<RootNamespace>WSLCNeofetch</RootNamespace>
Expand Down
15 changes: 7 additions & 8 deletions src/linux/init/GnsEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,8 @@ void GnsEngine::ProcessNotification(const nlohmann::json& payload, Interface& in
break;

default:
throw RuntimeErrorWithSourceLocation(std::format(
"Unexpected LxGnsMessageNotification for interfaceName {}: {}", interface.Name(), payload["ResourceType"].get<std::string>()));
break;
throw RuntimeErrorWithSourceLocation(
std::format("Unexpected LxGnsMessageNotification for interfaceName {}: {}", interface.Name(), payload["ResourceType"].get<std::string>()));
}
}

Expand Down Expand Up @@ -573,8 +572,9 @@ std::tuple<bool, int> GnsEngine::ProcessNextMessage(wsl::shared::Transaction& tr
auto table = manager.FindRoutingTableIdForInterface(interface);
if (!table.has_value())
{
throw RuntimeErrorWithSourceLocation(std::format(
"LxGnsMessageInitialIpConfigurationNotification: failed to find routing table with name {}", interface.Name()));
throw RuntimeErrorWithSourceLocation(
std::format(
"LxGnsMessageInitialIpConfigurationNotification: failed to find routing table with name {}", interface.Name()));
}

GNS_LOG_INFO(
Expand Down Expand Up @@ -706,9 +706,8 @@ std::tuple<bool, int> GnsEngine::ProcessNextMessage(wsl::shared::Transaction& tr
break;
}
default:
throw RuntimeErrorWithSourceLocation(std::format(
"Unexpected Wslcore::Networking::OperationType : {}", static_cast<int>(interfaceNetFilterRequest.operation)));
break;
throw RuntimeErrorWithSourceLocation(
std::format("Unexpected Wslcore::Networking::OperationType : {}", static_cast<int>(interfaceNetFilterRequest.operation)));
}
Comment thread
benhillis marked this conversation as resolved.
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/linux/netlinkutil/Address.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ Address Address::FromPrefixString(int family, const std::string& prefix)
int err = inet_pton(family, match.str(1).c_str(), &tmpAddr);
if (err != 1)
{
throw RuntimeErrorWithSourceLocation(std::format(
"Parsed invalid address ({}) from prefix: {} and family: {} with error {} and errno {}", match.str(1), prefix, family, err, errno));
throw RuntimeErrorWithSourceLocation(
std::format("Parsed invalid address ({}) from prefix: {} and family: {} with error {} and errno {}", match.str(1), prefix, family, err, errno));
}

return Address{family, std::stoul(match.str(2)), match.str(1)};
Expand Down
5 changes: 3 additions & 2 deletions src/shared/inc/SocketChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,9 @@ class SocketChannel
auto io = CreateIO();

gsl::span<gsl::byte> message;
io.AddHandle(std::make_unique<windows::common::io::ReadSocketMessageHandle>(
m_socket.get(), m_buffer, m_pendingBytes, [&message](auto& received) { message = received; }));
io.AddHandle(
std::make_unique<windows::common::io::ReadSocketMessageHandle>(
m_socket.get(), m_buffer, m_pendingBytes, [&message](auto& received) { message = received; }));

io.Run(TimeoutToMilliseconds(timeout));

Expand Down
10 changes: 6 additions & 4 deletions src/windows/common/NatNetworking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,9 @@ void NatNetworking::Initialize()

if (!m_config.NatIpAddress.empty())
{
EMIT_USER_WARNING(wsl::shared::Localization::MessageFailedToCreateNetworkEndpoint(
m_config.NatIpAddress.c_str(), endpointProperties.IPAddress.c_str()));
EMIT_USER_WARNING(
wsl::shared::Localization::MessageFailedToCreateNetworkEndpoint(
m_config.NatIpAddress.c_str(), endpointProperties.IPAddress.c_str()));
}

// Record the new IP address associated to the endpoint.
Expand Down Expand Up @@ -671,8 +672,9 @@ wsl::windows::common::hcs::unique_hcn_network NatNetworking::CreateNetwork(wsl::
// Note that the firewall config is NOT cleared here as we MUST always configure firewall if it has been requested
natNetwork = CreateNetworkInternal(config);

EMIT_USER_WARNING(wsl::shared::Localization::MessageFailedToCreateNetwork(
previousRange.c_str(), config.NatNetwork.c_str(), wsl::windows::common::wslutil::GetSystemErrorString(error).c_str()));
EMIT_USER_WARNING(
wsl::shared::Localization::MessageFailedToCreateNetwork(
previousRange.c_str(), config.NatNetwork.c_str(), wsl::windows::common::wslutil::GetSystemErrorString(error).c_str()));
}
});

Expand Down
10 changes: 6 additions & 4 deletions src/windows/common/SubProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,9 @@ SubProcess::ProcessOutput SubProcess::RunAndCaptureOutput(DWORD Timeout, HANDLE
std::string stdoutNative;
std::string stderrNative;

io.AddHandle(std::make_unique<io::ReadHandle>(
std::move(stdoutRead), [&](const gsl::span<char>& buffer) { stdoutNative.append(buffer.data(), buffer.size()); }));
io.AddHandle(std::make_unique<io::ReadHandle>(std::move(stdoutRead), [&](const gsl::span<char>& buffer) {
stdoutNative.append(buffer.data(), buffer.size());
}));

wil::unique_hfile stderrWrite;
if (StdErr == nullptr)
Expand All @@ -257,8 +258,9 @@ SubProcess::ProcessOutput SubProcess::RunAndCaptureOutput(DWORD Timeout, HANDLE

m_stdErr = stderrWrite.get();

io.AddHandle(std::make_unique<io::ReadHandle>(
std::move(stderrRead), [&](const gsl::span<char>& buffer) { stderrNative.append(buffer.data(), buffer.size()); }));
io.AddHandle(std::make_unique<io::ReadHandle>(std::move(stderrRead), [&](const gsl::span<char>& buffer) {
stderrNative.append(buffer.data(), buffer.size());
}));
}
else
{
Expand Down
5 changes: 3 additions & 2 deletions src/windows/common/WslCoreConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ void wsl::core::Config::ParseConfigFile(_In_opt_ LPCWSTR ConfigFilePath, _In_opt
LOG_WIN32_MSG(error, "opening config file failed");
if (error != ERROR_FILE_NOT_FOUND)
{
EMIT_USER_WARNING(wsl::shared::Localization::MessageFailedToOpenConfigFile(
ConfigFilePath, wsl::windows::common::wslutil::GetErrorString(HRESULT_FROM_WIN32(error))));
EMIT_USER_WARNING(
wsl::shared::Localization::MessageFailedToOpenConfigFile(
ConfigFilePath, wsl::windows::common::wslutil::GetErrorString(HRESULT_FROM_WIN32(error))));
}
}
}
Expand Down
Loading
Loading