[Python-Dev] Bug in build system for cross-platform builds

Xavier de Gaye xdegaye at gmail.com
Mon Mar 14 15:28:26 EDT 2016


On 03/14/2016 05:34 PM, Xavier de Gaye wrote:
 > Changeset c2a53aa27cad [1] was commited in issue 22359 [2] to remove incorrect
 > uses of recursive make.  The changeset added executable binaries as
 > prerequisites to the existing rules (Python/importlib.h and $(GRAMMAR_H)).
 > This broke cross-compilation:
 > * the executables do not exist and must be cross-compiled
 > * then the Python/importlib.h or $(GRAMMAR_H) target recipes must be run since
 >    the prerequisites are newer
 > * but the executables cannot run on the build system
 >
 > Actually the files need not be re-generated as their timestamps have been
 > setup for that purpose with 'make touch'. So a solution to the problem
 > introduced by this changeset when cross-compiling could be to remove the
 > binaries as prerequisites of these rules and include the recipe of their
 > corresponding rules, the one used to build the executable, into the recipes of
 > the original rule.  Also IMHO the Programs/_freeze_importlib.c can be used
 > instead of Programs/_freeze_importlib.o as a prerequisite in the
 > Python/importlib.h rule.
 >
 > [1] https://hg.python.org/cpython/rev/c2a53aa27cad/
 > [2] http://bugs.python.org/issue22359


The pgen dependencies are lost when following my previous suggestion, which is
wrong.  I have uploaded a patch at issue 22359 that uses a conditional to change the
rules, based on whether a cross-compilation is being run.

Xavier



More information about the Python-Dev mailing list