Skip to content

Commit

Permalink
Fix Python 2.5.6 for parallel pgen invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
nanonyme committed Nov 7, 2023
1 parent 47feb75 commit f9ed2d7
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sysa/SHA256SUMS.pkgs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ b86fc586d72a6d204d0b9017afe17aa2439529e13f43befc56648b78de17c8f8 perl5.004-05_0
f0c7bb60faae8eaf6960dfaad43acc7e30d5487ae114e44ec3c184c946adbc6f python-2.0.1_1.tar.bz2
5163e798e204b0e4ea1ab5d513ad618e11fb6dd01414991f7c7408dc74d54400 python-2.3.7_0.tar.bz2
ce21de104f50a65012f42df46b53beaf1dc2d8c5bf8f09ad20f80f64a2eb4d68 python-2.3.7_1.tar.bz2
0ced0d04ab4774dcf99eebfe3271a1b368c9a35f4f1467bf43fd000fbb32be16 python-2.5.6_0.tar.bz2
2788ab6ae1c411898de035aadfdbed9b77812c73d9c68a79813390d6f1e3f87f python-2.5.6_0.tar.bz2
eba41b855f378e004648b1b3453485d2d4401cd72cf7b993c1be06b7cebf71a2 python-3.1.5_0.tar.bz2
e10a0eceb1fcb9ca80dfcaf53bfa0d311adbaccdaf6846a6c5abfbea1e7db879 python-3.1.5_1.tar.bz2
bc87d4b8b0d2f26ed7d632c73ef9cd937bc9b6cb3bdcb57fdea78d29e38722bc python-3.11.1_0.tar.bz2
Expand Down
36 changes: 36 additions & 0 deletions sysc/python-2.5.6/patches/pgen-timestamp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
SPDX-FileCopyrightText: 2011 Antoine Pitrou <[email protected]>

SPDX-License-Identifier: PSF-2.0

Don't run pgen twice when using make -j
Don't ignore pgen error (on "make Parser/pgen.stamp")

diff --git a/Makefile.pre.in b/Makefile.pre.in
index 25a82aff01..03f85fd04b 100644
--- Makefile.pre.in
+++ Makefile.pre.in
@@ -471,10 +471,12 @@ Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
Modules/python.o: $(srcdir)/Modules/python.c
$(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c

-
-$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
+# Use a stamp file to prevent make -j invoking pgen twice
+$(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp
+Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT)
-@ mkdir Include
- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ -touch Parser/pgen.stamp

$(PGEN): $(PGENOBJS)
$(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
@@ -1030,7 +1032,7 @@ clean: pycremoval

clobber: clean
-rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
- tags TAGS \
+ tags TAGS Parser/pgen.stamp \
config.cache config.log pyconfig.h Modules/config.c
-rm -rf build platform
-rm -rf $(PYTHONFRAMEWORKDIR)

0 comments on commit f9ed2d7

Please sign in to comment.