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

Reland "Make Xcode workspace cleaning optional during flutter clean"#191023
auto-submit[bot] merged 7 commits into
flutter:masterfrom
okorohelijah:reland_183946

Conversation

@okorohelijah

@okorohelijahokorohelijah 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.

Fixesflutter#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-actionsgithub-actionsBot 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 ownersAugust 12, 2026 20:22
@okorohelijahokorohelijah added the CICD Run CI/CD label Aug 12, 2026

@gemini-code-assistgemini-code-assistBot 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 threadpackages/flutter_tools/lib/src/commands/clean.dart
Comment threadpackages/flutter_tools/lib/src/ios/mac.dart
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktopRunning on desktopCICDRun CI/CDplatform-iosiOS applications specificallyplatform-macosBuilding on or for macOS specificallyteam-iosOwned by iOS platform teamteam-macosOwned by the macOS platform teamtoolAffects 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

2 participants

@okorohelijah@vashworth