Skip to content

Commit

Permalink
pythongh-110429: Fix race condition in "make regen-all" (python#110433)
Browse files Browse the repository at this point in the history
"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.
  • Loading branch information
vstinner authored Oct 5, 2023
1 parent d257479 commit fb6c4ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit fb6c4ed

Please sign in to comment.