Hi again,

the attached Makefile patch seems to fix the parallel build problems.

Is there a chance of getting this into trunk? Should I open an issue
or send the patch somewhere else?

Cheers,
Jonas

On Fri, Sep 5, 2014 at 12:15 PM, Jonas Wagner <jonas.wag...@epfl.ch> wrote:
>>> > Would people be interested in having a parallel version?
>>>
>>> See http://bugs.python.org/issue5309
>>
>> Cool! I'll look into this.
>
> The patch there works well for me. I've made one small update, and
> submitted the new version in the bug tracker.
>
> Regarding the other build problem, I might have found some hint:
> - Parser/pgen.o ends up in both the PARSER_OBJS and PGENOBJS variables
> in the Makefile
> - PARSER_OBJS is depended upon in a few places, hence it could be that
> make starts to build Parser/pgen.o
> - PGENOBJS is built when building PGEN, which happens *in a different
> make that is called recursively*
>
> I think the culprit is the rule for GRAMMAR_H which calls make
> recursively. Is there a reason that GRAMMAR_H has to generate PGEN
> like this? Couldn't it just depend on PGEN?
>
> Cheers,
> Jonas
diff -r 13cd8ea4cafe Makefile.pre.in
--- a/Makefile.pre.in	Fri Sep 05 11:00:56 2014 +0300
+++ b/Makefile.pre.in	Fri Sep 05 14:24:30 2014 +0200
@@ -679,11 +679,12 @@
 ############################################################################
 # Importlib
 
+Modules/_freeze_importlib.o: Modules/_freeze_importlib.c
+
 Modules/_freeze_importlib: Modules/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN)
 	$(LINKCC) $(PY_LDFLAGS) -o $@ Modules/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
 
-Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Modules/_freeze_importlib.c
-	$(MAKE) Modules/_freeze_importlib
+Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Modules/_freeze_importlib
 	./Modules/_freeze_importlib \
 		$(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h
 
@@ -745,15 +746,13 @@
 
 $(IO_OBJS): $(IO_H)
 
-$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
+$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN)
 		@$(MKDIR_P) Include
-		$(MAKE) $(PGEN)
 		$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
-$(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
-		$(MAKE) $(GRAMMAR_H)
+$(GRAMMAR_C): $(GRAMMAR_H)
 		touch $(GRAMMAR_C)
 
-$(PGEN):	$(PGENOBJS)
+$(PGEN): $(PGENOBJS)
 		$(CC) $(OPT) $(PY_LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
 
 Parser/grammar.o:	$(srcdir)/Parser/grammar.c \
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to