Skip to content

[tool] Add a SwiftPM flag to fetch-deps#11258

Merged
auto-submit[bot] merged 1 commit intoflutter:mainfrom
stuartmorgan-g:swiftpm-precache
Mar 16, 2026
Merged

[tool] Add a SwiftPM flag to fetch-deps#11258
auto-submit[bot] merged 1 commit intoflutter:mainfrom
stuartmorgan-g:swiftpm-precache

Conversation

@stuartmorgan-g
Copy link
Collaborator

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.

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.
Copy link

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

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

@stuartmorgan-g stuartmorgan-g added emergency Override tree-status signal (land even with closed tree), combine with the autosubmit label. autosubmit Merge PR when tree becomes green via auto submit App labels Mar 16, 2026
@flutter-dashboard
Copy link

Detected the emergency label.

If you add the autosubmit label, the bot will wait until all presubmits pass but ignore the tree status, allowing fixes for tree breakages while still validating that they don't break any existing presubmits.

The "Merge" button is also unlocked. To bypass presubmits as well as the tree status, press the GitHub "Add to Merge Queue".

@auto-submit auto-submit bot merged commit 0f2eeae into flutter:main Mar 16, 2026
68 of 81 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 16, 2026
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Mar 16, 2026
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
stuartmorgan-g added a commit that referenced this pull request Mar 16, 2026
#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.
reidbaker pushed a commit that referenced this pull request Mar 17, 2026
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.
reidbaker pushed a commit that referenced this pull request Mar 17, 2026
#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD emergency Override tree-status signal (land even with closed tree), combine with the autosubmit label.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants