Repository navigation
Conversation
The SwiftPM new-app CI job built HelloWorld only once, so it could not catch a native library that is added after setup and then not compiled on the next incremental build. The Debug lane now adds packages/react-native-test-library to HelloWorld after the first SwiftPM build and builds three more times: build 1 must fail with "native modules changed. Build again.", builds 2 and 3 must succeed with the library in the app. The step removes the library again before the later steps run.
chrfalch
force-pushed
the
spm-ci-add-lib-incremental
branch
from
December 2, 2026 12:53
3052471 to
994c101
Compare
This branch has not been deployed
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:
Tests the fix from #60462, which is now on main.
The SwiftPM new-app CI job builds HelloWorld only once. So it cannot catch the bug that #60462 fixes: a native library added after setup is not compiled on the next build without a clean build.
This PR changes the Debug lane of
test-ios-spm-newapp.yml:packages/react-native-test-library(apple and common) to HelloWorld.native modules changed. Build again.nmonHelloWorld.debug.dylib.spm deinitand the CocoaPods build) see HelloWorld as before.Before the library is added, the step writes its
Package.swiftfiles. This is the same as a library that ships its own manifest. The step does not usespm scaffold, because that also rewrites the app's autolinked manifest. Build 1 would then already know the library and would not show the error.New scripts:
.github/workflow-scripts/spm-add-lib-incremental.shand.github/workflow-scripts/spm-scaffold-test-library.js.Changelog:
[INTERNAL] [ADDED] - Test that a native library added to a SwiftPM app is compiled without a clean build
Test Plan:
I ran this locally on HelloWorld after
spm addand one Debug build, with nightly SwiftPM artifacts:Build 1 after adding the library succeeded. It must fail with 'native modules changed. Build again.'On main, the library is never compiled.spm updaterun: exit 0. Build 1 fails with the expected error. Builds 2 and 3 each printTestLibrary Objective-C classes in the app: 2.node_moduleslinks and the edit topackage.jsonwere gone.bash -n,shellcheckandprettier --checkpass.I did not run the later CocoaPods steps locally after the new step. CI is the first full run.