buildman: Write the environment out to an 'env' file
authorSimon Glass <sjg@chromium.org>
Mon, 7 Jan 2019 23:44:23 +0000 (16:44 -0700)
committerSimon Glass <sjg@chromium.org>
Sat, 9 Feb 2019 19:50:22 +0000 (12:50 -0700)
Sometimes it is useful to see the environment that was used to build
U-Boot. Write this out to a file in the build directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/buildman/builderthread.py

index 6b156f152de514d20aed4b1be9a9e783d3c4a8d4..8a9d47cd5e4bc7281b7b3acf5d7f23a9c8fdf5ea 100644 (file)
@@ -322,6 +322,9 @@ class BuilderThread(threading.Thread):
 
             # Write out the image and function size information and an objdump
             env = result.toolchain.MakeEnvironment(self.builder.full_path)
+            with open(os.path.join(build_dir, 'env'), 'w') as fd:
+                for var in sorted(env.keys()):
+                    print >>fd, '%s="%s"' % (var, env[var])
             lines = []
             for fname in ['u-boot', 'spl/u-boot-spl']:
                 cmd = ['%snm' % self.toolchain.cross, '--size-sort', fname]