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

Added way to not launch packager during CI build, as it hangs CI builds #6180

Closed
wants to merge 2 commits into from

Conversation

BretJohnson
Copy link
Contributor

Change & motivation:
Added an environment variable, RCT_NO_LAUNCH_PACKAGER, that when set
Xcode not the launch the packager when building. This switch is needed
for CI builds, where launching the packager, which stays running, causes
the build to hang; port conflicts can be an issue as well. Really the
packager is only appropriate for interactive developer builds. This
is a problem for Visual Studio Team Services where we just added
React Native CI build support with a React Native build extension and
surely a problem for all CI systems. This fix is simple, and now if
the build machine sets RCT_NO_LAUNCH_PACKAGER globally or passes
it as an arg to xcodebuild, the packager won't launch and all is well.

Testing:
I tested by building both with & without the environment variable defined, ensuring
things work probably in both cases. I also added support to our VSTS build ask to use
this and verified it works as expected too, when setting the variable..

…makes

Xcode not the launch the packager when building. This switch is needed
for CI builds, where launching the packager, which stays running, causes
the build to hang; port conflicts can be an issue as well. Really the
packager is only appropriate for interactive developer builds.  This
is a problem for Visual Studio Team Services where we just added
React Native CI build support with a React Native build extension and
surely a problem for all CI systems.  This fix is simple, and now if
the build machine sets RCT_NO_LAUNCH_PACKAGER globally or passes
it as an arg to xcodebuild, the packager won't launch and all is well.
@facebook-github-bot
Copy link
Contributor

By analyzing the blame information on this pull request, we identified @mroswald, @sahrens and @nicklockwood to be potential reviewers.

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks!

@facebook-github-bot
Copy link
Contributor

@BretJohnson updated the pull request.

@facebook-github-bot
Copy link
Contributor

@BretJohnson updated the pull request.

@mroswald
Copy link
Contributor

@facebook-github-bot shipit

@BretJohnson
Copy link
Contributor Author

As for the CLA Signed label: I did sign the CLA earlier, late last year. But my GitHub user name (not email) changed after the acceptance, which apparently caused issues with the Facebook CLA acceptance registry, which needed to be fixed manually. Christine Abernathy at Facebook fixed that up today. I'm not sure what's needed to get the CLA Signed label to show up on this PR--hopefully something will trigger it--but I did sign the CLA.

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@facebook-github-bot facebook-github-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 Mar 14, 2016
@BretJohnson
Copy link
Contributor Author

Good--my comment triggered the CLA Signed label being added. Hopefully you guys can merge this soon. Thx.

@BretJohnson
Copy link
Contributor Author

Closing / reopening PR, to retrigger Travis build.

@BretJohnson
Copy link
Contributor Author

Reopening PR, to retrigger Travis build.

@BretJohnson BretJohnson reopened this Mar 14, 2016
@jeanregisser
Copy link
Contributor

Can this be merged?

@ghost
Copy link

ghost commented Apr 12, 2016

@sahrens would you mind taking a look at this pull request? It's been a while since the last commit was reviewed.

@dlahyani
Copy link

Can someone please rebase this branch so it could be merged?

@jeanregisser
Copy link
Contributor

@BretJohnson any chance you can rebase your changes?

@ghost
Copy link

ghost commented May 18, 2016

@BretJohnson updated the pull request.

@BretJohnson
Copy link
Contributor Author

@jeanregisser I just hit the "Update branch" button. Will that do it?

@jeanregisser
Copy link
Contributor

@BretJohnson looks like it's good.
@mroswald could you retry the shipit command? (or @sahrens?)

@mroswald
Copy link
Contributor

@facebook-github-bot shipit

@ghost
Copy link

ghost commented May 18, 2016

@nicklockwood would you mind taking a look at this pull request? It's been a while since the last commit was reviewed.

@jeanregisser
Copy link
Contributor

@mroswald looks like you don't have permission to import it. cc @mkonicek

@ghost ghost 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 Jul 12, 2016
@omeid
Copy link
Contributor

omeid commented Aug 20, 2016

Is there anything needs to be done to get this merged in?

@dlahyani
Copy link

dlahyani commented Aug 24, 2016

I am still waiting for this PR.
People at my company already hate me for adding react-native to our app, now they have to suffer this packager server window popping with every build even though we embed the .jsbundle file into the app.

Is there anything we can do to make this PR merged?

@sahrens
Copy link
Contributor

sahrens commented Aug 24, 2016

Sorry for the delay on this.

@facebook-github-bot shipit

@ghost ghost added GH Review: accepted Import Started This pull request has been imported. This does not imply the PR has been approved. and removed GH Review: review-needed labels Aug 24, 2016
@ghost
Copy link

ghost commented Aug 24, 2016

Thanks for importing.If you are an FB employee go to Phabricator to review internal test results.

@ghost ghost 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 Aug 24, 2016
@ghost ghost closed this in 8fd2d7d Aug 24, 2016
@dlahyani
Copy link

@sahrens Thanks!!

facebook-github-bot pushed a commit that referenced this pull request Jan 9, 2017
Summary:
Currently, while running `react-native run-android` command, React Native's packager is launched, and there is not any way to disable the current behaviour. This is handled somehow on iOS by adding an environment variable `RCT_NO_LAUNCH_PACKAGER` (see #6180).

This is a cross-platform solution that adds the `--no-packager` option both to `run-ios` and `run-android`, which prevents the packager from being launched.

This was tested by building with and without the option, on both environments (Android and iOS) using the device and simulator, working as expected.
Closes #11735

Differential Revision: D4392170

Pulled By: ericvicenti

fbshipit-source-id: 1c31f109f18715b84cd5ab1b6d5fd758cd0a6efb
This pull request was closed.
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. Import Started This pull request has been imported. This does not imply the PR has been approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants