From 72f72b42cb450a0d8a2a6e529977d595ca6fce90 Mon Sep 17 00:00:00 2001 From: Rupert Shuttleworth Date: Tue, 8 Dec 2020 06:12:00 +0000 Subject: [PATCH] Print both the implicit and explicit environment variables when running Bazel. Test: Manually via USE_BAZEL=1 use_rbe m. Change-Id: I9f0ac8875b47848fdea4ae97d107e4167c4a7f6e --- ui/build/bazel.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/build/bazel.go b/ui/build/bazel.go index 23b14ee1b..cc29aaf98 100644 --- a/ui/build/bazel.go +++ b/ui/build/bazel.go @@ -169,8 +169,11 @@ func runBazel(ctx Context, config Config) { fmt.Fprintf(bazelEnvStringBuffer, "%s=%s ", k, v) } - // Print the full command line (including environment variables) for debugging purposes. - ctx.Println("Bazel command line: " + bazelEnvStringBuffer.String() + cmd.Cmd.String() + "\n") + // Print the implicit command line + ctx.Println("Bazel implicit command line: " + strings.Join(cmd.Environment.Environ(), " ") + " " + cmd.Cmd.String() + "\n") + + // Print the explicit command line too + ctx.Println("Bazel explicit command line: " + bazelEnvStringBuffer.String() + cmd.Cmd.String() + "\n") // Execute the build command. cmd.RunAndStreamOrFatal()