From 25cab1c67a2c2a2d1853b3f8f65ad766321ad6b2 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 31 Aug 2023 08:12:26 +1000 Subject: [PATCH] Revert "Revert "Pull in latest upstream n2 fixes"" Was some debug code in my status hiding patch; commit link updated. --- build/ninja_gen/src/render.rs | 13 +++++-------- tools/install-n2 | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/build/ninja_gen/src/render.rs b/build/ninja_gen/src/render.rs index 4c83e382f..a9a32cf84 100644 --- a/build/ninja_gen/src/render.rs +++ b/build/ninja_gen/src/render.rs @@ -22,12 +22,17 @@ impl Build { ) .unwrap(); + writeln!(&mut buf, "builddir = {}", self.buildroot.as_str()).unwrap(); writeln!( &mut buf, "runner = $builddir/rust/release/{}", with_exe("runner") ) .unwrap(); + for (key, value) in &self.variables { + writeln!(&mut buf, "{} = {}", key, value).unwrap(); + } + buf.push('\n'); for (key, value) in &self.pools { writeln!(&mut buf, "pool {}\n depth = {}", key, value).unwrap(); @@ -49,14 +54,6 @@ impl Build { buf.push_str(&self.trailing_text); - buf = buf.replace("$builddir", self.buildroot.as_str()); - for (key, value) in &self.variables { - buf = buf.replace( - &format!("${key}"), - &value.replace("$builddir", self.buildroot.as_str()), - ); - } - buf } diff --git a/tools/install-n2 b/tools/install-n2 index a87017954..fbd5ed9e1 100755 --- a/tools/install-n2 +++ b/tools/install-n2 @@ -1,3 +1,3 @@ #!/bin/bash -cargo install --git https://github.com/ankitects/n2.git --rev 56202604d4c541524b82381162eafae4290fdd22 +cargo install --git https://github.com/ankitects/n2.git --rev d6122da0a924525439a4edc2e66cba61560bbc98