fix(windows): unblock release build on MSVC 14.51 coroutine hard error - #97
Open
ByYudkowskysTentacle wants to merge 2 commits into
Open
fix(windows): unblock release build on MSVC 14.51 coroutine hard error#97ByYudkowskysTentacle wants to merge 2 commits into
ByYudkowskysTentacle wants to merge 2 commits into
Conversation
`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
Owner
|
Book download tested? so downloading of books is working? |
Author
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). |
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
flutter build windows --releasefails onwindows-latest. Android, iOS and Linux are unaffected.Failing projects:
flutter_inappwebview_windows_pluginandpermission_handler_windows_plugin.MSVC 14.51 (Visual Studio 2026) promoted the
<experimental/coroutine>deprecation from a warning to a hardstatic_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_windowscompiles as C++17, so__cpp_lib_coroutineis undefined and<winrt/base.h>falls back to<experimental/coroutine>.permission_handler_windowsbuilds 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 byflutter pub get.Fix
One line in
windows/CMakeLists.txt, beside the existingadd_definitions(-DUNICODE -D_UNICODE):add_definitionssets a directory property that subdirectories inherit when they're added, and the plugins are added further down viainclude(flutter/generated_plugins.cmake). Setting it here reaches each plugin target, includingflutter_inappwebview_windows, which does not callapply_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, matchingBINARY_NAME. They previously saidOpenLibExtended.exe; NTFS resolved that case-insensitively, but this seemed like a better-safe-than-sorry situation.Testing
windows-latest, Flutter 3.38.6, MSVC 14.51.36231openlib-windows-x64-1.0.11.exe; the bundle contains all five plugin DLLs plusWebview2Loader.dllNo new dependencies, no app code touched. 2 files changed, +13 −3.