Fix `cargo package` for libgit-sys
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest5 patches 7 repliesIn review
- v1 RFC4 patches 3 repliesSuperseded
Changes in v2 from the cover letter
* Reworked patch #2 to build outside of the source tree rather than running make clean after the build.
* Simplified patch #4 now that cleaning is no longer necessary.
* Added patch #5 to add some required Cargo.toml fields.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | libgitpub: move to separate contrib/ directoryMakefile contrib/ contrib/ +1 more | +11 | 0 replies | |
| 2/5 | libgit-sys: add symlink to git repo root and build out of treeMakefile contrib/ contrib/ +1 more | +91 | 7 replies | |
| 3/5 | libgit-sys: parallelize build with Cargo's jobservercontrib/ | +2 | 0 replies | |
| 4/5 | libgit-sys: exclude unnecessary directories in git-srcMakefile contrib/ contrib/ | +16 | 0 replies | |
| 5/5 | libgit-{sys,rs}: add license and description fieldscontrib/ contrib/ | +3 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/5] Fix `cargo package` for libgit-sys
Fix cargo package for the libgit-sys crate by providing a pristine copy of the Git source tree at package time, and by building object files and other generated files outside of this tree. While we're at it, improve parallel builds by plumbing Cargo's make flags to the make command invoked in our build.rs script.
We also fix a few problems that would prevent us from publishing the libgit-sys crate: we add a license and description to Cargo.toml, and we exclude unnecessary files from the packaged source, to stay below crates.io's 10 MB limit.
cargo package for the libgit-rs crate is still broken for now, because it will require publishing the libgit-sys crate first.
Changes from V1:
* Reworked patch #2 to build outside of the source tree rather than running make clean after the build.
* Simplified patch #4 now that cleaning is no longer necessary.
* Added patch #5 to add some required Cargo.toml fields.
Josh Steadmon (5):
libgitpub: move to separate contrib/ directory
libgit-sys: add symlink to git repo root and build out of tree
libgit-sys: parallelize build with Cargo's jobserver
libgit-sys: exclude unnecessary directories in git-src libgit-{sys,rs}: add license and description fields
Makefile | 145 +++++++++++-------
contrib/libgit-rs/Cargo.toml | 2 +
contrib/libgit-sys/Cargo.toml | 13 ++
contrib/libgit-sys/build.rs | 12 +-
contrib/libgit-sys/git-src | 1 +
.../public_symbol_export.c | 2 +-
.../public_symbol_export.h | 0
shared.mak | 5 +
8 files changed, 117 insertions(+), 63 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%)Range-diff against v1:
1: 28e10e1092 = 1: 28e10e1092 libgitpub: move to separate contrib/ directory 2: 58111043a1 < -: ---------- libgit-sys: add symlink to git repo root and clean after build -: ---------- > 2: 6befc95a2d libgit-sys: add symlink to git repo root and build out of tree 3: 4cf9996096 ! 3: a34e23a83d libgit-sys: parallelize build with Cargo's jobserver
@@ contrib/libgit-sys/build.rs: pub fn main() -> std::io::Result<()> {
let dst = PathBuf::from(env::var_os("OUT_DIR").unwrap());
+ let makeflags = env::var_os("CARGO_MAKEFLAGS").unwrap();
- let make_output = make_cmd::gnu_make()
- .env("DEVELOPER", "1")
-+ .env("MAKEFLAGS", &makeflags)
- .env_remove("PROFILE")
- .current_dir(git_root.clone())
- .args([
-@@ contrib/libgit-sys/build.rs: pub fn main() -> std::io::Result<()> { -
let make_output = make_cmd::gnu_make()
.env("DEVELOPER", "1")
+ .env("MAKEFLAGS", &makeflags)
4: 9b5d4aa140 < -: ---------- libgit-sys: exclude unnecessary directories in git-src
-: ---------- > 4: 390695ac1f libgit-sys: exclude unnecessary directories in git-src
-: ---------- > 5: 3a87f54693 libgit-{sys,rs}: add license and description fieldsbase-commit: 683c54c999c301c2cd6f715c411407c413b1d84e
Signature · 1 line
2.49.0.395.g12beb8f557-goog