From 54b1cc5689867b84a24d679bf7471f3c1b558061 Mon Sep 17 00:00:00 2001 From: Kai Knoblich <43905002+knobix@users.noreply.github.com> Date: Thu, 1 Feb 2024 05:56:14 +0100 Subject: [PATCH] Honor NINJA_STATUS if already set (#2984) * Honor NINJA_STATUS if already set Allow build environments at downstream to use their own configured NINJA_STATUS if set. * Update CONTRIBUTORS --- CONTRIBUTORS | 2 +- build/runner/src/build.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index ed44c40d6..964ce24c0 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -157,7 +157,7 @@ Marko Sisovic Viktor Ricci Harvey Randall Pedro Lameiras -Kai Knoblich +Kai Knoblich ******************** diff --git a/build/runner/src/build.rs b/build/runner/src/build.rs index e1d4eefde..02bf58d05 100644 --- a/build/runner/src/build.rs +++ b/build/runner/src/build.rs @@ -60,7 +60,6 @@ pub fn run_build(args: BuildArgs) { .arg("-f") .arg(&build_file) .args(ninja_args) - .env("NINJA_STATUS", "[%f/%t; %r active; %es] ") .env("PATH", &path) .env( "MYPY_CACHE_DIR", @@ -75,6 +74,10 @@ pub fn run_build(args: BuildArgs) { // Updating svelte-check or its deps will likely remove the need for it. .env("NODE_OPTIONS", "--no-experimental-fetch"); + if env::var("NINJA_STATUS").is_err() { + command.env("NINJA_STATUS", "[%f/%t; %r active; %es] "); + } + // run build let mut status = command.status().expect("ninja not installed"); if !status.success() && Instant::now().duration_since(start_time).as_secs() < 3 {