Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(iOS) Codegen package isn't built while using old architecture #36097

Closed
Saadnajmi opened this issue Feb 8, 2023 · 0 comments
Closed

(iOS) Codegen package isn't built while using old architecture #36097

Saadnajmi opened this issue Feb 8, 2023 · 0 comments
Labels
Needs: Triage 🔍 p: Microsoft Partner: Microsoft Partner Platform: iOS iOS applications. Resolution: PR Submitted A pull request with a fix has been provided. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@Saadnajmi
Copy link
Contributor

Description

When building RNTester on iOS 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. For some reason, this only happens on main and not 0.71-stable (where packages/react-native-codegen doesn't need to be built for some reason).

In React Native macOS, we fixed this by ensuring the ruby method build_codegen is called for both paper and fabric.

Version

nightly

Output of npx react-native info

System:
OS: macOS 13.2
CPU: (12) arm64 Apple M2 Max
Memory: 22.18 GB / 64.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.14.0 - ~/.asdf/installs/nodejs/18.14.0/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 9.3.1 - ~/.asdf/plugins/nodejs/shims/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK: Not Found
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9514443
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: Not Found
react-native: Not Found
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  1. Clone React Native
  2. yarn install
  3. cd packages/rn-tester
  4. Modify Podfile to disable fabric (fabric_enabled = false)
  5. bundle install && bundle exec pod install
  6. xcodebuild -workspace RNTesterPods.xcworkspace -scheme RNTester -configuration debug -sdk iphonesimulator
  • Or if you prefer, run yarn test-ios from the root of the repo. I'd disable xcpretty as it suppresses the error message.

Expected result: Build succeeds
Actual result: Build fails with error:

Error: Cannot find module '/Users/sanajmi/workspace/react-native/packages/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js'

Snack, code example, screenshot, or link to a repository

N/A, since this is building React Native off of the public Github repo. The Repro steps above should suffice.

@Saadnajmi Saadnajmi added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Feb 8, 2023
@react-native-bot react-native-bot added the Platform: iOS iOS applications. label Feb 8, 2023
@cortinico cortinico added the Resolution: PR Submitted A pull request with a fix has been provided. label Feb 9, 2023
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this issue May 22, 2023
Summary:
Fixes facebook#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: facebook#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Triage 🔍 p: Microsoft Partner: Microsoft Partner Platform: iOS iOS applications. Resolution: PR Submitted A pull request with a fix has been provided. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants