Skip to content

Commit

Permalink
ios build: yarn build on node_modules/react-native/react-native-cod…
Browse files Browse the repository at this point in the history
…egen

We recently started building RN from Git, in 0509575. This caused
an iOS build failure in the shell script '[CP-User] Generate Specs':

  Error: Cannot find module '/Users/chrisbobbe/dev/zulip-mobile/node_modules/react-native/packages/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js'

Note the last part:
  [...]/lib/cli/combine/combine-js-to-schema-cli.js'

There is a [...]/src/[...] version of that file, but the /lib/ one
is created by `yarn build`, and when I ran that, the app build
succeeded.
  • Loading branch information
chrisbobbe committed Sep 30, 2024
1 parent 117864e commit ff37b14
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ patch_package() {
node_modules/.bin/patch-package
}

# Since we take react-native from Git, some packages that ship with it
# and are used in the build need their build scripts run.
build_rn_packages() {
( cd node_modules/react-native/packages/react-native-codegen/ && \
yarn clean && node scripts/build.js )
}

pod_install() {
[[ "$OSTYPE" == "darwin"* ]] \
|| return 0
Expand All @@ -31,6 +38,8 @@ jetify() {

patch_package

build_rn_packages

pod_install

jetify
Expand Down

0 comments on commit ff37b14

Please sign in to comment.