Skip to content

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

Closed

Description

@birdofpreyru

Description

If I call with-environment.sh from XCode build phase, it fails to me here, at the line 17:
https://github.com/facebook/react-native/blob/cabae397c61ed18b2eae9c84811028857f1a72a8/packages/react-native/scripts/xcode/with-environment.sh#L15-L17

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

Activity

  1. github-actions commented on Jan 7, 2024

    @github-actions
    ⚠️ 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.
  2. added
    Needs: Repro
    Platform: iOS
    on Jan 7, 2024
  3. birdofpreyru commented on Jan 7, 2024

    @birdofpreyru
    ContributorAuthor

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

    NODE_BINARY=$(command -v node || echo "")
  4. added
    Needs: Attention
    and removed on Jan 7, 2024
  5. cortinico commented on Jan 8, 2024

    @cortinico
    Contributor

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

  6. removed
    Needs: Attention
    on Jan 8, 2024
  7. birdofpreyru commented on Jan 8, 2024

    @birdofpreyru
    ContributorAuthor

    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?

  8. cortinico commented on Jan 8, 2024

    @cortinico
    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

  9. added a commit that references this issue on Jan 8, 2024
  10. birdofpreyru commented on Jan 8, 2024

    @birdofpreyru
    ContributorAuthor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: ReproPlatform: iOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions