From 260db53da3aa43c23b33081922f4954e73008d64 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Thu, 2 Jan 2020 20:12:09 -0800 Subject: [PATCH] Limit environment during ninja See the change that added ALLOW_NINJA_ENV for more information. Test: m nothing; check out/soong.log for small list Test: ALLOW_NINJA_ENV=true m nothing; check out/soong.log Change-Id: I7761c6a07a7f8b0acee107e9c27c7739dd4b63ab --- ui/build/ninja.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/build/ninja.go b/ui/build/ninja.go index 5357d44cc..57a074d39 100644 --- a/ui/build/ninja.go +++ b/ui/build/ninja.go @@ -93,7 +93,9 @@ func runNinja(ctx Context, config Config) { // // For the majority of cases, either Soong or the makefiles should be replicating any // necessary environment variables in the command line of each action that needs it. - if cmd.Environment.IsFalse("ALLOW_NINJA_ENV") { + if cmd.Environment.IsEnvTrue("ALLOW_NINJA_ENV") { + ctx.Println("Allowing all environment variables during ninja; incremental builds may be unsafe.") + } else { cmd.Environment.Allow(append([]string{ "ASAN_SYMBOLIZER_PATH", "HOME",