-
Notifications
You must be signed in to change notification settings - Fork 2.5k
emscripten support #5345
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
emscripten support #5345
Conversation
eea10ba to
51cb956
Compare
51cb956 to
0faf368
Compare
0faf368 to
ba122be
Compare
|
added example for |
add http transport for emscripten add example for git commit fix example for git add add example for git push add synchronous http worker for nodejs add web http support using sync XmlHttpRequest add nodejs and webworker examples for interacting with libgit2.js
ba122be to
7bae11b
Compare
|
I'm still not sure about whether we want to support Emscripten in libgit2 directly, which is probably why I've deferred reviewing this for so long. Sorry about that! I'd imagine that we should treat Emscripten the same as we do treat bindings: provide the required bits in order to make it work together so that you can live as a downstream user of libgit2. As far as I see, the only real change required on our side is swapping out the HTTP transport. I'm honestly not too keen to include the Emscripten transport directly, but we already provide Does the above make sense to you? Do you feel like this is a feasible way to go? Anyway, I'd definitely like to pull in your changes to our examples. Would you like to spin up a separate PR for them? |
|
Yes that sounds like a good idea. Good to get this clarified. If HTTP transport can be configurable at build time, I can set up a separate project for emscripten and reference libgit2 from there. And yes, I'll look into making a separate PR for the examples. Thanks for review and response :-) |
|
Thanks @petersalomonsen for your patience. And thanks @pks-t for this wonderful suggestion. I think that this is a great path forward. I'm really thrilled to see that there is so little code churn. emscripten seems to have become incredibly mature! The mmap support in particular is great to see. |
|
moved to separate project here: |
|
On Sun, Feb 23, 2020 at 02:19:23AM -0800, Peter Salomonsen wrote:
moved to separate project here:
https://github.com/petersalomonsen/wasm-git
Cool! Please feel free to create a PR for libgit2 that links to your
project in our README's language bindings to make it more discoverable.
|
This takes a different approach than #4400 as there are hardly any changes to existing code. A separate transport is added for emscripten, and the built-in examples are used for calling from js (added an extra example for commit). Instead of adding a workaround for emscripten mmap, I've submitted a PR for handling offset emscripten-core/emscripten#10095, and emscripten-core/emscripten#10526.
Would be great with some feedback on this approach compared to my previous pull-request (#4400).