Thread (15 messages) 15 messages, 3 authors, 2025-03-23
STALE463d
Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

[PATCH v2 3/5] libgit-sys: parallelize build with Cargo's jobserver

From: Josh Steadmon <hidden>
Date: 2025-03-21 22:14:20
Subsystem: the rest · Maintainer: Linus Torvalds

Cargo provides GNU Make flags that can be used to connect to its jobserver for
managing parallel builds. They are not automatically passed to any `make`
invocations, so let's add that to our build.rs script.

Signed-off-by: Josh Steadmon <redacted>
---
 contrib/libgit-sys/build.rs | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/contrib/libgit-sys/build.rs b/contrib/libgit-sys/build.rs
index 19407663f5..1237c9a37f 100644
--- a/contrib/libgit-sys/build.rs
+++ b/contrib/libgit-sys/build.rs
@@ -8,9 +8,11 @@ pub fn main() -> std::io::Result<()> {
     let crate_root = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
     let git_root = crate_root.join("git-src");
     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([
-- 
2.49.0.395.g12beb8f557-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help