Fix Windows CI: suppress MSVC C4875 from GSL on VS2026 toolset#191
Closed
bkaradzic-microsoft wants to merge 1 commit into
Closed
Fix Windows CI: suppress MSVC C4875 from GSL on VS2026 toolset#191bkaradzic-microsoft wants to merge 1 commit into
bkaradzic-microsoft wants to merge 1 commit into
Conversation
The windows-2025 runner image was updated to a VS2026 toolset whose MSVC emits C4875 (a non-string literal argument to [[gsl::suppress]] is deprecated). This warning comes from the GSL headers pulled in transitively via arcana.cpp, not from our code, and the /WX warnings_as_errors builds promote it to an error, breaking every Windows/UWP build repo-wide. Suppress C4875 for MSVC so third-party header deprecations don't fail our builds, mirroring the existing /wd5205 (WinRT) suppression in CMakeExtensions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Suppresses a new MSVC warning (C4875) introduced by newer Visual Studio toolsets that is emitted from inside the GSL headers (transitively via arcana.cpp) and is currently breaking Windows/UWP builds due to /WX.
Changes:
- Add an MSVC-only global compile option to disable warning C4875 (
/wd4875). - Document why the suppression is needed (third-party header deprecation promoted to error under
/WX).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
Closed in favor of #192, which pins Windows CI to windows-2022 (VS2022). That keeps us on the known-good toolset and avoids C4875 entirely, so this /wd4875 suppression isn't needed. |
bkaradzic-microsoft
added a commit
that referenced
this pull request
Jun 9, 2026
## Problem Every Windows/UWP build is failing. GitHub repointed the `windows-latest` label to a **VS2026** toolset (internal image `windows-2025-vs2026`). Its newer MSVC emits **C4875** (`a non-string literal argument to [[gsl::suppress]] is deprecated`) from inside the GSL headers we pull transitively via `arcana.cpp`, and our `/WX` builds promote it to a hard error. ## Fix Pin the Win32 and UWP jobs to the **windows-2022** runner, which still provides the established VS2022 toolset that doesn't emit C4875. This restores green CI with no source or dependency-graph change, and matches the approach taken in BabylonNative (BabylonJS/BabylonNative#1742). (Originally proposed as a GSL v4.2.2 bump / `/wd4875` suppression — see the closed #191 — but pinning the runner is the smaller, decoupled fix and keeps us on the known-good toolchain.) ## Validation CI on this branch confirms the Win32/UWP builds are green again on windows-2022. Co-authored-by: Branimir Karadžić <branimirk@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every Windows and UWP build is currently failing, e.g. in #190 and any new PR:
This is not caused by any source change. The GitHub-hosted
windows-2025runner image was repointed to a VS2026 toolset (internal image namewindows-2025-vs2026) between Jun 5 and Jun 9. Its newer MSVC introduces C4875 for the[[gsl::suppress]]attribute taking a non-string-literal argument — emitted from inside the GSL headers that we pull in transitively viaarcana.cpp. Because ourwarnings_as_errorsbuilds compile with/WX, the deprecation is promoted to a hard error and breaks every Windows/UWP target.Evidence it's the image, not the code:
windows-2025mainlast greenwindows-2025(VS2025)windows-2025-vs2026(VS2026)The failing targets (
arcana,AppRuntime,WebSocket,ScriptLoader, …) are unrelated to each other; the only common factor is GSL +/WX.Fix
Suppress C4875 for MSVC at the top of the build. The warning is a deprecation inside a third-party header we don't control, so there's nothing to fix in our own code. This mirrors the existing
/wd5205(WinRT) suppression already present inwarnings_as_errorsin CMakeExtensions.Validation
gsl/util(via arcana), not our sources./wd4875is a valid, accepted MSVC option (noD9002).