Skip to content

fix(windows): silence experimental/coroutine deprecation (STL1011)#147

Merged
krazyjakee merged 2 commits into
masterfrom
fix/windows-coroutine-deprecation
Jun 15, 2026
Merged

fix(windows): silence experimental/coroutine deprecation (STL1011)#147
krazyjakee merged 2 commits into
masterfrom
fix/windows-coroutine-deprecation

Conversation

@krazyjakee

Copy link
Copy Markdown
Contributor

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_windows
  • permission_handler_windows
  • flutter_local_notifications_windows

This is an upstream toolchain regression, not a code change in this repo.

Fix

Add _SILENCE_EXPERIMENTAL_COROUTINE_DEPRECATION_WARNINGS as a project-wide compile definition in windows/CMakeLists.txt, alongside the existing UNICODE definition, 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

krazyjakee and others added 2 commits June 15, 2026 10:42
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

Copy link
Copy Markdown
Contributor Author

Code Review — fix(windows): silence experimental/coroutine deprecation (STL1011)

Overall: The fix is correct and minimal. add_compile_definitions() at directory scope before all add_subdirectory() / include() calls propagates the define to the Flutter-managed subdirectories and generated plugin subdirectories, which is exactly what's needed. The root cause analysis in the PR description is accurate (MSVC 14.51 promoting STL1011 to C2338 hard error).


Findings, ranked by severity

# 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

@krazyjakee krazyjakee merged commit 62f45b1 into master Jun 15, 2026
3 checks passed
@krazyjakee krazyjakee deleted the fix/windows-coroutine-deprecation branch June 15, 2026 09:49
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.

2 participants