Subject: [RFC PATCH v1 0/4] Fix `cargo package` for libgit-sys

From: Josh Steadmon <[email-masked]>
Date: Tue, 18 Mar 2025 16:24:18 -0700

Fix a variety of issues with `cargo package` for the libgit-sys crate.
Most of these are straightforward, but patch #2 carries an unfortunate
side-effect that building the libgit-sys crate requires cleaning the Git
worktree in the process. Please see the patch description there for
discussion of possible alternatives, and please suggest any other ideas
you might have for that issue.

`cargo package` for the libgit-rs crate is still broken for now, because
it will require publishing the the libgit-sys crate first.

Josh Steadmon (4):
  libgitpub: move to separate contrib/ directory
  libgit-sys: add symlink to git repo root and clean after build
  libgit-sys: parallelize build with Cargo's jobserver
  libgit-sys: exclude unnecessary directories in git-src

 Makefile                                      | 36 ++++++++++++++-----
 contrib/libgit-sys/Cargo.toml                 | 12 +++++++
 contrib/libgit-sys/build.rs                   | 34 ++++++++++++++++--
 contrib/libgit-sys/git-src                    |  1 +
 .../public_symbol_export.c                    |  2 +-
 .../public_symbol_export.h                    |  0
 6 files changed, 72 insertions(+), 13 deletions(-)
 create mode 120000 contrib/libgit-sys/git-src
 rename contrib/{libgit-sys => libgitpub}/public_symbol_export.c (96%)
 rename contrib/{libgit-sys => libgitpub}/public_symbol_export.h (100%)

base-commit: 683c54c999c301c2cd6f715c411407c413b1d84e
-- 
2.49.0.rc1.451.g8f38331e32-goog