[tool] Add a SwiftPM flag to fetch-deps#11258
Conversation
Currently the iOS/macOS part of `fetch-deps` uses whatever the default Swift Package Manager setting is, even though the `build-examples` command is always using Swift Package Manager. That means that it's caching a bunch of things we don't need. This PR adds a `--swift-package-manager` flag to `fetch-deps`, and passes the same value we are using for `build-examples`. This fixes the tree breakage on macOS stable. Some of our macOS example projects don't have RunnerTest targets, and the default template version of `Podfile` assumes there is one (since it's part of the template project), so re-enabling the CocoaPods build after flutter#11237 requires a small manual change to Podfile. Since we only expect manual builds of those projects anway, that's fine, but without this PR we are accidentally hitting that in CI.
There was a problem hiding this comment.
Code Review
This pull request introduces a --swift-package-manager flag to the fetch-deps command, enabling explicit control over Swift Package Manager usage for iOS/macOS dependencies. The changes correctly update CI configurations, modify the fetch_deps_command.dart logic to handle temporary SwiftPM overrides, and include comprehensive unit tests for the new functionality. The removal of the pod repo update mock process from tests and the CHANNEL environment variable cleanup are also positive improvements.
|
Detected the If you add the The "Merge" button is also unlocked. To bypass presubmits as well as the tree status, press the GitHub "Add to Merge Queue". |
flutter/packages@91f7c33...0f2eeae 2026-03-16 [email protected] [tool] Add a SwiftPM flag to fetch-deps (flutter/packages#11258) 2026-03-14 [email protected] [various] Remove CocoaPods from examples (flutter/packages#11237) 2026-03-14 [email protected] Roll Flutter from 9e36adb to 732e05d (20 revisions) (flutter/packages#11242) 2026-03-13 [email protected] [go_router] Add `encoder`,`decoder` and `compare` parameters to `TypedQueryParameter` (flutter/packages#11067) 2026-03-13 [email protected] [camera] Remove outdated TODO in camera_controller.dart (flutter/packages#11239) 2026-03-13 [email protected] [google_sign_in_web]Fix renderButton stuck on "Getting ready" for Web (Future<void> issue) (flutter/packages#11081) 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-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: 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
#11258 did not work correctly to disable CocoaPods (i.e., to fix the tree breakage on `stable`) because it only added the config flag around the `flutter build`. When caching Dart deps as well, the `flutter pub get` call will cause `Podfile` to be recreated if SwiftPM support isn't enabled, and once it's present, `build` will try to use CocoaPods even with SwiftPM support enabled, because it looks like a project that is still using CocoaPods. This fixes that by: - Applying the override for the entire set of commands, not just `build`. - Applying the override to the plugin as well as the example, because `flutter pub get` on a package automatically sub-runs on the example, and it appears that it does so using the config flags of the top-level package.
Currently the iOS/macOS part of `fetch-deps` uses whatever the default Swift Package Manager setting is, even though the `build-examples` command is always using Swift Package Manager. That means that it's caching a bunch of things we don't need. This PR adds a `--swift-package-manager` flag to `fetch-deps`, and passes the same value we are using for `build-examples`. This fixes the tree breakage on macOS stable. Some of our macOS example projects don't have RunnerTest targets, and the default template version of `Podfile` assumes there is one (since it's part of the template project), so re-enabling the CocoaPods build after #11237 requires a small manual change to Podfile. Since any CocoaPods builds of those projects should be manual, that should be fine, but without this PR we are accidentally hitting that in CI.
#11258 did not work correctly to disable CocoaPods (i.e., to fix the tree breakage on `stable`) because it only added the config flag around the `flutter build`. When caching Dart deps as well, the `flutter pub get` call will cause `Podfile` to be recreated if SwiftPM support isn't enabled, and once it's present, `build` will try to use CocoaPods even with SwiftPM support enabled, because it looks like a project that is still using CocoaPods. This fixes that by: - Applying the override for the entire set of commands, not just `build`. - Applying the override to the plugin as well as the example, because `flutter pub get` on a package automatically sub-runs on the example, and it appears that it does so using the config flags of the top-level package.
Currently the iOS/macOS part of
fetch-depsuses whatever the default Swift Package Manager setting is, even though thebuild-examplescommand is always using Swift Package Manager. That means that it's caching a bunch of things we don't need. This PR adds a--swift-package-managerflag tofetch-deps, and passes the same value we are using forbuild-examples.This fixes the tree breakage on macOS stable. Some of our macOS example projects don't have RunnerTest targets, and the default template version of
Podfileassumes there is one (since it's part of the template project), so re-enabling the CocoaPods build after #11237 requires a small manual change to Podfile. Since any CocoaPods builds of those projects should be manual, that should be fine, but without this PR we are accidentally hitting that in CI.