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

Emscripten binding templates. · Issue #142 · nodegit/nodegit · GitHub

Repository navigation

Emscripten binding templates. #142

Description

I've successfully built libgit2 with Emscripten and am able to call into its functions within Node. This is an interesting fallback option for when compilation or prebuilt binaries fail to work.

However for this to work we'll have to modify our main script here:

https://github.com/nodegit/nodegit/blob/master/index.js#L14-L18

And create another template that can bind directly to the Emscripten exported functions mimicking our native classes exported through nodegit.node.

Activity

  1. jpstrikesback commented on Mar 26, 2014

    Would love to see your cmake command and any special steps you needed to take. I was able to build libgit2.so.0.20.0.js but I'm not sure if I've done anything really since there are no libgit2 functions within it seems.

  2. tbranyen commented on Mar 26, 2014

    MemberAuthor

    Did you export any? From what I've seen Emscripten doesn't do this by default. Try out their support channel on irc.mozilla.org#emscripten.

  3. jpstrikesback commented on Mar 26, 2014

    Indeed, I found what I wanted by running emcc with -s LINKABLE=1 "which will disable link-time optimizations and dead code elimination" Thanks! FWIW I'm playing around with this while wondering if the gen'd method is slowing a move to 0.20.0? (is it simple to build 0.20.0.json? what else is involved? should this be in a new ticket :) )...I want the newer creds/transports that came with 0.19.0...

  4. tbranyen commented on Apr 5, 2014

    MemberAuthor

    @jpstrikesback It's a bit more involved, I'd love to come up with a way to separate the metadata we add from the actual JSON file we consume. At the moment decoration needs to be manually added.

  5. tbranyen commented on May 7, 2014

    MemberAuthor

    Work to get v0.20.0 bound is happening here: #162.

  6. tbranyen commented on May 7, 2014

    MemberAuthor

    I've started working on binding libgit2 v0.20.0:

    λ node
    > require("./").Repository.open(".", function(e, repo) { console.log(e, repo); });
    0 {}

    ... and it works ;-)

  7. tbranyen commented on May 8, 2014

    MemberAuthor

    Also amazing that a Browserified version works as well.

  8. jpstrikesback commented on May 8, 2014

    Well cool!

  9. tbranyen commented on May 8, 2014

    MemberAuthor

    At the moment, it's all show and no dough. 🍕

  10. tbranyen commented on May 9, 2014

    MemberAuthor

    Can track the work being done here: #168

  11. tbranyen commented on Jun 9, 2014

    MemberAuthor
    diff --cc CMakeLists.txt
    index 6f731d4,30a32ec..0000000
    --- a/CMakeLists.txt
    +++ b/CMakeLists.txt
    @@@ -485,3 -465,13 +465,13 @@@ ENDIF (
      IF (BUILD_EXAMPLES)
        ADD_SUBDIRECTORY(examples)
      ENDIF ()
    + 
    + SET(CMAKE_VERBOSE_MAKEFILE true)
    + 
    + set(EMSCRIPTEN_ROOT_PATH "/usr/lib/emscripten")
    + 
    + set(CMAKE_C_COMPILER "${EMSCRIPTEN_ROOT_PATH}/emcc")
    + set(CMAKE_CXX_COMPILER "${EMSCRIPTEN_ROOT_PATH}/em++")
    + set(CMAKE_AR "${EMSCRIPTEN_ROOT_PATH}/emar")
    + set(CMAKE_RANLIB "${EMSCRIPTEN_ROOT_PATH}/emranlib")
     -set(CMAKE_C_FLAGS "-Wno-implicit -Wno-warn-absolute-paths")
    ++set(CMAKE_C_FLAGS "-O2 -Wno-implicit -Wno-warn-absolute-paths")
  12. tbranyen commented on Nov 21, 2014

    MemberAuthor

    Closing, we're not gonna get to this till sometime next year.

  13. Ajedi32 commented on Dec 4, 2015

    This is a really cool idea. I'm really curious as to whether this sort of thing could potentially be used to get a full-featured git client running in a browser. Chrome has an API for fileSystem access, so this actually seems like it might be plausible to me.

  14. eric-schleicher commented on Sep 5, 2016

    Is this a dead subject? or is there a working port of libgit2 that can be used in the browser or in node?

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

Metadata

Metadata

Assignees

No one assigned

    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