fix: prevent forcing new architecture off with --only-pods#2772
Closed
floydkim wants to merge 5 commits intoreact-native-community:mainfrom
Closed
fix: prevent forcing new architecture off with --only-pods#2772floydkim wants to merge 5 commits intoreact-native-community:mainfrom
floydkim wants to merge 5 commits intoreact-native-community:mainfrom
Conversation
Member
|
At this point we should just drop the flag. New architecture is the default for a few RN versions now, and if you're still on old arch, you're likely on older RNC CLI version. I'll happily accept PR dropping it (few lines change, no need this many tests) |
Contributor
Author
|
@thymikee Thanks for the guidance. |
Member
|
yes |
Contributor
Author
|
Thanks for confirming. I’ll close this PR and open a new one that simply drops RCT_NEW_ARCH_ENABLED injection. |
3 tasks
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
This PR fixes a New Architecture propagation issue in iOS pod installation for
build-ios --only-pods/--force-pods.Background
While testing
--only-pods, I observed that a New Architecture-enabled project (RN 0.81, Reanimated v4) could run pod install withRCT_NEW_ARCH_ENABLED=0, causing installation failure.This was not limited to projects using Reanimated v4; even without Reanimated, projects that relied on RN defaults for enabling New Architecture could still have
--only-pods/--force-podseffectively run with New Architecture disabled due to forced env handling in this path.Problem
In the
--only-pods/--force-installpod install flow, New Architecture intent was not handled properly when architecture detection was unavailable.The detection logic relied on
Pods/Pods.xcodeproj/project.pbxproj. On first pod install (before Pods are generated), this file may not exist yet. In that state, the flow could forceRCT_NEW_ARCH_ENABLED=0, causing pod install to run as if New Architecture were disabled.Changes
--only-pods/--force-podspath.RCT_NEW_ARCH_ENABLEDonly when architecture is known; when unknown, the variable is omitted so Podfile/RN defaults are respected.And also updated
CONTRIBUTING.mdto includecli-config-androidandcli-config-applein the yarn link example, so local-link tests also cover config package changes.Test Plan
Unit tests
Linked local CLI validation (per CONTRIBUTING.md)
Validated with newly created template apps and linked local CLI packages (
yarn link-packages+yarn link ...in app):RN 0.81.5 template + Reanimated v4
npx react-native build-ios --only-podsfailed with New Architecture disabled error.RN 0.82.0 template + Reanimated v4
npx react-native build-ios --only-podsfailed with New Architecture disabled error.Checklist
react-nativecheckout (instructions).