Skip to content

Conversation

davidliu
Copy link

@davidliu davidliu commented Oct 16, 2025

Summary:

Addresses #54140.

This allows adding extra arguments when running a command with with-environment.sh.

Changelog:

[IOS|] [CHANGED] - Allow passing extra arguments in with-environment.sh

Test Plan:

Tested by changing the "Bundle React Native code and images" build phase in the ReproducerApp template to execute with an extra argument like so:

/bin/sh -c "$WITH_ENVIRONMENT $REACT_NATIVE_XCODE index.example"

Can observe that the subsequent command picks up the extra argument.

Also tested building normally, without the extra argument, works as expected.

Addresses facebook#54140.

This allows adding extra arguments when running a command with `with-environment.sh`.

Tested by changing the "Bundle React Native code and images" build phase in the ReproducerApp template to execute with an extra argument like so:

```
/bin/sh -c "$WITH_ENVIRONMENT $REACT_NATIVE_XCODE index.example"
```

Can observe that the subsequent command picks up the extra argument.
@meta-cla
Copy link

meta-cla bot commented Oct 16, 2025

Hi @davidliu!

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!

@react-native-bot
Copy link
Collaborator

Fails
🚫

📋 Verify Changelog Format - See Changelog format

Generated by 🚫 dangerJS against 335cdf6

@meta-cla
Copy link

meta-cla bot commented Oct 17, 2025

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

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 17, 2025
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 17, 2025
@cipolleschi
Copy link
Contributor

Hi @davidliu thanks for the PR.

There are some security concerns involved in this change. We are not sure that allowing to execute a command with an arbitrary set of arguments is safe.

Can you expand a little bit more on your use case? Why do you need to run the script with extra arguments?

@davidliu
Copy link
Author

Hi @cipolleschi, as outlined in #54140, my personal usecase is for the react-native-xcode.sh script, which can take an extra argument to specify the entry file during the iOS build process. I used it previously so that my index file could be written in typescript and thus would have a filename of index.ts.

It's not a big issue or anything though, just a minor inconvenience. I'm not really knowledgeable about the security issues here, but if there's actual concerns, feel free to close the PR.

@nicolas-rohricht
Copy link

nicolas-rohricht commented Oct 20, 2025

Hi @cipolleschi, as outlined in #54140, my personal usecase is for the react-native-xcode.sh script, which can take an extra argument to specify the entry file during the iOS build process. I used it previously so that my index file could be written in typescript and thus would have a filename of index.ts.

It's not a big issue or anything though, just a minor inconvenience. I'm not really knowledgeable about the security issues here, but if there's actual concerns, feel free to close the PR.

Worth mention that without @davidliu's suggested change I wasn't able to run app on physical devices even being in the same network as described here.

So, I'm not sure what should be the final fix in case this PR get's closed without any other suggested change.

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.

5 participants