[wasm] Set flutter_runtime_mode in tools/gn to_gn_wasm_args
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- wasm
- Domain
- build-system
Research direction
Start in engine/src/flutter/tools/gn, specifically the to_gn_wasm_args function, and run engine/src/flutter/tools/gn --web --runtime-mode=release. Inspect out/wasm_release/args.gn to verify how flutter_runtime_mode is evaluated. Done means the release argument is reflected as "release" for Wasm targets instead of defaulting to "debug".
Written by the indexing model from the issue text.
Description
Summary
The engine/src/flutter/tools/gn build script ignores the --runtime-mode argument for WebAssembly (--web / wasm) targets. As a result, Wasm builds (including wasm_release / skwasm / Web Impeller) implicitly evaluate flutter_runtime_mode as "debug" globally inside GN even when --runtime-mode=release is passed.
For Web Impeller (Wimp), this evaluates impeller_debug = true (IMPELLER_DEBUG=1), causing debug tracing mechanisms (such as RenderPassGLES::EncodeCommandsInReactor executing synchronous gl.CheckFramebufferStatusDebug(GL_FRAMEBUFFER) 50+ times per frame) to pollute release artifacts and cause severe frame-bound GPU stalls in release Wimp targets.
Steps to Reproduce
- Execute
engine/src/flutter/tools/gn --web --runtime-mode=release - Search
out/wasm_release/args.gnor inspect the GN evaluation tree.
Observed Behavior
flutter_runtime_mode defaults to "debug", activating IMPELLER_DEBUG=1.
Expected Behavior
flutter_runtime_mode evaluates to "release", de-activating IMPELLER_DEBUG and yielding an optimized Wasm payload free of synchronous GL verification commands.
Environment / Target
- Target OS:
wasm(--web/wimp/skwasm) - Build Script:
engine/src/flutter/tools/gn(to_gn_wasm_args)
- Dominant language
- Dart
- Stars
- 179k
- Forks
- 31.7k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 396
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from flutter/flutter
-
waiting for response
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
flutter/flutter#193333 · 1 comment ·
Maintainers usually reply within 1 day
-
team-infra
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
team-infra
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
p: image_picker package platform-android team-android
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
flutter/flutter#193036 · 1 comment ·
Maintainers usually reply within 1 day
-
waiting for response
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
flutter/flutter#192987 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
MaikuB/flutter_local_notifications#2838 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
jiangtian616/JHenTai#833 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100