fix(windows): silence experimental/coroutine deprecation (STL1011)#147
Merged
Conversation
New MSVC toolchains on the GitHub Windows runner (VS 18 / MSVC 14.51) promote the <experimental/coroutine> deprecation to a hard error (C2338 / STL1011). Plugins audioplayers_windows, permission_handler_windows and flutter_local_notifications_windows still include that header, breaking the Windows build leg of CI — which in turn skips the gated Google Play deploy job. Define _SILENCE_EXPERIMENTAL_COROUTINE_DEPRECATION_WARNINGS project-wide so it propagates to all targets and plugin subdirectories. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The suppression macro is MSVC/MSVC-STL-specific; wrapping it in an if(MSVC) block makes the intent explicit and follows idiomatic CMake practice. https://claude.ai/code/session_01GgBCj6SCcnzXL7rhZX75eR
Contributor
Author
Code Review —
|
| # | Severity | Finding | Status |
|---|---|---|---|
| 1 | Low | add_compile_definitions() was unconditional — _SILENCE_EXPERIMENTAL_COROUTINE_DEPRECATION_WARNINGS is an MSVC/MSVC-STL–specific macro; other Windows compilers (Clang-CL, hypothetical MinGW) ignore it silently but the intent was unclear |
Fixed in follow-up commit |
| 2 | Info | add_definitions(-DUNICODE -D_UNICODE) immediately above uses the legacy CMake API; the new line correctly uses the modern add_compile_definitions(). The inconsistency is pre-existing Flutter template code — left unchanged. |
No action needed |
| 3 | Info | No unit/widget tests are applicable to a build-system change. The Windows CI build leg is the correct verification mechanism, as noted in the PR description. | No action needed |
Fix applied
Wrapped the suppression in if(MSVC) … endif() (d968057):
if(MSVC)
add_compile_definitions(_SILENCE_EXPERIMENTAL_COROUTINE_DEPRECATION_WARNINGS)
endif()This is purely a clarity/idiom improvement — windows/CMakeLists.txt is MSVC-only in practice and the define is harmless on other compilers — but it documents intent and is the conventional CMake pattern for compiler-specific flags.
Generated by Claude Code
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
The latest Release run failed at CI / Build Windows, which (being gated) skipped the Google Play deploy job and blocked the Play release.
The GitHub Windows runner image updated to a new MSVC toolchain (VS 18 / MSVC 14.51). That compiler promotes the
<experimental/coroutine>deprecation to a hard error (C2338/STL1011). Three Flutter plugins still include that header and fail to compile:audioplayers_windowspermission_handler_windowsflutter_local_notifications_windowsThis is an upstream toolchain regression, not a code change in this repo.
Fix
Add
_SILENCE_EXPERIMENTAL_COROUTINE_DEPRECATION_WARNINGSas a project-wide compile definition inwindows/CMakeLists.txt, alongside the existingUNICODEdefinition, so it propagates to all targets and plugin subdirectories.Verification
Can't build Windows on the maintainer's macOS 13 machine; this is the standard MSVC-recommended remedy for STL1011. The Windows build leg of the Release run will confirm.
🤖 Generated with Claude Code