Skip to content

Commit 7ddc4ca

Browse files
committed
Ensure sync after clean and after updating config
Signed-off-by: Dave Rodgman <[email protected]>
1 parent f1c0b9f commit 7ddc4ca

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tools/bin/mtest

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,16 @@ def subrun(cmd, test_dir=False, silent=False, ignore_failure=False, color=False)
141141
return (output, r.returncode)
142142

143143

144+
def sync():
145+
# Ensure that e.g. config updates are sync'd before running make - have occasionally observed errors
146+
# that might have come from make not seeing the changes to the config that have just been written.
147+
subrun(["sync", ROOT], silent=True)
148+
149+
144150
def clean():
145151
log("make clean")
146152
subrun(["make", "clean"], silent=True)
153+
sync()
147154

148155

149156
def toolchain_exes(target):
@@ -578,6 +585,8 @@ def configure_options(target):
578585
backup_config_options(crypto_config_file)
579586
log(f"cp {new_crypto_config} {crypto_config_file}")
580587
shutil.copy(new_crypto_config, crypto_config_file)
588+
589+
sync()
581590

582591
# apply bulk config.py settings to main config file
583592
for config in config_py_groups:
@@ -609,6 +618,8 @@ def configure_options(target):
609618
if crypto_config_file is None:
610619
crypto_config_file = get_crypto_config_file()
611620
set_config_option(action, config, crypto_config_file, silent=False)
621+
622+
sync()
612623

613624

614625
def flags_to_hr_str(flags):
@@ -709,6 +720,8 @@ def build(target, tests):
709720
log(f"{make_log} -C {TEST_DIR} {' '.join(tests)} {flags_to_hr_str(flags)}")
710721
subrun(make_cmd + tests + flags, test_dir=True, silent=True, color=True)
711722

723+
sync()
724+
712725
if args.tests:
713726
log(subrun(["file", tests[0]], test_dir=True, silent=True)[0].strip())
714727
log("ok")

0 commit comments

Comments
 (0)