diff options
author | Josh Steadmon <steadmon@google.com> | 2025-01-28 14:01:38 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-01-28 14:45:47 -0800 |
commit | e7f8bf125c078004232e254e71b97226c4fed81b (patch) | |
tree | bc14f55bd4768731a7e47ccb3b985edd8231fcf1 /contrib/examples/git-svnimport.perl | |
parent | 3f8f2abe05c0aeb0ea60768d44a99261ed456d44 (diff) |
libgit-sys: introduce Rust wrapper for libgit.a
Introduce libgit-sys, a Rust wrapper crate that allows Rust code to call
functions in libgit.a. This initial patch defines build rules and an
interface that exposes user agent string getter functions as a proof of
concept. This library can be tested with `cargo test`. In later commits,
a higher-level library containing a more Rust-friendly interface will be
added at `contrib/libgit-rs`.
Symbols in libgit can collide with symbols from other libraries such as
libgit2. We avoid this by first exposing library symbols in
public_symbol_export.[ch]. These symbols are prepended with "libgit_" to
avoid collisions and set to visible using a visibility pragma. In
build.rs, Rust builds contrib/libgit-rs/libgit-sys/libgitpub.a, which also
contains libgit.a and other dependent libraries, with
-fvisibility=hidden to hide all symbols within those libraries that
haven't been exposed with a visibility pragma.
Co-authored-by: Kyle Lippincott <spectral@google.com>
Co-authored-by: Calvin Wan <calvinwan@google.com>
Signed-off-by: Calvin Wan <calvinwan@google.com>
Signed-off-by: Kyle Lippincott <spectral@google.com>
Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/examples/git-svnimport.perl')
0 files changed, 0 insertions, 0 deletions