Skip to content

Commit

Permalink
maliput-sdk: Forwards number of jobs from cargo to the bazel build. (#…
Browse files Browse the repository at this point in the history
…132)

Signed-off-by: Franco Cipollone <[email protected]>
  • Loading branch information
francocipollone authored Jan 28, 2025
1 parent 65f72ca commit 126e5c9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions maliput-sdk/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ fn main() -> Result<(), Box<dyn Error>> {
let bazel_output_base_dir = out_dir.join("bazel_output_base");
fs::create_dir_all(&bazel_output_base_dir)?;

// Forward number of jobs used in cargo build execution to the bazel build.
// NUM_JOBS env var is set by cargo to the number of jobs used in the build.
let jobs = env::var("NUM_JOBS").unwrap().to_string();
// Bazel build
let code = std::process::Command::new("bazel")
.arg(format!("--output_base={}", bazel_output_base_dir.display()))
Expand All @@ -92,6 +95,7 @@ fn main() -> Result<(), Box<dyn Error>> {
"--symlink_prefix={}",
bazel_output_base_dir.join("bazel-").display()
))
.arg(format!("--jobs={}", jobs))
.arg("//...")
.status()
.expect("Failed to generate build script");
Expand Down

0 comments on commit 126e5c9

Please sign in to comment.