Sitelet https://github.com/flutter/flutter/pull/190475
Skip to content

fix(tool): remove redundant --enable-experiment=record-use flag - #190475

Merged
auto-submit[bot] merged 1 commit into
flutter:masterfrom
kevmoo:issue-190465
Aug 4, 2026
Merged

auto-submit[bot] merged 1 commit into
flutter:masterfrom
kevmoo:issue-190465

Conversation

@kevmoo

@kevmoo kevmoo commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

When compiling web targets (dart2js and dart2wasm) or running dry runs with the record-use feature flag enabled, flutter_tools explicitly passed --enable-experiment=record-use to the compiler. Since record-use is enabled by default in recent Dart SDKs, passing this flag caused warning spam during standard compilation and dry runs.

  • Remove --enable-experiment=record-use from Dart2JSTarget and Dart2WasmTarget in web.dart.
  • Remove expected flag from test commands in web_test.dart and web_dry_run_test.dart.

Fixes #190465

@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Aug 3, 2026
@kevmoo
kevmoo marked this pull request as ready for review August 3, 2026 21:49
@kevmoo
kevmoo requested a review from mdebbar August 3, 2026 21:49

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the "--enable-experiment=record-use" compiler flag from the Dart2JSTarget and Dart2WasmTarget build targets in the Flutter web build system. The corresponding unit and dry-run tests have been updated to reflect the removal of this flag. I have no feedback to provide.

@mdebbar mdebbar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to write a test that fails if dart2js or dart2wasm change the flag's default value in the future?

@kevmoo

kevmoo commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@mdebbar Yes, an existing integration test in flutter_tools already guards against this:

In test/integration.shard/isolated/record_use_flutter_build_test.dart, the test suite runs flutter config --enable-record-use in setup, then executes full end-to-end release compilation for both flutter build web --release (dart2js) and flutter build web --wasm --release (dart2wasm).

Because this PR removes --enable-experiment=record-use from Dart2JSTarget and Dart2WasmTarget, those end-to-end integration tests now execute without the experimental flag. If dart2js or dart2wasm ever revert or alter the default value of the experiment in the future (causing --write-resources or --recorded-uses to fail without the flag), this integration test will immediately fail during CI.

(Our standard unit tests in web_test.dart rely on FakeProcessManager and mocked command strings, so they only assert tool argument generation rather than real compiler binary execution.)

@kevmoo kevmoo added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 4, 2026
When compiling web targets (dart2js and dart2wasm) or running dry runs with the record-use feature flag enabled, flutter_tools explicitly passed --enable-experiment=record-use to the compiler. Since record-use is enabled by default in recent Dart SDKs, passing this flag caused warning spam during standard compilation and dry runs.

* Remove --enable-experiment=record-use from Dart2JSTarget and Dart2WasmTarget in web.dart.
* Remove expected flag from test commands in web_test.dart and web_dry_run_test.dart.

Fixes flutter#190465
@kevmoo kevmoo added the CICD Run CI/CD label Aug 4, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Aug 4, 2026
Merged via the queue into flutter:master with commit 89b263d Aug 4, 2026
23 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 4, 2026
@cbracken

cbracken commented Aug 4, 2026

Copy link
Copy Markdown
Member

Reason for revert: causes tool tests to fail

Mac_tool_tests_general:
https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20tool_tests_general/29148/overview
Log:

