Repository navigation
[flutter_tools] Add --[no-]extensions and FLUTTER_NO_EXTENSIONS safe mode - #194771
Merged
auto-submit[bot] merged 9 commits intoOct 21, 2026
Merged
Conversation
…mode - Add the global --[no-]extensions CLI flag and FLUTTER_NO_EXTENSIONS=1 environment variable to bypass tool extension discovery and isolate spawning. - Make FeatureFlags required on ExtensionManager and wire isSafeMode through ToolDependencies.bootstrap and FlutterFeatureFlags.isEnabled.
This was referenced Oct 19, 2026
Merged
…date top-level flag collection - Remove isToolExtensionsEnabledOverride from runner.dart, ToolDependencies.bootstrap, and FlutterFeatureFlags, reading --[no-]extensions from globalResults in ConfigCommand and DoctorCommand. - Consolidate top-level CLI flag collection and option token skipping in FlutterCommandRunner.
Consolidate --[no-]extensions flag evaluation directly into
_findTargetCommand and remove _evaluateTopLevelFlag.
Previously, FlutterCommandRunner ran two separate traversals over raw
CLI arguments before dynamic option initialization: _evaluateTopLevelFlag
and _findTargetCommand. Furthermore, because _evaluateTopLevelFlag stopped
at the first command token, passing --no-extensions after the command
(e.g., flutter config --no-extensions) did not disable extensions during
dynamic option initialization.
_findTargetCommand now returns a ({Command<void>? command, bool extensionsEnabled})
record in a single pass while respecting option values via _optionTokenCount.
Also upgrade _optionTokenCount to use findByNameOrAlias and findByAbbreviation.
Part of flutter#190755
bkonyi
marked this pull request as ready for review
October 21, 2026 17:52
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a safe mode for Flutter tool extensions, allowing them to be disabled via the FLUTTER_NO_EXTENSIONS environment variable or the --no-extensions command-line flag. It updates FlutterCommandRunner to pre-parse arguments and disable the ExtensionManager before dynamic options are initialized. Feedback on the changes suggests supporting inline boolean flag formats (such as --extensions=false) during pre-parsing, ensuring global options are correctly resolved when parsing subcommand arguments, and adding an assertion to enforce that ExtensionManager.disable() is called before initialization starts.
…rt disable lifecycle In _optionTokenCount, fall back to checking the root argParser when an option is not found in the current subcommand parser. This ensures global options with value arguments passed after a subcommand consume their arguments properly rather than treating the value as a subcommand name. Also add an assertion to ExtensionManager.disable() to ensure disable() cannot be called after initialization has started. Part of flutter#190755
chingjun
approved these changes
Oct 21, 2026
LongCatIsLooong
pushed a commit
to LongCatIsLooong/flutter
that referenced
this pull request
Oct 22, 2026
…mode (flutter#194771) Add the global `--[no-]extensions` CLI flag and `FLUTTER_NO_EXTENSIONS=1` environment variable to bypass tool extension discovery and isolate spawning, and require `FeatureFlags` on `ExtensionManager`. ### Stack - **PR 1A (parallel off `master`)**: flutter#194590 (`ft-ext-phase01-03-project-discovery`) - **PR 1B (this PR)**: flutter#194771 (`ft-ext-phase01b-safe-mode`) - **PR 1C (stacked on 1A)**: flutter#194772 (`ft-ext-phase01c-finder-and-compiler`) - **PR 1D (stacked on 1B + 1C)**: flutter#194774 (`ft-ext-phase01d-dynamic-discovery-wiring`) Part of flutter#190755 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing.
This was referenced Oct 22, 2026
This was referenced Oct 22, 2026
suryaKommana2662
pushed a commit
to suryaKommana2662/flutter
that referenced
this pull request
Oct 29, 2026
…mode (flutter#194771) Add the global `--[no-]extensions` CLI flag and `FLUTTER_NO_EXTENSIONS=1` environment variable to bypass tool extension discovery and isolate spawning, and require `FeatureFlags` on `ExtensionManager`. ### Stack - **PR 1A (parallel off `master`)**: flutter#194590 (`ft-ext-phase01-03-project-discovery`) - **PR 1B (this PR)**: flutter#194771 (`ft-ext-phase01b-safe-mode`) - **PR 1C (stacked on 1A)**: flutter#194772 (`ft-ext-phase01c-finder-and-compiler`) - **PR 1D (stacked on 1B + 1C)**: flutter#194774 (`ft-ext-phase01d-dynamic-discovery-wiring`) Part of flutter#190755 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing.
suryaKommana2662
pushed a commit
to suryaKommana2662/flutter
that referenced
this pull request
Oct 29, 2026
….spawnUri support (flutter#194590) Introduce `ExtensionPackageConfig` in `package:flutter_tools_core` for parsing `extension/flutter_tools/config.yaml` manifests, `Isolate.spawnUri` entrypoint support in `ToolExtensionEntryPoint.run` and `package:flutter_tools_extension_linux_prototype`, and `ExtensionConnection.spawnUri` (with `expectedConfig` capability validation) in `flutter_tools`. ### Stack - **PR 1A (this PR)**: flutter#194590 (`ft-ext-phase01-03-project-discovery`) - **PR 1B (merged)**: flutter#194771 (`ft-ext-phase01b-safe-mode`) - **PR 1C (stacked on 1A)**: flutter#194772 (`ft-ext-phase01c-finder-and-compiler`) - **PR 1D (stacked on 1C)**: flutter#194774 (`ft-ext-phase01d-dynamic-discovery-wiring`) Part of flutter#190755 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing.
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.
Add the global
--[no-]extensionsCLI flag andFLUTTER_NO_EXTENSIONS=1environment variable to bypass tool extension discovery and isolate spawning, and requireFeatureFlagsonExtensionManager.Stack
master): [flutter_tools] Add ExtensionPackageConfig manifest model and Isolate.spawnUri support #194590 (ft-ext-phase01-03-project-discovery)ft-ext-phase01b-safe-mode)ft-ext-phase01c-finder-and-compiler)ft-ext-phase01d-dynamic-discovery-wiring)Part of #190755
Pre-launch Checklist
///).