Skip to content

fix(windows): unblock release build on MSVC 14.51 coroutine hard error - #97

Open
ByYudkowskysTentacle wants to merge 2 commits into
warreth:mainfrom
ByYudkowskysTentacle:main
Open

fix(windows): unblock release build on MSVC 14.51 coroutine hard error#97
ByYudkowskysTentacle wants to merge 2 commits into
warreth:mainfrom
ByYudkowskysTentacle:main

Conversation

@ByYudkowskysTentacle

@ByYudkowskysTentacle ByYudkowskysTentacle commented Aug 25, 2026

Copy link
Copy Markdown

Problem

flutter build windows --release fails on windows-latest. Android, iOS and Linux are unaffected.

...\MSVC\14.51.36231\include\experimental\coroutine(37,1): error C2338:
static assertion failed: 'error STL1011: The /await compiler option,
<experimental/coroutine>, <experimental/generator>, and <experimental/resumable>
are deprecated by Microsoft and will be REMOVED SOON. ... You can define
_SILENCE_EXPERIMENTAL_COROUTINE_DEPRECATION_WARNINGS to suppress this error for now.'

Failing projects: flutter_inappwebview_windows_plugin and permission_handler_windows_plugin.

MSVC 14.51 (Visual Studio 2026) promoted the <experimental/coroutine> deprecation from a warning to a hard static_assert. This is a toolchain change on the hosted runner, so the build broke with no code change in the repo.

Why those two plugins

Both reach the experimental header through C++/WinRT, for different reasons:

  • flutter_inappwebview_windows compiles as C++17, so __cpp_lib_coroutine is undefined and <winrt/base.h> falls back to <experimental/coroutine>.
  • permission_handler_windows builds with /await, which selects the pre-C++20 coroutine machinery outright.

Neither is patchable in-repo: both live under windows/flutter/ephemeral/.plugin_symlinks/ and are regenerated by flutter pub get.

Fix

One line in windows/CMakeLists.txt, beside the existing add_definitions(-DUNICODE -D_UNICODE):

add_definitions(-D_SILENCE_EXPERIMENTAL_COROUTINE_DEPRECATION_WARNINGS)

add_definitions sets a directory property that subdirectories inherit when they're added, and the plugins are added further down via include(flutter/generated_plugins.cmake). Setting it here reaches each plugin target, including flutter_inappwebview_windows, which does not call apply_standard_settings (it defines its own copy to drop /WX), so patching that function alone would miss it.

Also points the Inno Setup shortcuts at OpenlibExtended.exe, matching BINARY_NAME. They previously said OpenLibExtended.exe; NTFS resolved that case-insensitively, but this seemed like a better-safe-than-sorry situation.

Testing

  • Windows build succeeds on windows-latest, Flutter 3.38.6, MSVC 14.51.36231
  • Inno Setup produces openlib-windows-x64-1.0.11.exe; the bundle contains all five plugin DLLs plus Webview2Loader.dll
  • Installer run on Windows: app launches, webview and permission flows work, book download tested successfully

No new dependencies, no app code touched. 2 files changed, +13 −3.

claude and others added 2 commits August 25, 2026 23:06
`flutter build windows --release` failed on every attempt with STL1011:

  experimental/coroutine(37,1): error C2338: static assertion failed:
  'error STL1011: The /await compiler option, <experimental/coroutine>, ...
  are deprecated by Microsoft and will be REMOVED SOON.'

MSVC 14.51 (Visual Studio 2026) promoted that deprecation to a hard
static_assert. Two plugins still reach the experimental header through
C++/WinRT:

  - flutter_inappwebview_windows compiles as C++17, so __cpp_lib_coroutine
    is undefined and <winrt/base.h> falls back to <experimental/coroutine>.
  - permission_handler_windows builds with /await, which selects the
    experimental coroutine machinery outright.

Neither plugin is editable here; both are regenerated under
flutter/ephemeral/.plugin_symlinks by `flutter pub get`. The opt-out
Microsoft documents in the error is therefore set at the top of the
app-level windows/CMakeLists.txt, ahead of the plugin subdirectories, so
it propagates to every plugin target -- including
flutter_inappwebview_windows, which deliberately does not call
apply_standard_settings.

Also point the Inno Setup shortcuts at the binary CMake actually emits
(BINARY_NAME is "OpenlibExtended"). NTFS resolved the old casing
case-insensitively, so this was latent rather than fatal.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XT2zu1qt8pzup93eT2FyG9
…e-cmake-hpj92v

fix(windows): unblock release build on MSVC 14.51 coroutine hard error
@warreth

warreth commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Book download tested? so downloading of books is working?

@ByYudkowskysTentacle

Copy link
Copy Markdown
Author

Book download tested? so downloading of books is working?

Yes! All tests downloaded successfully, whatever you did seems to be working on Windows. The user gets a pop-up with the page itself on search and on title-selection, so from a UX point of view that's not ideal, but it works, and that's an improvement over the last version. I can take a swing at resolving that if you'd like (though I am still only getting familiar with the codebase).

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