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

Don't validate ENTRY_FILE in react-native-xcode.sh #32762

Closed
wants to merge 2 commits into from

Conversation

janicduplessis
Copy link
Contributor

@janicduplessis janicduplessis commented Dec 15, 2021

Summary

Reverts #29012

It is not really possible to properly validate if ENTRY_FILE exists since it is resolved by metro, and the server is not always running from the app root, like in a monorepo with multiple RN apps running on the same metro server.

In my case I run metro on the repo root and entry file will be something like apps/app/index.js. -f "$ENTRY_FILE" will fail since the script is run from the project folder (PROJECT_ROOT, in my case the apps/app folder, so it tries to resolve apps/app/apps/app/index.js).

I don't think this check is actually useful since metro will report the error if the entry file is invalid (fixed in #30150). The error is not as user friendly, but I think it is still fine. Maybe it could be improved in metro.

Changelog

[iOS] [Fixed] - Don't validate ENTRY_FILE in react-native-xcode.sh

Test Plan

Before

image

After if file is actually missing

image

After if file exists, builds successfully.

@react-native-bot react-native-bot added Bug Platform: iOS iOS applications. labels Dec 15, 2021
@analysis-bot
Copy link

analysis-bot commented Dec 15, 2021

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: a0e6ffe
Branch: main

@analysis-bot
Copy link

analysis-bot commented Dec 15, 2021

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,782,640 +0
android hermes armeabi-v7a 7,172,350 +0
android hermes x86 8,093,283 +0
android hermes x86_64 8,069,317 +0
android jsc arm64-v8a 9,649,489 +0
android jsc armeabi-v7a 8,408,181 +0
android jsc x86 9,600,998 +0
android jsc x86_64 10,194,061 +0

Base commit: a0e6ffe
Branch: main

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Dec 15, 2021
@GastonRosso
Copy link

Hi @janicduplessis thanks for this, we were having the same issue here. Will it be possible to merge this?

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @janicduplessis in 780fe80.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Jun 10, 2022
@janicduplessis janicduplessis deleted the index-valid branch June 10, 2022 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. Merged This PR has been merged. Platform: iOS iOS applications. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants