build_packages: Dump env for goma.

The goma team is currently transitioning between backends. Having
the environment variables for a run help them to debug certain issues.
Add the env dump when run goma is enabled for now to provide the info.

BUG=chromium:1031259
TEST=cq passes

Change-Id: I3419353ea326e235c1c5402f2f0348a13e65c3a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosutils/+/1958700
Tested-by: Alex Klein <saklein@chromium.org>
Commit-Queue: Alex Klein <saklein@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/build_packages b/build_packages
index 51773d4..70cc2ba 100755
--- a/build_packages
+++ b/build_packages
@@ -118,6 +118,15 @@
 # Die on any errors.
 switch_to_strict_mode
 
+# This is a temporary measure to help the goma team check the configs while
+# they transition their backend service.
+# TODO(crbug.com/1032290): Delete after the goma RBE transition is complete.
+if [[ "${FLAGS_run_goma}" -eq "${FLAGS_TRUE}" ]]; then
+  info "Environment:"
+  env
+  info "End Environment."
+fi
+
 # Right now build_packages has to be run from scripts/
 . ${SRC_ROOT}/third_party/chromiumos-overlay/chromeos/config/chromeos_version.sh