scons: wait on subprocess' completion
authorEric Engestrom <eric.engestrom@imgtec.com>
Thu, 29 Jun 2017 16:21:44 +0000 (17:21 +0100)
committerEric Engestrom <eric.engestrom@imgtec.com>
Thu, 29 Jun 2017 16:38:26 +0000 (17:38 +0100)
Windows doesn't allow you to move a file that's opened, and Popen()
doesn't wait on its subprocess' completion before returning, which leads
to broken Windows build.

Fixes: 3fd425aed764fb771f2f "build systems: uniformize git_sha1.h generation"
Suggested-by: Scott D Phillips <scott.d.phillips@intel.com>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
src/SConscript

index 5e1171b5246b08e53960197a3ef3aaf5e9596628..c31e4ec06fa5666cd118097620abd5ab0614cdfd 100644 (file)
@@ -26,7 +26,7 @@ def write_git_sha1_h_file(filename):
     with open(tempfile, "w") as f:
         args = [ 'sh', Dir('#').abspath + '/git_sha1_gen.sh' ]
         try:
-            subprocess.Popen(args, stdout=f)
+            subprocess.Popen(args, stdout=f).wait()
         except:
             print "Warning: exception in write_git_sha1_h_file()"
             return