[iOS][swiftpm] Fail with clear error message when a dep depends on an autolinking plugin host - #58087
Closed
chrfalch wants to merge 1 commit into
Closed
[iOS][swiftpm] Fail with clear error message when a dep depends on an autolinking plugin host#58087chrfalch wants to merge 1 commit into
chrfalch wants to merge 1 commit into
Conversation
A library that ships an SPM autolinking plugin owns its native contribution, so the autolinker skips generating a target for it — and therefore never creates a sibling package for it either. A dep whose manifest React Native generates still got a package reference emitted for that sibling, so SwiftPM failed on a path under `build/generated/autolinking/` that nothing had written, with no mention of the plugin, the host, or the dependent. Diagnose it where the skip happens: name the host, name every dep that declared it, and say why the sibling target does not exist. A dep shipping its own Package.swift is left alone — it declares its package references itself, and React Native emits none on its behalf. Wiring the dependent to the products the plugin contributes is deliberately not attempted — those reach the app target, not an individual library. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
cipolleschi
approved these changes
Aug 24, 2026
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this in D117196705. |
|
@cipolleschi merged this pull request in 90a539c. |
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.
Summary:
A library can ship with its own SwiftPM autolinking plugin, making the RN autolinker skip generating a target for it since the plugin now owns its native contribution.
If another library depends on a library that contains such a plugin, we currently just fail without any explanation to why and how we can fix this.
This PR diagnoses this at the declaration level, checking if a dependency is an existing target or not - emitting a clear error about what happens and why it happens.
Changelog:
[IOS] [FIXED] - Added hard fail and clear error message when an autolinking plugin host is referenced as a dependency
Test Plan:
✅ Unit tests passes