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 Oct 1, 2024
1 parent 2825ed7 commit 1db6467
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tools/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ 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/
# A copy of the package's `yarn build` script
# with a `--verbose` flag removed.
yarn clean && node scripts/build.js
)
}

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

patch_package

build_rn_packages

pod_install

jetify
Expand Down

0 comments on commit 1db6467

Please sign in to comment.