FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update docs on how to compile for an electron app. · Issue #905 · nodegit/nodegit · GitHub

Repository navigation

Update docs on how to compile for an electron app. #905

Description

Hey guys. Thank you for your amazing work, nodegit is a fine piece of Software.

I'm asking for your advice here.
I managed to include nodegit in our electron app but since it depends on C binaries, it basically forces us to compile the application separately on each target.

That's a shame because we lose the possibility to create all the targets clients (linux, mac and windows) in one build on a single machine.

There must be some kind of way of linking pre-compiled binaries on the fly but I could really use your help here!

Many thanks in advance.

Activity

  1. tbranyen commented on Feb 16, 2016

    Member

    You could probably script out a solution that involves curling down all our tarballs and installing via node-pre-gyp. We could help brainstorm some ideas, but you may want to consider taking the same route we are, which is building the prebuilts during continuous integration.

  2. maxkorp commented on Feb 16, 2016

    Collaborator

    When building Gitkraken we use pre-built binaries, via an npmrc. You can also just manually force the config values with environment variables you set for the install. Using the prebuilts is highly recommended, as there are lots of finicky bits for linux, especially around openssl, especially if you're distributing this externally.

    This is our .npmrc (change arch as needed)

    runtime = electron
    target = 0.36.5
    target_arch = x64
    disturl = https://atom.io/download/atom-shell
    

    That way, when you npm install ANY modules that have to be recompiled will automatically build for electron right away, instead of for node first, then forcing you to rebuild for electron afterwards. Additionally, node-pre-gyp will know automatically to download electron binaries if available, while not downloading vanilla node binaries.

  3. maxkorp commented on Feb 16, 2016

    Collaborator

    I really need to update the how to for electron >.<
    Also, i wish more workflows for electron would just adopt this in general, because it works so friggin well, even without nodegit involved.

  4. geowarin commented on Feb 17, 2016

    Author

    Thanks for your awesome suggestions!
    @tbranyen, moving the packaging to the CI is a very relevant and simple idea.

    @maxkorp's solution is more intriguing (I had a look at gitkraken, BTW, it's awesome).
    Let me rephrase it to make sure I understand:

    When installing nodegit, node-pre-gyp will run. It can optionally pick up flags from the command-line or in .npmrc.
    So the build would become:

    1. npm i nodegit --target_platform=win32
    2. package the electron app as usual
  5. maxkorp commented on Feb 18, 2016

    Collaborator

    👍

  6. geowarin commented on Feb 20, 2016

    Author

    Thanks a lot @maxkorp, your solution works flawlessly!

    For those interested here is our packaging script.

    We decided to build the app with npm 2, less headaches.

    Do you want to close this issue or would you keep it as a reminder to improve the documentation? 👼

  7. mrasoahaingo commented on Feb 20, 2016

    👍

  8. maxkorp commented on Feb 22, 2016

    Collaborator

    I'll create a new issue, but thanks man. FWIW, if you're always packaging for a single arch, you can include target_arch in the npmrc as well 👍

  9. changed the title [-]Cross-compiling an electron App[/-] [+]Update docs on how to compile for an electron app.[/+] on Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL