Skip to content

Bump Linux SDK to 1.23.0 and guard char->wide formatters to Windows#41071

Merged
benhillis merged 1 commit into
microsoft:masterfrom
benhillis:linuxsdk-1.23-formatter-guard
Jul 22, 2026
Merged

Bump Linux SDK to 1.23.0 and guard char->wide formatters to Windows#41071
benhillis merged 1 commit into
microsoft:masterfrom
benhillis:linuxsdk-1.23-formatter-guard

Conversation

@benhillis

Copy link
Copy Markdown
Member

Summary

The new Linux SDK (1.23.0) ships libc++ 21, which now provides deleted std::formatter specializations for char -> wchar_t cross-encoding formatting per C++23 [format.formatter.spec]. Our own char->wide specializations in stringshared.h collide with those when building the Linux components, causing redefinition errors.

These specializations are only used by the Windows components (MSVC leaves the primary formatter template deleted-but-undefined, so our specializations are legal there and are relied upon). This change restricts them to #ifdef WIN32, which resolves the collision on Linux while leaving Windows behavior unchanged.

Changes

  • Bump Microsoft.WSL.LinuxSdk 1.20.0 -> 1.23.0
  • Guard the char->wchar_t std::formatter specializations behind WIN32

… to Windows

The new Linux SDK ships libc++ 21, which provides deleted std::formatter
specializations for char->wchar_t cross-encoding formatting per C++23
[format.formatter.spec]. Our own specializations collide with those on the
Linux components. Restrict them to WIN32, where MSVC needs them and does not
define the deleted specializations.
Copilot AI review requested due to automatic review settings July 13, 2026 21:57
@benhillis
benhillis requested a review from a team as a code owner July 13, 2026 21:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the repo’s Linux SDK dependency to Microsoft.WSL.LinuxSdk 1.23.0 (bringing in libc++ 21) and resolves a Linux build break by limiting WSL’s charwchar_t std::formatter specializations to Windows-only builds, avoiding collisions with libc++’s C++23 deleted cross-encoding specializations.

Changes:

  • Bump Microsoft.WSL.LinuxSdk from 1.20.0 to 1.23.0 in packages.config.
  • Wrap std::formatter<..., wchar_t> specializations for char*/const char*/char[N]/std::basic_string<char,...> in #ifdef WIN32 to prevent libc++ redefinition conflicts.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/shared/inc/stringshared.h Restricts charwchar_t formatter specializations to Windows to avoid libc++ collision when building Linux components.
packages.config Updates Microsoft.WSL.LinuxSdk package version to 1.23.0.

}
};

// char -> wchar_t formatting is only used by the Windows components. libc++ (used to

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sad to learn about this, but I guess this will be a problem for later

@benhillis
benhillis merged commit d4a5b2c into microsoft:master Jul 22, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants