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

Support for Rust git2-rs compilation #77

Open
samdenty opened this issue Mar 27, 2023 · 2 comments
Open

Support for Rust git2-rs compilation #77

samdenty opened this issue Mar 27, 2023 · 2 comments

Comments

@samdenty
Copy link

samdenty commented Mar 27, 2023

Would it be possible to make the WASM version of libgit, work with the git2-rs bindings for Rust.

Rust is much easier to work with and has better support for WASM via wasm-bindgen. Having support for Rust, would make creating an in-browser git CLI using wasm-git for instance much easier, without being limited to what's in the libgit2 examples/ written in C

This was mentioned here rust-lang/git2-rs#871

@christoph-det
Copy link

Are there any updates on this?

@petersalomonsen
Copy link
Owner

Wasm-git is compiled with emscripten, and also using the file system provided by emscripten. In order to integrate with Rust I think probably the best approach would be similar to how I've integrated quickjs with Rust in this project here: https://github.com/petersalomonsen/quickjs-rust-near

In that project quickjs is also compiled with emscripten, and when compiling to WebAssembly from Rust, the emscripten static libraries are linked in.

I'm not sure how this would work with the git2-rs bindings though, but it should at least be possible to interact with the c interfaces of libgit2 from Rust with such an approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants