Minor changes fixing the script from getting stuck

* git diff of bin/hex files could be huge print and make
* calling python unbuffered with stdout=subprocess.PIPE could be problematic
pull/10038/head
Oren Cohen 2019-03-11 17:28:00 +02:00
parent 83d70199d1
commit dad75b55f6
1 changed files with 11 additions and 11 deletions

View File

@ -110,7 +110,7 @@ def build_mbed_spm_platform(target, toolchain, profile='release'):
:param profile: build profile. :param profile: build profile.
""" """
subprocess.check_call([ subprocess.check_call([
sys.executable, '-u', TEST_PY_LOCATTION, sys.executable, TEST_PY_LOCATTION,
'--greentea', '--greentea',
'--profile', profile, '--profile', profile,
'-t', toolchain, '-t', toolchain,
@ -122,17 +122,17 @@ def build_mbed_spm_platform(target, toolchain, profile='release'):
'--build-data', os.path.join(ROOT, 'BUILD', 'tests', '--build-data', os.path.join(ROOT, 'BUILD', 'tests',
target, 'build_data.json'), target, 'build_data.json'),
'-n', MBED_PSA_TESTS '-n', MBED_PSA_TESTS
], stdout=subprocess.PIPE) ])
subprocess.check_call([ subprocess.check_call([
sys.executable, '-u', MAKE_PY_LOCATTION, sys.executable, MAKE_PY_LOCATTION,
'-t', toolchain, '-t', toolchain,
'-m', target, '-m', target,
'--profile', profile, '--profile', profile,
'--source', ROOT, '--source', ROOT,
'--build', os.path.join(ROOT, 'BUILD', target), '--build', os.path.join(ROOT, 'BUILD', target),
'--artifact-name', 'psa_release_1.0' '--artifact-name', 'psa_release_1.0'
], stdout=subprocess.PIPE) ])
def _tfm_test_defines(test): def _tfm_test_defines(test):
@ -155,7 +155,7 @@ def build_tfm_platform(target, toolchain, profile='release'):
""" """
for test in TFM_TESTS.keys(): for test in TFM_TESTS.keys():
subprocess.check_call([ subprocess.check_call([
sys.executable, '-u', TEST_PY_LOCATTION, sys.executable, TEST_PY_LOCATTION,
'--greentea', '--greentea',
'--profile', profile, '--profile', profile,
'-t', toolchain, '-t', toolchain,
@ -170,14 +170,14 @@ def build_tfm_platform(target, toolchain, profile='release'):
stdout=subprocess.PIPE) stdout=subprocess.PIPE)
subprocess.check_call([ subprocess.check_call([
sys.executable, '-u', MAKE_PY_LOCATTION, sys.executable, MAKE_PY_LOCATTION,
'-t', toolchain, '-t', toolchain,
'-m', target, '-m', target,
'--profile', profile, '--profile', profile,
'--source', ROOT, '--source', ROOT,
'--build', os.path.join(ROOT, 'BUILD', target), '--build', os.path.join(ROOT, 'BUILD', target),
'--app-config', TFM_MBED_APP '--app-config', TFM_MBED_APP
], stdout=subprocess.PIPE) ])
def commit_binaries(target, delivery_dir): def commit_binaries(target, delivery_dir):
@ -191,16 +191,16 @@ def commit_binaries(target, delivery_dir):
changes_made = subprocess.call([ changes_made = subprocess.call([
'git', 'git',
'-C', ROOT, '-C', ROOT,
'diff', '--exit-code', 'diff', '--exit-code', '--quiet',
delivery_dir delivery_dir
], stdout=subprocess.PIPE) ])
if changes_made: if changes_made:
subprocess.check_call([ subprocess.check_call([
'git', 'git',
'-C', ROOT, '-C', ROOT,
'add', os.path.relpath(delivery_dir, ROOT) 'add', os.path.relpath(delivery_dir, ROOT)
], stdout=subprocess.PIPE) ])
commit_message = '-m\"Update secure binaries for {}\"'.format(target) commit_message = '-m\"Update secure binaries for {}\"'.format(target)
subprocess.check_call([ subprocess.check_call([
@ -208,7 +208,7 @@ def commit_binaries(target, delivery_dir):
'-C', ROOT, '-C', ROOT,
'commit', 'commit',
commit_message commit_message
], stdout=subprocess.PIPE) ])
def build_psa_platform(target, toolchain, delivery_dir, debug=False, def build_psa_platform(target, toolchain, delivery_dir, debug=False,