Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Vincent Fazio <vfazio@gmail.com>
Cc: James Hilliard <james.hilliard1@gmail.com>,
	"Yann E . MORIN" <yann.morin.1998@free.fr>,
	Asaf Kahlon <asafka7@gmail.com>,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/2] packge/pkg-python: drop custom environment variables
Date: Thu, 9 May 2024 16:01:37 +0200	[thread overview]
Message-ID: <20240509160137.24345525@windsurf> (raw)
In-Reply-To: <20240507162936.18729-1-vfazio@gmail.com>

On Tue,  7 May 2024 11:29:35 -0500
Vincent Fazio <vfazio@gmail.com> wrote:

> Many moons ago, in the dark ages of Python, cross compiles were largely
> unsupported. In these before-times, a patchset used by PtxDist [0] [1]
> was adapted to help make cross compiles work.
> 
> The patchset did a number of things but mainly:
>  1) used a build-machine compatible python interpreter for certain
>     stages of the target Python build process
>  2) made adjustments to certain files to make decisions based on values
>     set in environment variables instead of the path of the executing
>     Python interpreter.
> 
> Since the path of the interpreter that was build machine compatible was
> outside of the target build directory, the code that made assumptions
> about the location of headers and library paths being relative to the
> interpreter path needed to be adjusted, hence them being driven via
> environment variables.
> 
> The patchset worked by replacing the executable path to be the sysroot
> which included the python headers and libraries.
> 
> A number of issues regarding cross compilation [2] [3] [4] have since
> been closed since the introduction of this patchset and cross builds
> became much better supported starting in Python v3.3.1.
> 
> New logic primarily uses the _PYTHON_PROJECT_BASE env variable [5] [6].
> 
> When set properly, this drives a few things:
>   * flags a cross compile environment
>   * sysconfig.is_python_build = True which triggers:
>     * altered paths for finding the Makefile and config.h
>     * altered sysconfig.get_config_var("srcdir")
> 
> When migrating to Python 3.4, PtxDist reworked their patchset to use
> the standard environment variables for their cross compiles [7].
> 
> The distutils module was a primary consumer of the custom variables from
> the previous patchset, however, that module is deprecated and packages
> cannot target it as of 09de823c.
> 
> Package builds and unit tests seem to work without using these variables
> being set, implying they can likely be dropped. Packages that still use
> distutils should be updated to reflect its removal in 3.12.
> 
> Once these custom variables are removed, the following Python3 patches
> which leverage them can be dropped:
>   0004-Adjust-library-header-paths-for-cross-compilation
>   0009-Do-not-adjust-the-shebang-of-Python-scripts-for-cros
> 
> [0]: https://gitlab.vahanus.net/ptxdist/ptxdist/-/commit/eef994411c20653cde95b35266000e3a8754e3b3
> [1]: https://gitlab.vahanus.net/ptxdist/ptxdist/-/commit/6c79cb5ac373b1cccf531e8be3ed1b9722ed1622
> [2]: https://github.com/python/cpython/issues/48004
> [3]: https://github.com/python/cpython/issues/58538
> [4]: https://github.com/python/cpython/issues/59689
> [5]: https://github.com/python/cpython/commit/7e6c2e2cc49fa109662d3f04f4c3553596d31937
> [6]: https://github.com/python/cpython/commit/9731330d6f4d63d6d57c8e99c8d11ef1def42858
> [7]: https://gitlab.vahanus.net/ptxdist/ptxdist/-/commit/638a024500c214c1d8283bce8cec864fb95deacf
> 
> Signed-off-by: Vincent Fazio <vfazio@gmail.com>
> ---
>  package/pkg-python.mk | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      parent reply	other threads:[~2024-05-09 14:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-28  2:42 [Buildroot] [PATCH 1/1] package/python3: drop unnecessary patches Vincent Fazio
2024-04-29  8:56 ` Yann E. MORIN
2024-04-29 14:48   ` Vincent Fazio
2024-04-29 17:57     ` Yann E. MORIN
2024-05-07 16:29 ` [Buildroot] [PATCH 1/2] packge/pkg-python: drop custom environment variables Vincent Fazio
2024-05-07 16:29   ` [Buildroot] [PATCH v2 2/2] package/python3: drop unnecessary patches Vincent Fazio
2024-05-09 14:02     ` Thomas Petazzoni via buildroot
2024-05-09 14:01   ` Thomas Petazzoni via buildroot [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=20240509160137.24345525@windsurf \
    --to=buildroot@buildroot.org \
    --cc=asafka7@gmail.com \
    --cc=james.hilliard1@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vfazio@gmail.com \
    --cc=yann.morin.1998@free.fr \
    /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