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

Reland "Make Xcode workspace cleaning optional during flutter clean" - #191023

Merged
auto-submit[bot] merged 7 commits into
flutter:masterfrom
okorohelijah:reland_183946
Aug 13, 2026
Merged

auto-submit[bot] merged 7 commits into
flutter:masterfrom
okorohelijah:reland_183946

Conversation

@okorohelijah

@okorohelijah okorohelijah commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

The original PR skipped cleaning Xcode's DerivedData Clang module cache by default. This caused the plugin_lint_mac test to fail because the test dynamically toggles use_frameworks! off and expects a clean slate. Since DerivedData wasn't wiped, Xcode's cached index expected the previously generated .framework/Modules/module.modulemap to exist in build/ (which flutter clean had just deleted), resulting in a module map file not found build failure. To fix this, the --include-xcode-workspace flag is now added to the test. Since toggling use_frameworks! isn't a general use case , there is now an actionable error to gracefully guide developers to run flutter clean --include-xcode-workspace if they hit this cache corruption.

List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.
Fixes #183946, #173940 and #127708 too

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Fixes flutter#183946

This commit introduces a new `--clean-xcode-workspace` flag (defaulting to false) to `flutter clean` which allows skipping the expensive `xcodebuild -list` execution that inherently triggers Swift Package resolution over the internet. By default, Flutter will now instantly clean local build directories without polling Xcode. Additionally, this introduces an O(1) whitelist optimization to skip virtual SwiftPM schemes, significantly speeding up Xcode workspace processing when it is explicitly requested.
@github-actions github-actions Bot added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. platform-macos Building on or for macOS specifically a: desktop Running on desktop team-ios Owned by iOS platform team team-macos Owned by the macOS platform team labels Aug 12, 2026
@okorohelijah
okorohelijah marked this pull request as ready for review August 12, 2026 20:22
@okorohelijah
okorohelijah requested review from a team as code owners August 12, 2026 20:22
@okorohelijah okorohelijah added the CICD Run CI/CD label Aug 12, 2026

@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 introduces a new --include-xcode-workspace flag to the flutter clean command, ensuring Xcode workspaces are only cleaned when explicitly requested. It updates command-line options, error diagnostic messages, and tests accordingly. Feedback highlights a potential runtime ArgumentError caused by checking the unregistered scheme option in clean.dart, and identifies redundant calls to _parseMissingModule in mac.dart.

Comment thread packages/flutter_tools/lib/src/commands/clean.dart
Comment thread packages/flutter_tools/lib/src/ios/mac.dart
@okorohelijah
okorohelijah requested a review from vashworth August 12, 2026 20:45
@okorohelijah okorohelijah added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 13, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Aug 13, 2026
Merged via the queue into flutter:master with commit 39e450c Aug 13, 2026
31 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 13, 2026
@EvanMasterson

Copy link
Copy Markdown

@okorohelijah @vashworth Can I ask which Flutter release you think this will be available in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop CICD Run CI/CD platform-ios iOS applications specifically platform-macos Building on or for macOS specifically team-ios Owned by iOS platform team team-macos Owned by the macOS platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SwiftPM regresses flutter clean times

3 participants