ci: assert the plugin actually linked into the iOS build - #152
Merged
Conversation
The iOS job proved the example compiled and that no Podfile came back. Neither says this package ended up inside the binary — a plugin that fails to link builds perfectly and fails on a user's device with MissingPluginException, which is the shape of #136. A wrong product name in Package.swift, a source_files glob that stops matching after a file move, or a typo in the pubspec plugin block would all ship green. So ask the artifact rather than the exit code: nm the built Runner for the package's symbols. On the current build there are 179. The registrant importing the module makes a fully silent drop unlikely — it would fail to compile — but the module can exist while the product links nothing, and that is the case this catches. Verified all three arms locally against real binaries: 179 symbols in Runner (passes), 0 in Flutter.framework (fails), and a missing path fails rather than passing vacuously. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The iOS job asserts two things today: the build exited 0, and no
Podfilecame back. Neither says this package ended up inside the binary.A plugin that fails to link produces a perfectly successful build. The failure surfaces on a user's device as
MissingPluginException: No implementation found for method init on channel biometric_storage— the shape of #136. A wrong product name inPackage.swift, asource_filesglob that stops matching after a file move, or a typo in the pubspecplugin:block would all ship green.So the job now asks the artifact rather than the exit code:
This is the check I ran by hand during the SwiftPM migration in #150 — it is how I knew the migration worked rather than merely compiled. It just never became a CI step.
Why it is worth having even though a silent drop is unlikely. The generated registrant does
import biometric_storageand callsBiometricStoragePlugin.register(...), so a missing module fails to compile. But the module can exist while the product links nothing, and that is precisely the case this catches.Verified all three arms locally, because a check that cannot fail is worthless:
Runner.app/RunnerFlutter.framework/Flutter(no plugin)That last arm matters: without it, a rename of the build output would turn the assertion into a no-op that stays green forever.
Costs one step and no build time.
🤖 Generated with Claude Code