00:37 +2170 ~2 -1: test/general.shard/build_system/targets/web_test.dart: Dart2WasmTarget prints JS interop migration footer on dart:svg and dart:js_util failures [E]
  Expected: contains 'Failed to compile application for the Web.'
    Actual: 'Expected: [\n'
              '            \'Artifact.engineDartBinary.TargetPlatform.web_javascript\',\n'
              '            \'compile\',\n'
              '            \'wasm\',\n'
              '            \'--packages=/.dart_tool/package_config.json\',\n'
              '            \'--extra-compiler-option=--platform=HostArtifact.webPlatformKernelFolder/dart2wasm_platform.dill\',\n'
              '            \'-Ddart.vm.profile=true\',\n'
              '            \'-Ddart.vm.product=false\',\n'
              '            \'--extra-compiler-option=--delete-tostring-package-uri=dart:ui\',\n'
              '            \'--extra-compiler-option=--delete-tostring-package-uri=package:flutter\',\n'
              '            \'--extra-compiler-option=--import-shared-memory\',\n'
              '            \'--extra-compiler-option=--shared-memory-max-pages=32768\',\n'
              '            \'-DFLUTTER_WEB_USE_SKIA=false\',\n'
              '            \'-DFLUTTER_WEB_USE_SKWASM=true\',\n'
              '            \'-DFLUTTER_WEB_CANVASKIT_URL=[https://www.gstatic.com/flutter-canvaskit/abcdefghijklmnopqrstuvwxyz/\',\n](https://www.gstatic.com/flutter-canvaskit/abcdefghijklmnopqrstuvwxyz/%5c%27,%5cn)'
              '            \'--extra-compiler-option=--depfile=/foo/build/4cad087135d8491e96c66162902e85f9/dart2wasm.d\',\n'
              '            \'--recorded-uses=/foo/build/4cad087135d8491e96c66162902e85f9/recorded_uses_wasm.json\',\n'
              '            \'--enable-experiment=record-use\',\n'
              '            \'-O2\',\n'
              '            \'--no-strip-wasm\',\n'
              '            \'--no-source-maps\',\n'
              '            \'--no-minify\',\n'
              '            \'-o\',\n'
              '            \'/foo/build/4cad087135d8491e96c66162902e85f9/main.dart.wasm\',\n'
              '            \'/foo/build/4cad087135d8491e96c66162902e85f9/main.dart\'\n'
              '          ]\n'
              '  Actual: [\n'
              '            \'Artifact.engineDartBinary.TargetPlatform.web_javascript\',\n'
              '            \'compile\',\n'
              '            \'wasm\',\n'
              '            \'--packages=/.dart_tool/package_config.json\',\n'
              '            \'--extra-compiler-option=--platform=HostArtifact.webPlatformKernelFolder/dart2wasm_platform.dill\',\n'
              '            \'-Ddart.vm.profile=true\',\n'
              '            \'-Ddart.vm.product=false\',\n'
              '            \'--extra-compiler-option=--delete-tostring-package-uri=dart:ui\',\n'
              '            \'--extra-compiler-option=--delete-tostring-package-uri=package:flutter\',\n'
              '            \'--extra-compiler-option=--import-shared-memory\',\n'
              '            \'--extra-compiler-option=--shared-memory-max-pages=32768\',\n'
              '            \'-DFLUTTER_WEB_USE_SKIA=false\',\n'
              '            \'-DFLUTTER_WEB_USE_SKWASM=true\',\n'
              '            \'-DFLUTTER_WEB_CANVASKIT_URL=[https://www.gstatic.com/flutter-canvaskit/abcdefghijklmnopqrstuvwxyz/\',\n](https://www.gstatic.com/flutter-canvaskit/abcdefghijklmnopqrstuvwxyz/%5c%27,%5cn)'
              '            \'--extra-compiler-option=--depfile=/foo/build/4cad087135d8491e96c66162902e85f9/dart2wasm.d\',\n'
              '            \'--recorded-uses=/foo/build/4cad087135d8491e96c66162902e85f9/recorded_uses_wasm.json\',\n'
              '            \'-O2\',\n'
              '            \'--no-strip-wasm\',\n'
              '            \'--no-source-maps\',\n'
              '            \'--no-minify\',\n'
              '            \'-o\',\n'
              '            \'/foo/build/4cad087135d8491e96c66162902e85f9/main.dart.wasm\',\n'
              '            \'/foo/build/4cad087135d8491e96c66162902e85f9/main.dart\'\n'
              '          ]\n'
              '   Which: at location [16] is \'-O2\' instead of \'--enable-experiment=record-use\'\n'
              ''
     Which: does not contain 'Failed to compile application for the Web.'
  
  package:matcher                                               expect
  test/general.shard/build_system/targets/web_test.dart 1506:9  main.<fn>.<fn>
  ===== asynchronous gap ===========================
  test/src/testbed.dart 165:13                                  TestBed.run.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  package:flutter_tools/src/base/context.dart 154:19            AppContext.run.<fn>
  ===== asynchronous gap ===========================
  package:flutter_tools/src/base/context.dart 154:19            AppContext.run.<fn>

