Fix race conditions in ck_tile remod (#3061)

This commit is contained in:
Johannes Graner
2025-10-21 09:35:04 +02:00
committed by GitHub
parent ff6efa2fb1
commit 4043401db1
2 changed files with 21 additions and 19 deletions

View File

@@ -10,15 +10,16 @@ for p in sorted(Path("./").rglob("*")):
# formatting
format_procs = []
for x in all_files:
subprocess.Popen(
f"python -m dos2unix {str(x)} {str(x)}",
shell=True,
stdout=open(os.devnull, "wb"),
dos2unix = f"python -m dos2unix {str(x)} {str(x)}"
clang_format = f"clang-format -style=file -i {str(x)}"
# One process to avoid race conditions.
cmd = f"{dos2unix} && {clang_format}"
format_procs.append(
subprocess.Popen(cmd, shell=True, stdout=open(os.devnull, "wb"))
)
cmd = f"clang-format -style=file -i {str(x)}"
# for xp in x.parents:
# print(get_file_base(x))
subprocess.Popen(cmd, shell=True)
# print(all_files)
# Wait for formatting to complete.
for p in format_procs:
p.wait()

View File

@@ -85,18 +85,19 @@ class submodule_t:
submodule = submodule_t()
# formatting
format_procs = []
for x in all_files:
subprocess.Popen(
f"python -m dos2unix {str(x)} {str(x)}",
shell=True,
stdout=open(os.devnull, "wb"),
dos2unix = f"python -m dos2unix {str(x)} {str(x)}"
clang_format = f"clang-format -style=file -i {str(x)}"
# One process to avoid race conditions.
cmd = f"{dos2unix} && {clang_format}"
format_procs.append(
subprocess.Popen(cmd, shell=True, stdout=open(os.devnull, "wb"))
)
cmd = f"clang-format -style=file -i {str(x)}"
# for xp in x.parents:
# print(get_file_base(x))
subprocess.Popen(cmd, shell=True)
submodule.push(x)
submodule.gen()
# Wait for formatting to complete before generating headers.
for p in format_procs:
p.wait()
# print(all_files)
submodule.gen()