<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/contrib/libgit-sys/Cargo.toml, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-01-28T22:45:47Z</updated>
<entry>
<title>libgit-sys: introduce Rust wrapper for libgit.a</title>
<updated>2025-01-28T22:45:47Z</updated>
<author>
<name>Josh Steadmon</name>
<email>steadmon@google.com</email>
</author>
<published>2025-01-28T22:01:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e7f8bf125c078004232e254e71b97226c4fed81b'/>
<id>urn:sha1:e7f8bf125c078004232e254e71b97226c4fed81b</id>
<content type='text'>
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 &lt;spectral@google.com&gt;
Co-authored-by: Calvin Wan &lt;calvinwan@google.com&gt;
Signed-off-by: Calvin Wan &lt;calvinwan@google.com&gt;
Signed-off-by: Kyle Lippincott &lt;spectral@google.com&gt;
Signed-off-by: Josh Steadmon &lt;steadmon@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
