From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 0/3] Prepare Python support for top-level parallel build
Date: Fri, 28 Dec 2018 18:01:28 +0100 [thread overview]
Message-ID: <20181228170132.13049-1-thomas.petazzoni@bootlin.com> (raw)
Hello,
This series prepares our Python support for top-level parallel
build. To understand it, you need to read it from the last patch to
the first patch, because PATCH 1 is a consequence of PATCH 2, which is
itself a consequence of PATCH 3.
So, the problem started with the fact that when we install host Python
modules based on setuptools, we use the "regular" Python installation
process based on Python Eggs. This installation process has the
not-so-nice property of registering all installed Python Eggs in a
single common file:
$(HOST_DIR)/lib/python2.7/site-packages/easy-install.pth. Clearly,
this doesn't work well with per-package directory: if you have package
A that depends on host-python-B and host-python-C, with no dependency
relationship between host-python-B and host-python-C, when the
per-package directory for "A" gets created, it gets a version of the
easy-install.pth file either from host-python-B or host-python-C... so
it will not "see" one of them.
To fix this, we want to use the same installation process we use for
host Python modules than the one we use for target Python modules:
avoid Python Eggs, using the --single-version-externally-managed
setuptools option. This is the purpose of PATCH 3/3, which is simple
enough.
However, the story started becoming more complicated when we tried to
build host-meson. Indeed, host-meson needs host-python3 and its
installation process is based on setuptools. The issue is that when
Python 2.x is enabled for the target, or when no Python at all is
selected for the target, the default host Python version is 2.x, and
therefore host-python-setuptools is installed for Python 2.x, not
Python 3.x. This makes python-setuptools not usable for the
installation of host-meson. This was not visible until now, because
host-meson "transparently" falls back to distutils for its
installation process. *But* once you pass
--single-version-externally-managed, you have a problem: this option
is only supported by setuptools, not by distutils, so PATCH 3/3 breaks
the build of host-meson.
To solve this, we do something that we have been discussing for quite
a while: make sure python-setuptools can be available for host Python
3.x, even if Python 3.x is not the default host Python version. To
achieve this:
- PATCH 1/3 adds a host-python3-setuptools package.
- PATCH 2/3 changes the Python package infrastructure to use
host-python3-setuptools or host-python-setuptools depending on the
situation. host-python-setuptools is changed to always install for
Python 2.x, regardless of what is the default host Python version
so that host-python-setuptools and host-python3-setuptools never
step on each other.
Hopefully this cover letter helps explain the overall situation
clearly enough. Let me know if additional details are needed. This
code has survived some extensive autobuilder testing, hopefully I
haven't missed any special case.
Best regards,
Thomas
Thomas Petazzoni (3):
package/python3-setuptools: new package
package/pkg-python: use host-python3-setuptools when needed
package/pkg-python: use --single-version-externally-managed for host
setuptools
package/lirc-tools/lirc-tools.mk | 2 +-
package/pkg-python.mk | 39 +++++++---
.../python-setuptools/python-setuptools.mk | 1 +
.../0001-add-executable.patch | 72 +++++++++++++++++++
.../python3-setuptools.hash | 1 +
.../python3-setuptools/python3-setuptools.mk | 24 +++++++
6 files changed, 129 insertions(+), 10 deletions(-)
create mode 100644 package/python3-setuptools/0001-add-executable.patch
create mode 120000 package/python3-setuptools/python3-setuptools.hash
create mode 100644 package/python3-setuptools/python3-setuptools.mk
--
2.20.1
next reply other threads:[~2018-12-28 17:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-28 17:01 Thomas Petazzoni [this message]
2018-12-28 17:01 ` [Buildroot] [PATCH 1/3] package/python3-setuptools: new package Thomas Petazzoni
2018-12-29 15:13 ` Asaf Kahlon
2018-12-31 18:32 ` Yegor Yefremov
2019-01-01 10:31 ` Thomas Petazzoni
2019-01-14 18:31 ` Arnout Vandecappelle
2019-01-14 19:59 ` Thomas Petazzoni
2018-12-28 17:01 ` [Buildroot] [PATCH 2/3] package/pkg-python: use host-python3-setuptools when needed Thomas Petazzoni
2018-12-29 15:15 ` Asaf Kahlon
2018-12-31 18:29 ` Yegor Yefremov
2019-01-01 10:31 ` Thomas Petazzoni
2018-12-28 17:01 ` [Buildroot] [PATCH 3/3] package/pkg-python: use --single-version-externally-managed for host setuptools Thomas Petazzoni
2018-12-29 15:16 ` Asaf Kahlon
2018-12-31 18:30 ` Yegor Yefremov
2019-01-01 10:31 ` Thomas Petazzoni
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=20181228170132.13049-1-thomas.petazzoni@bootlin.com \
--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