From 0bd3de33fd1a775d1370f0d254a29c182933e80c Mon Sep 17 00:00:00 2001 From: "Lukacs T. Berki" Date: Mon, 8 Mar 2021 13:09:19 +0100 Subject: [PATCH] Fix quoting issues when generating build.ninja . Some of these were introduced in aosp/1610784 and some others were present since a good while. Test: Manual: "m nothing" Change-Id: I7d5cb56ca2d87cb439354fd1b298c3b8d97d665d --- bootstrap/bootstrap.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/bootstrap/bootstrap.go b/bootstrap/bootstrap.go index 0064c2d..c73fd18 100644 --- a/bootstrap/bootstrap.go +++ b/bootstrap/bootstrap.go @@ -128,7 +128,23 @@ var ( // TODO: it's kinda ugly that some parameters are computed from // environment variables and some from Ninja parameters, but it's probably // better to not to touch that while Blueprint and Soong are separate - Command: "cd $$(dirname $builder) && BUILDER=$$PWD/$$(basename $builder) && cd / && env -i $$BUILDER $extra --top \"$$TOP\" --out \"$$SOONG_OUTDIR\" --delve_listen \"$$SOONG_DELVE\" --delve_path \"$$SOONG_DELVE_PATH\" -b $buildDir -n $ninjaBuildDir -d $out.d -globFile $globFile -o $out $in", + // NOTE: The spaces at EOL are important because otherwise Ninja would + // omit all spaces between the different options. + Command: `cd "$$(dirname "$builder")" && ` + + `BUILDER="$$PWD/$$(basename "$builder")" && ` + + `cd / && ` + + `env -i "$$BUILDER" ` + + ` $extra ` + + ` --top "$$TOP" ` + + ` --out "$$SOONG_OUTDIR" ` + + ` --delve_listen "$$SOONG_DELVE" ` + + ` --delve_path "$$SOONG_DELVE_PATH" ` + + ` -b "$buildDir" ` + + ` -n "$ninjaBuildDir" ` + + ` -d "$out.d" ` + + ` -globFile "$globFile" ` + + ` -o "$out" ` + + ` "$in" `, CommandDeps: []string{"$builder"}, Description: "$builder $out", Deps: blueprint.DepsGCC,