Skip to content

Commit

Permalink
Build codegen package while using old architecture (#36098)
Browse files Browse the repository at this point in the history
Summary:
Fixes #36097

When building RNTester with the old architecture, we skip a call to `build_codegen`, which will build the JS package at `packages/react-native-codegen`. This is needed for the Xcode Script phase `Generate Specs`. This causes a build with fabric disabled to fail. We can fix this by ensuring we call `build_codegen` in both paper and fabric.

We've had this change in React Native macOS already since 0.68: microsoft@1175372

## Changelog

[IOS] [FIXED] - Build codegen package while using old architecture

Pull Request resolved: #36098

Test Plan:
CI should suffice. Locally built RN-Tester without fabric with and without my change to show that disabling fabric will only succeed with this change included.
While running `pod install`, you should now see this extra line with the old architecture:
> [Codegen] building ./../../packages/react-native-codegen.

Reviewed By: cortinico

Differential Revision: D43152692

Pulled By: cipolleschi

fbshipit-source-id: 2cf3002f07eaad442ccb0272831fe2de58ec9c1a
  • Loading branch information
Saadnajmi authored and facebook-github-bot committed Feb 9, 2023
1 parent d5e8b6d commit 90327d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ def use_react_native! (
if fabric_enabled
checkAndGenerateEmptyThirdPartyProvider!(prefix, new_arch_enabled, $CODEGEN_OUTPUT_DIR)
setup_fabric!(:react_native_path => prefix)
else
relative_installation_root = Pod::Config.instance.installation_root.relative_path_from(Pathname.pwd)
build_codegen!(prefix, relative_installation_root)
end

# CocoaPods `configurations` option ensures that the target is copied only for the specified configurations,
Expand Down

0 comments on commit 90327d9

Please sign in to comment.