@samitouri / QOSAMI-WSL / commits / d4a5b2cc

Bump Microsoft.WSL.LinuxSdk to 1.23.0 and guard char->wide formatters to Windows (#41071)

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. Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

Ben Hillis committed Jul 22, 2026 at 12:43 UTC d4a5b2cc34d9689c63370d5e111a05875cb9d0e8
2 files changed +8 -1
packages.config
+1 -1
@@ -21,7 +21,7 @@
21 <package id="Microsoft.WSL.Dependencies.arm64fre" version="10.0.27820.1000-250318-1700.rs-base2-hyp" targetFramework="native" />
22 <package id="Microsoft.WSL.DeviceHost" version="1.2.53-0" />
23 <package id="Microsoft.WSL.Kernel" version="6.18.35.2-1" targetFramework="native" />
24 - <package id="Microsoft.WSL.LinuxSdk" version="1.20.0" targetFramework="native" />
24 + <package id="Microsoft.WSL.LinuxSdk" version="1.23.0" targetFramework="native" />
25 <package id="Microsoft.WSL.TestData" version="0.5.0" />
26 <package id="Microsoft.WSL.TestDistro" version="2.7.1-1" />
27 <package id="Microsoft.WSLg" version="1.0.79" />
src/shared/inc/stringshared.h
+7
@@ -931,6 +931,11 @@ struct std::formatter<std::source_location, wchar_t>
931 }
932 };
933
934 +// char -> wchar_t formatting is only used by the Windows components. libc++ (used to
935 +// build the Linux components) now provides these as deleted specializations per C++23
936 +// [format.formatter.spec], which would collide, so restrict them to Windows.
937 +#ifdef WIN32
938 +
939 template <>
940 struct std::formatter<char*, wchar_t>
941 {
@@ -995,6 +1000,8 @@ struct std::formatter<std::basic_string<char, Traits, Allocator>, wchar_t>
1000 }
1001 };
1002
1003 +#endif // WIN32
1004 +
1005 template <>
1006 struct std::formatter<std::filesystem::path, wchar_t>
1007 {