Save the build environment script.

This is used to capture everything off to a saved area
in case we need to inspect the build files/sources/anything
for info post release or RC or whatever.
(cherry picked from commit 27dcf1c2711dcf8720fe348331697f86520e8820)