Skip to content

[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
mainfrom
spm/plugin-host-hard-error
Closed

[iOS][swiftpm] Fail with clear error message when a dep depends on an autolinking plugin host#58087
chrfalch wants to merge 1 commit into
mainfrom
spm/plugin-host-hard-error

Conversation

@chrfalch

Copy link
Copy Markdown
Collaborator

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

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>
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 24, 2026
@chrfalch
chrfalch requested a review from cipolleschi August 24, 2026 10:14
@facebook-github-tools facebook-github-tools Bot added p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Aug 24, 2026
@meta-codesync

meta-codesync Bot commented Aug 24, 2026

Copy link
Copy Markdown

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this in D117196705.

@meta-codesync meta-codesync Bot closed this in 90a539c Aug 24, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Aug 24, 2026
@meta-codesync

meta-codesync Bot commented Aug 24, 2026

Copy link
Copy Markdown

@cipolleschi merged this pull request in 90a539c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants