fix: Fix iOS build error when en0 is not available#41873
Closed
mrousavy wants to merge 1 commit intofacebook:mainfrom
Closed
fix: Fix iOS build error when en0 is not available#41873mrousavy wants to merge 1 commit intofacebook:mainfrom
en0 is not available#41873mrousavy wants to merge 1 commit intofacebook:mainfrom
Conversation
Fixes a build error that happens when trying to find the host IP address. e.g. when `ipconfig getifaddr en0` fails, it fails the build, even though `en1` would've worked successfully.
Base commit: a9dd43c |
Contributor
|
@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Contributor
Author
|
Honestly not sure, I didn't check the git blame - has this script been the same as with RN 0.72? Maybe it was a caching issue? I def. only saw this issue once I upgraded to RN 0.73. |
Contributor
|
Closing as: Effectively already implemented this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Fixes a build error that happens when trying to find the host IP address.
The
react-native-xcode.shscript tries to find the host machines IP address by looping through all network interfaces:This works when the network interface is on
en0, but whenen0is empty, it will immediately cause the build to fail, even though it would've worked on the next iteration (en1).This is due to the fact that the script runs with
set -e, meaning any error exit code will cause the entire script to fail - andipconfigwill return an exit code of1when the network interfaceen0can't be found.This fixes that error by ignoring the error codes of
ipconfig, which is what the script was intended to do anyways (it loops over all 9 different interfaces), by adding a|| trueclause.Before:
After:
Changelog:
[IOS] [FIXED] - Fix 0.73 build error when
ipconfigfails to find the IP addressTest Plan:
ipconfig getifaddr en0returns nothing.