Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4702b7b

Browse files
authored
GH-118943: Fix a race condition when generating jit_stencils.h (GH-118957)
1 parentab73bcd commit4702b7b

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix a possible race condition affecting parallel builds configured with
2+
``--enable-experimental-jit``, in which compilation errors could be caused
3+
by an incompletely-generated header file.

‎Tools/jit/_targets.py‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,18 @@ def build(
212212
):
213213
return
214214
stencil_groups=asyncio.run(self._build_stencils())
215-
withjit_stencils.open("w")asfile:
216-
file.write(digest)
217-
ifcomment:
218-
file.write(f"//{comment}\n\n")
219-
file.write("")
220-
forlinein_writer.dump(stencil_groups):
221-
file.write(f"{line}\n")
215+
jit_stencils_new=out/"jit_stencils.h.new"
216+
try:
217+
withjit_stencils_new.open("w")asfile:
218+
file.write(digest)
219+
ifcomment:
220+
file.write(f"//{comment}\n")
221+
file.write("\n")
222+
forlinein_writer.dump(stencil_groups):
223+
file.write(f"{line}\n")
224+
jit_stencils_new.replace(jit_stencils)
225+
finally:
226+
jit_stencils_new.unlink(missing_ok=True)
222227

223228

224229
class_COFF(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp