Skip to content

Add platform minimum override for inter-plugin dependencies - #196237

Open
vashworth wants to merge 4 commits into
flutter:masterfrom
vashworth:swiftpm_inter_plugin_dependency_override
Open

vashworth wants to merge 4 commits into
flutter:masterfrom
vashworth:swiftpm_inter_plugin_dependency_override

Conversation

@vashworth

@vashworth vashworth commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Swift Package Manager requires a package's minimum deployment target to be at least as high as the targets of its dependencies.

Inter-plugin dependencies (when a Flutter plugin has a dependency on another Flutter plugin) are specially sensitive to this since increasing the minimum deployment target of a Flutter plugin hasn't historically required a major version change, whereas SwiftPM packages are expected to publish such a change as a major version change.

This PR introduces a workaround specifically for inter-plugin dependencies that checks if a plugin's inter-plugin dependencies have a higher required platform version. If it does, it copies the plugin and inject an override into the Package.swift like this:

// Overriding platform to match minimum of dependencies.
package.platforms = [.iOS("16.0")]

Fixes #194871.

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.

@github-actions github-actions Bot added 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 Nov 9, 2026
@vashworth
vashworth marked this pull request as ready for review November 9, 2026 23:44
@vashworth
vashworth requested review from a team as code owners November 9, 2026 23:44

@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 logic to override a Swift package's minimum deployment target when its dependencies require a higher version. It refactors manifest parsing, copies plugins requiring overrides, and updates their manifests accordingly. Feedback on the changes suggests improving error handling by checking the exit code of the swift package dump-package command, updating the regular expression for detecting package declarations to support explicit type annotations, and caching parsed manifests to prevent redundant process spawns.

@vashworth vashworth added the CICD Run CI/CD label Nov 10, 2026
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-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.

Unpin webview_flutter_wkwebview once google_mobile_ads raises its minimum iOS version to 15

1 participant