react / react/react-native

Regression from PR #47458: Cannot install React Native from Git anymore

Open
#50,460 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Impact: Regression Needs: Attention Needs: Repro Needs: Version Info
Dominant language
C++
Stars
127k
Forks
25.3k
Avg merge
1d 23h
Merged PRs (30d)
4

Description

Description

This PR updates shouldSkipGenerationForRncore as such it checks if .../ReactCommon exists before deciding to skip rncore generation, whereas previously it would check .../ReactCommon/react/renderer/components/rncore specifically.

This change breaks installations from Git.

I noticed this while upgrading from 0.76.2 to 0.78.1.

Per my debugging:

  • Previous behavior:
    • When installing from NPM: rncore is pre-generated using the prepack script
    • When installing from Git: rncore gets generated when running pod install
  • Current behavior:
    • When installing from NPM: rncore is pre-generated using the prepack script
    • When installing from Git: rncore will NOT get generated when running pod install because .../ReactCommon is detected as exists even though .../ReactCommon/react/renderer/components/rncore does not
Steps to reproduce
npx @react-native-community/cli@latest init BuggyReactNative
cd ./BuggyReactNative/
npm install 'https://gitpkg.vercel.app/facebook/react-native/packages/react-native?0.78-stable'
cd ./ios/
bundle exec pod install
cd ..
ls ./node_modules/react-native/ReactCommon/react/renderer/components/rncore
# 💥 no such file or directory
# 💥 Xcode won't build the project
React Native Version

0.78.1

Affected Platforms

Runtime - iOS, Other (please specify)

Output of npx @react-native-community/cli info
Not relevant
Stacktrace or Logs
Not relevant
Reproducer

Run the reproducer bash script so you can test with your toolchain not mine

Screenshots and Videos

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/react-native/scripts/codegen/generate-artifacts-executor.js at shouldSkipGenerationForRncore and compare the referenced earlier behavior with the current ReactCommon check. Use the issue's Git installation reproducer and bundle exec pod install to verify the generation path. Done means the rncore directory exists after installation and the iOS project can build.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
build-system, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.