Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/python3: bump to 3.6.2
Date: Thu, 5 Mar 2020 23:01:05 +0100	[thread overview]
Message-ID: <20200305230105.717fbebf@windsurf> (raw)
In-Reply-To: <20170918223441.2129-1-andrew.smirnov@gmail.com>

Hello,

I'm getting back to this old patch.

On Mon, 18 Sep 2017 15:34:41 -0700
Andrey Smirnov <andrew.smirnov@gmail.com> wrote:

> +# Some of CPython's source code is generated using Python interpreter
> +# and some helper tools such as "Programs/_freeze_importlib" or
> +# "Parser/pgen" (look for regen-* targets in Makefile.pre.in for more
> +# info). Normally CPython codebase ships with those files
> +# pre-generated, so just regular "make" with no additional steps
> +# should be sufficient for a succesfull build, however due to
> +# Buildroot's "Add importlib fix for PEP 3147 issue" custom patch we
> +# end up modifying "Lib/importlib/_bootstrap_external.py" which means
> +# we have to do "regen-importlib" step before building CPython
> +# (Importlib is a builtin module that needs to be "frozen"/converted
> +# to a C array of bytecode using "Programs/_freeze_importlib")
> +#
> +# To achive that we add pre-build steps to host-python3 as well as
> +# python3 that execute "regen-importlib" target.
> +#
> +# Unfortunately, for the target Python, "Programs/_freeze_importlib"
> +# is built for the target, while we need to run them at build time. So
> +# when installing host-python3, we copy them to $(HOST_DIR)/bin...
> +#
> +define HOST_PYTHON3_MAKE_REGEN_IMPORTLIB
> +	$(HOST_MAKE_ENV) $(PYTHON3_CONF_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D) regen-importlib

Unfortunately, this breaks the build when python3 is not available on
the build machine:

# Regenerate Python/importlib_external.h
# from Lib/importlib/_bootstrap_external.py using _freeze_importlib
./Programs/_freeze_importlib importlib._bootstrap_external \
    ./Lib/importlib/_bootstrap_external.py \
    ./Python/importlib_external.h.new
python3 ./Tools/scripts/update_file.py ./Python/importlib_external.h ./Python/importlib_external.h.new
make[1]: python3: Command not found
Makefile:724: recipe for target 'regen-importlib' failed
make[1]: *** [regen-importlib] Error 127
make[1]: Leaving directory '/root/buildroot/output/build/host-python3-3.8.2'

Indeed, the regen-importlib target uses python3... while building
host-python3. This clearly cannot work.

I believe we don't need to regenerate importlib for the host python, we
probably only need it for the target.

Do you think you could have a look ?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

      parent reply	other threads:[~2020-03-05 22:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-18 22:34 [Buildroot] [PATCH] package/python3: bump to 3.6.2 Andrey Smirnov
2017-09-19 18:47 ` Bernd Kuhls
2017-09-20 17:55 ` Peter Korsgaard
2020-03-05 22:01 ` Thomas Petazzoni [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200305230105.717fbebf@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox