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

[iOS] Fix build fail when "ipconfig getifaddr" does not have IP #41823

Closed
wants to merge 1 commit into from
Closed

Conversation

nochkin
Copy link

@nochkin nochkin commented Dec 7, 2023

One of the build phase scripts fails when IP is assigned to non-en0 interface because "ipconfig getifaddr en0" exits with 1 when IP is not assigned to en0. That produced "PhaseScriptExecution failed with a nonzero exit code" in Xcode. The patch fixes this issue by removing "set -e" and re-enabling it later in the script.

Summary:

iOS build fails during Bundle React Native code and images phase.
The actual error message is PhaseScriptExecution failed with a nonzero exit code.
After doing some debugging it appears the issue is within scripts/react-native-xcode.sh and was introduced in the commit a56e5da

The patch removes "set -e" and re-enables it after looping through interfaces. Also, added the original commit comment to explain why it's been added there initially.

Changelog:

[IOS][FIXED] Fix the build failure when "en0" does not have IP assigned

Test Plan:

The script used fail when IP is assigned to non-en0 interface because "ipconfig getifaddr en0" exits with 1 when IP is not assigned. That produced "PhaseScriptExecution failed with a nonzero exit code" in Xcode.
The patch fixes this issue by removing "set -e" and re-enabling it later in the script.
@nochkin nochkin changed the title Don't fail when "ipconfig getifaddr" does not have IP [iOS] Fix build fail when "ipconfig getifaddr" does not have IP Dec 7, 2023
@facebook-github-bot
Copy link
Contributor

Hi @nochkin!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 16,513,656 -3
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 19,884,253 +9
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: eb661df
Branch: main

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Dec 7, 2023
@dmytrorykun
Copy link
Contributor

Unfortunately this is not the right fix. The purpose of having -e in this script is to bubble the error to the Xcode build pipeline and to fail the entire build if the jdbundle couldn't be created.
Closing in favour of #41839

@dmytrorykun dmytrorykun closed this Dec 8, 2023
@nochkin
Copy link
Author

nochkin commented Dec 8, 2023

@dmytrorykun
Actually, it would still bubble out the error because "set -e" is present in the script, but I agree on another fix as it looks cleaner.
Thank you for your feedback.

@dmytrorykun
Copy link
Contributor

@nochkin sorry, you're right, I somehow missed that -e didn't go away completely, but just moved to a different line 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. 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.

4 participants