@cbracken cbracken added the revert Autorevert PR (with "Reason for revert:" comment) label Aug 4, 2026
@flutteractionsbot

Copy link
Copy Markdown
Contributor

Successfully created revert PR: #190583

@flutteractionsbot flutteractionsbot removed the revert Autorevert PR (with "Reason for revert:" comment) label Aug 4, 2026
pull Bot pushed a commit to edisplay/flutter that referenced this pull request Aug 5, 2026
…ag (flutter#190583)

Reverts: [fix(tool): remove redundant --enable-experiment=record-use
flag](flutter#190475)

Initiated by: @cbracken

Reason for reverting:   ```

Original PR Author: @kevmoo

Reviewed By: @mdebbar

The original PR description is provided below:

When compiling web targets (dart2js and dart2wasm) or running dry runs
with the record-use feature flag enabled, flutter_tools explicitly
passed --enable-experiment=record-use to the compiler. Since record-use
is enabled by default in recent Dart SDKs, passing this flag caused
warning spam during standard compilation and dry runs.

* Remove --enable-experiment=record-use from Dart2JSTarget and
Dart2WasmTarget in web.dart.
* Remove expected flag from test commands in web_test.dart and
web_dry_run_test.dart.

Fixes flutter#190465
pull Bot pushed a commit to AbhiShake1/flutter that referenced this pull request Aug 5, 2026
…lutter#190591)

Relands flutter#190475 (reverted in flutter#190583 due to a semantic collision with
flutter#190476).

When compiling web targets (dart2js and dart2wasm) or running dry runs
with the record-use feature flag enabled, flutter_tools explicitly
passed --enable-experiment=record-use to the compiler. Since record-use
is enabled by default in recent Dart SDKs, passing this flag caused
warning spam during standard compilation and dry runs.

* Remove --enable-experiment=record-use from Dart2JSTarget and
Dart2WasmTarget in web.dart.
* Remove expected flag from test commands in web_test.dart and
web_dry_run_test.dart, including the recently added occurrence in
addWasmCompilerErrorCommand from flutter#190476 that caused the post-commit
test failure.

Fixes flutter#190465
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Aug 10, 2026
…12420)

Manual roll requested by stuartmorgan@google.com

flutter/flutter@b766512...27b0988

2026-08-05 kevmoo@users.noreply.github.com reland(tool): remove redundant --enable-experiment=record-use flag (flutter/flutter#190591)
2026-08-05 chris@bracken.jp Windows: Propagate enabled accessibility state (flutter/flutter#190507)
2026-08-05 engine-flutter-autoroll@skia.org Roll Fuchsia Test Scripts from ltbuIH9Z3T_yOuigu... to vcANVO8VIDQHasH1X... (flutter/flutter#190589)
2026-08-05 256906086+mvincentong@users.noreply.github.com Document frozen embedder API structs (flutter/flutter#186842)
2026-08-05 49402500+fahaddoc@users.noreply.github.com Document super call order for State.didChangeDependencies (flutter/flutter#185945)
2026-08-05 dkwingsmt@users.noreply.github.com Move examples of `flutter/widgets` widgets out from `flutter/material` (flutter/flutter#189532)
2026-08-05 93888664+ColeSpringer@users.noreply.github.com [web] Use thread local strike caches in skwasm (flutter/flutter#190048)
2026-08-05 43089218+chika3742@users.noreply.github.com doc: fix typo in see also section for PrimaryScrollController.maybeOf (flutter/flutter#190386)
2026-08-05 jason-simmons@users.noreply.github.com Migrate the shell unit tests from legacy Dart native functions to FFI (flutter/flutter#190473)
2026-08-05 47866232+chunhtai@users.noreply.github.com render proxy box now defaults baseline calculation to null (flutter/flutter#190269)
2026-08-05 36861262+QuncCccccc@users.noreply.github.com Update Widgets Localizations from Translation Console (flutter/flutter#190503)
2026-08-04 154381524+flutteractionsbot@users.noreply.github.com Revert: fix(tool): remove redundant --enable-experiment=record-use flag (flutter/flutter#190583)
2026-08-04 engine-flutter-autoroll@skia.org Roll Fuchsia Test Scripts from 1frGe_KltAJKkeyPg... to ltbuIH9Z3T_yOuigu... (flutter/flutter#190561)
2026-08-04 chris@bracken.jp iOS,macOS: add tsan and ubsan support for Swift (flutter/flutter#190497)
2026-08-04 34465683+rkishan516@users.noreply.github.com fix: update on_message_ to nullptr after window destroy so that dart gets destroy message  (flutter/flutter#185807)
2026-08-04 bkonyi@google.com [flutter_tools] Gracefully handle locked Windows files during clean (flutter/flutter#190095)
2026-08-04 chris@bracken.jp iOS,macOS: make Logger thread-safe, conform to Sendable (flutter/flutter#190488)
2026-08-04 chris@bracken.jp iOS: Eliminate use of IOSContextNoop in platform view tests (reland) (flutter/flutter#190509)
2026-08-04 kevmoo@users.noreply.github.com fix(tool): remove redundant --enable-experiment=record-use flag (flutter/flutter#190475)
2026-08-04 awolff@google.com android_hardware_smoke_test: Detect blank image failures or EGL initialization warnings and retry (flutter/flutter#190110)
2026-08-04 30870216+gaaclarke@users.noreply.github.com Bumps text gamma on windows to match skia. (flutter/flutter#190477)
2026-08-04 engine-flutter-autoroll@skia.org Roll Skia from 48b58ee222f1 to a8583a0a2c11 (2 revisions) (flutter/flutter#190537)
2026-08-04 kevmoo@users.noreply.github.com [tool][web] Intercept dart2wasm errors & append JS migration footers (flutter/flutter#190476)
2026-08-04 dacoharkes@google.com [record_use] Migrate IconTreeShaker to `package:record_use` (flutter/flutter#190225)
2026-08-04 s4bre.py@gmail.com Handle unexpected exceptions during Azure metadata detection (flutter/flutter#189457)
2026-08-04 15619084+vashworth@users.noreply.github.com Fix merge conflict from flutter/flutter#190369 (flutter/flutter#190544)
2026-08-04 15619084+vashworth@users.noreply.github.com Prepare device support symbols (flutter/flutter#190369)
2026-08-04 engine-flutter-autoroll@skia.org Roll Packages from ac87e65 to 3498b9d (1 revision) (flutter/flutter#190532)
2026-08-04 engine-flutter-autoroll@skia.org Roll Skia from a08d918ebd6a to 48b58ee222f1 (11 revisions) (flutter/flutter#190527)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC stuartmorgan@google.com,tarrinneal@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
@kevmoo kevmoo added the cp: stable cherry pick this pull request to stable release candidate branch label Sep 4, 2026
@kevmoo
kevmoo deleted the issue-190465 branch September 4, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD cp: stable cherry pick this pull request to stable release candidate branch tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[tool][web] Remove redundant '--enable-experiment=record-use' flag from web compilers

4 participants