From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 5 Oct 2023 20:54:47 +0000 (-0700) Subject: [3.12] gh-110429: Fix race condition in "make regen-all" (GH-110433) (#110438) X-Git-Tag: v3.12.1~365 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5a4e821b436710bc9814513965ec9ad097c4adac;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-110429: Fix race condition in "make regen-all" (GH-110433) (#110438) gh-110429: Fix race condition in "make regen-all" (GH-110433) "make regen-pegen" now creates a temporary file called "parser.c.new" instead of "parser.new.c". Previously, if "make clinic" was run in parallel with "make regen-all", clinic may try but fail to open "parser.new.c" if the temporay file was removed in the meanwhile. (cherry picked from commit fb6c4ed2bbb2a867d5f0b9a94656e4714be5d9c2) Co-authored-by: Victor Stinner --- diff --git a/Makefile.pre.in b/Makefile.pre.in index a2e8458b62c9..d882c0cd6722 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1396,8 +1396,8 @@ regen-pegen: PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen -q c \ $(srcdir)/Grammar/python.gram \ $(srcdir)/Grammar/Tokens \ - -o $(srcdir)/Parser/parser.new.c - $(UPDATE_FILE) $(srcdir)/Parser/parser.c $(srcdir)/Parser/parser.new.c + -o $(srcdir)/Parser/parser.c.new + $(UPDATE_FILE) $(srcdir)/Parser/parser.c $(srcdir)/Parser/parser.c.new .PHONY: regen-ast regen-ast: