]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-110429: Fix race condition in "make regen-all" (#110433)
authorVictor Stinner <vstinner@python.org>
Thu, 5 Oct 2023 20:26:37 +0000 (22:26 +0200)
committerGitHub <noreply@github.com>
Thu, 5 Oct 2023 20:26:37 +0000 (22:26 +0200)
"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.

Makefile.pre.in

index 97eb767b8fcdebe884de04a4884fc702c44408aa..f1f5c8557e7ffc48e14640e7861f14ae0866c855 100644 (file)
@@ -1399,8 +1399,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: