Skip to content

[wasm] Set flutter_runtime_mode in tools/gn to_gn_wasm_args #193406

Closed

Description

@kevmoo

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

  1. Execute engine/src/flutter/tools/gn --web --runtime-mode=release
  2. Search out/wasm_release/args.gn or 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)

Activity

  1. added
    in triagePresently being triaged by the triage team
    engineflutter/engine related. See also e: labels.
    fyi-engineFor the attention of Engine team
    team-webOwned by Web platform team
    and removed
    in triagePresently being triaged by the triage team
    on Sep 28, 2026
  2. added
    P2Important issues not at the top of the work list
    and removed
    engineflutter/engine related. See also e: labels.
    fyi-engineFor the attention of Engine team
    on Sep 28, 2026
  3. gaaclarke commented on Sep 28, 2026

    @gaaclarke
    Member

    Moving to us since it has to do with impeller compilation.

  4. github-actions commented on Oct 15, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listteam-engineOwned by Engine teamteam-webOwned by Web platform teamtriaged-engineTriaged by Engine team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions