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

[RN@0.73.1][iOS] An issue with with-environment.sh script #42164

Closed
birdofpreyru opened this issue Jan 7, 2024 · 6 comments
Closed

[RN@0.73.1][iOS] An issue with with-environment.sh script #42164

birdofpreyru opened this issue Jan 7, 2024 · 6 comments
Labels
Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: iOS iOS applications.

Comments

@birdofpreyru
Copy link
Contributor

Description

If I call with-environment.sh from XCode build phase, it fails to me here, at the line 17:

# Start with a default
NODE_BINARY=$(command -v node)
export NODE_BINARY

I have node installed via NVM, so NODE_BINARY there is empty. In my .xcode.env I have the correct init code

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

after which that command -v node would work alright. But, I guess, that NODE_BINARY export is intentionally placed before the environment loading commands below, and thus should be somehow corrected in-place to not fail the shell script?

Steps to reproduce

N/A

React Native Version

0.73.1

Affected Platforms

Build - MacOS

Output of npx react-native info

N/A

Stacktrace or Logs

N/A

Reproducer

N/A

Screenshots and Videos

No response

Copy link

github-actions bot commented Jan 7, 2024

⚠️ Missing Reproducible Example
ℹ️ We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.

@github-actions github-actions bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: iOS iOS applications. labels Jan 7, 2024
@birdofpreyru
Copy link
Contributor Author

Agh... I see, like in another script I had problems with, it should read at the line 16:

NODE_BINARY=$(command -v node || echo "")

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Jan 7, 2024
@cortinico
Copy link
Contributor

Yup @birdofpreyru could you send a PR that fixes this?

@cortinico cortinico removed Needs: Triage 🔍 Needs: Attention Issues where the author has responded to feedback. labels Jan 8, 2024
birdofpreyru added a commit to birdofpreyru/react-native that referenced this issue Jan 8, 2024
@birdofpreyru
Copy link
Contributor Author

Hey @cortinico I've created PR #42181 into 0.73-stable branch, but I have doubts now... will you remind me, please, should be PRs done into such version branch, or into main, to not be lost in future RN versions?

@cortinico
Copy link
Contributor

will you remind me, please, should be PRs done into such version branch, or into main, to not be lost in future RN versions?

In this case, let's do the fix against main. We'll pick it on the release branch as needed

@birdofpreyru
Copy link
Contributor Author

Ok @cortinico , here is the correct PR into main#42184

Othinn pushed a commit to Othinn/react-native that referenced this issue Jan 9, 2024
Summary:
Closes facebook#42164

## Changelog:

[IOS] [FIXED] - Fixes `with-environment.sh` script for the case when Node can't be found prior to loading `.xcode.env`

Pull Request resolved: facebook#42184

Test Plan: This is a trivial update, no need for much testing.

Reviewed By: cortinico

Differential Revision: D52602653

Pulled By: cipolleschi

fbshipit-source-id: 0881456bf165d895252ae38cb7c7aee945cfaf52
gokul1099 pushed a commit to gokul1099/react-native-visionos that referenced this issue Jan 17, 2024
Summary:
Closes facebook#42164

## Changelog:

[IOS] [FIXED] - Fixes `with-environment.sh` script for the case when Node can't be found prior to loading `.xcode.env`

Pull Request resolved: facebook#42184

Test Plan: This is a trivial update, no need for much testing.

Reviewed By: cortinico

Differential Revision: D52602653

Pulled By: cipolleschi

fbshipit-source-id: 0881456bf165d895252ae38cb7c7aee945cfaf52
lunaleaps pushed a commit that referenced this issue Feb 19, 2024
Summary:
Closes #42164

## Changelog:

[IOS] [FIXED] - Fixes `with-environment.sh` script for the case when Node can't be found prior to loading `.xcode.env`

Pull Request resolved: #42184

Test Plan: This is a trivial update, no need for much testing.

Reviewed By: cortinico

Differential Revision: D52602653

Pulled By: cipolleschi

fbshipit-source-id: 0881456bf165d895252ae38cb7c7aee945cfaf52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: iOS iOS applications.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants