-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
feat(ios): add possibility to add arguments to hermes #37533
feat(ios): add possibility to add arguments to hermes #37533
Conversation
… HERMES_EXTRA_ARGS
Hi @Thanaen! Thank you for your pull request and welcome to our community. Action RequiredIn 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. ProcessIn 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 If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Base commit: 1671247 |
Change makes sense to me but it looks like this ran into a merge conflict. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Thanaen! Thanks for this contribution and for helping us keeping Android and iOS aligned.
Changes looks good to me, just a minor change to make our linters happy.
Out of curiosity, where did you set the -w
flag? Did you manually update the Xcode script exporting the $HERMES_EXTRA_ARGS
?
Co-authored-by: Riccardo Cipolleschi <riccardo.cipolleschi@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the quotes!
could you also fix the merge conflicts, please? 🙏 |
I'll get the conflicts resolved as soon as possible! (I was able to add the suggested changes directly from the GitHub mobile app, but I can't resolve conflicts from the app!)
To test my modification, I directly modified the "Bundle React Native code" phase in XCode! Does everything look right to you for the commits and PR messages? I wasn't quite sure what wording to use, I based it on what I usually do! |
Everything is right to me. I was curious to understand your use case and how/where you intend export the variables specifically. |
My use case is a bit particular: it's simply to solve a bug I encounter when trying to use rnx-kit as a bundler for my application. When I set up rnx-bundle as a bundle command, I could not create archives of my application because of the problem described here: microsoft/rnx-kit#2424 We found that passing the "-w" parameter to Hermes solved this bug, but I did not find an easy way to pass this parameter to Hermes when archiving an iOS project. I hope I answer your question about my use case! Maybe we could find a way to share this kind of settings in the future, so we don't have to configure these flags or the bundle command for Android and iOS! |
/rebase |
Summary:
Today, someone who wants to use a third-party bundler (like rnx-kit's bundler, for example) can do so by exporting the "BUNDLE_COMMAND" variable in the "Bundle React Native code and images" phase in XCode.
This Pull Request would allow the user to customize the compilation step via hermes, by allowing him to add arguments.
This is already possible on Android, thanks to the "hermesFlag" property (addable in
android/app/build.gradle
).In my case, this would allow me to add the "-w" flag to hermes so that the compilation emits less logs (which breaks the archiving when using rnx-kit as a bundler).
Linked issues:
microsoft/rnx-kit#2419
microsoft/rnx-kit#2424
Changelog:
[INTERNAL] [ADDED] - Add possibility to add arguments to hermes on XCode via HERMES_EXTRA_ARGS environment variable
Test Plan:
I tested locally my modification: the arguments added via the environment variable are well transmitted to Hermes, and the compilation always works when no argument is added, or when the variable is not exported in the bundle phase on XCode.