Skip to content

Check in CI that spm deinit takes the template app back to CocoaPods - #59783

Open
chrfalch wants to merge 1 commit into
chrfalch/spm-ci-defaultfrom
chrfalch/spm-optout-roundtrip-ci
Open

chrfalch wants to merge 1 commit into
chrfalch/spm-ci-defaultfrom
chrfalch/spm-optout-roundtrip-ci

Conversation

@chrfalch

@chrfalch chrfalch commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Depends on #59742. This PR is based on that branch and shows only its own commit.

npx react-native spm deinit takes an app from SwiftPM back to CocoaPods. No CI job tests this today. The unit tests mock pod and xcodebuild, and no job runs deinit. A later change could break the way back without any failing check.

This PR adds a file check to the template app build job (e2e-ios-templateapp.yml, Debug and Release):

  1. Before spm add, the job records the sha256 of ios/Podfile and ios/.gitignore, or absent when .gitignore is missing.
  2. After the app upload, the job runs npx react-native spm deinit. The uploaded app is not affected.
  3. .github/workflow-scripts/assert-spm-deinit.sh then checks:
    • the Podfile is byte-identical;
    • .gitignore is byte-identical, or gone if it was absent before;
    • the .spm-injected.json marker and ios/ReactNativeSPM/ are gone;
    • project.pbxproj has no SwiftPM package references, product dependencies, ReactNativeSPM paths, or SwiftPM build phases;
    • no shared scheme still has the SwiftPM pre-action.

The check reads files only. deinit does not run pod install, so the steps take seconds. CocoaPods references are not checked, because pod install restores those, not deinit.

Changelog:

[INTERNAL] [ADDED] - CI check that spm deinit takes the template app back to CocoaPods

Test Plan:

I ran the script locally on copies of private/helloworld/ios with a test Podfile:

  • No deinit: the script fails with one error for each SwiftPM change still in place.
  • A copy of deinit that I changed to keep the marker, a copy that keeps one .gitignore line, and a copy that keeps the scheme pre-action: each fails on exactly that check.
  • Real deinit, with .gitignore absent before add and with an existing .gitignore: the script passes, and .gitignore is byte-identical.
  • bash -n passes on the script, and the workflow YAML parses.

Not run: shellcheck (not installed locally), and the job itself. CI on this PR runs it.

No CI job tested the CocoaPods opt-out: after the SwiftPM build, nothing
ran `spm deinit` or looked at the files it leaves. The template app job now
records the Podfile and ios/.gitignore checksums before `spm add`, runs
`spm deinit` after the app upload, and checks that the Podfile and
.gitignore are unchanged, the marker and ReactNativeSPM/ are gone, and the
Xcode project and shared scheme have no SwiftPM references left.

The check reads files only; `deinit` does not run `pod install`.
@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 Nov 3, 2026
@chrfalch
chrfalch requested a review from cipolleschi November 3, 2026 20:33
@chrfalch
chrfalch marked this pull request as ready for review November 3, 2026 20:33

This branch has not been deployed

No deployments
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. p: Expo Partner: Expo Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant