Go to file
Vincent Fazio dcab897851 packge/pkg-python: drop custom environment variables
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]: eef994411c
[1]: 6c79cb5ac3
[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]: 7e6c2e2cc4
[6]: 9731330d6f
[7]: 638a024500

Signed-off-by: Vincent Fazio <vfazio@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-05-08 18:40:34 +02:00
.github .github: add a pull request warning that explains the mailing list workflow 2024-04-24 21:50:23 +02:00
arch arch/Config.in: allow building a buildroot toolchain on SPARC 2024-05-06 22:38:03 +02:00
board configs/qemu_sparc_ss10: re-introduce defconfig 2024-05-07 09:10:18 +02:00
boot boot/ti-k3-boot-firmware: bump to version 09.02.00.009 2024-05-06 22:04:51 +02:00
configs configs/qemu_sparc_ss10: re-introduce defconfig 2024-05-07 09:10:18 +02:00
docs docs/website: Update for 2024.02.2 2024-05-07 10:51:08 +02:00
fs Add BR2_ROOTFS_{PRE_BUILD|POST_{BUILD|FAKEROOT|IMAGE}}_SCRIPT_ARGS 2024-03-28 21:47:04 +01:00
linux {linux, linux-headers}: bump 4.19.x / 5.{4, 10, 15}.x / 6.{1, 6, 8}.x series 2024-04-28 20:12:55 +02:00
package packge/pkg-python: drop custom environment variables 2024-05-08 18:40:34 +02:00
support Update for 2024.02.2 2024-05-07 10:49:03 +02:00
system Add BR2_ROOTFS_{PRE_BUILD|POST_{BUILD|FAKEROOT|IMAGE}}_SCRIPT_ARGS 2024-03-28 21:47:04 +01:00
toolchain toolchain: remove binutils bug 27597 2024-05-01 21:57:33 +02:00
utils utils/genrandconfig: remove Sourcery CodeBench Nios-II exclusion 2024-05-01 23:35:15 +02:00
.checkpackageignore package/libusbgx: bump to recent git version 2024-05-07 09:48:16 +02:00
.clang-format .clang-format: initial import from Linux 5.15.6 2022-01-01 15:01:13 +01:00
.defconfig
.editorconfig editorconfig: fix wildcard expansion 2023-12-20 21:32:06 +01:00
.flake8
.gitignore
.gitlab-ci.yml support/misc/gitlab-ci.yml.in: retry a job only if it failed due to a runner issue 2023-08-27 10:09:37 +02:00
.shellcheckrc utils/check-package: improve shellcheck reproducibility 2022-07-25 23:52:47 +02:00
CHANGES Update for 2024.02.2 2024-05-07 10:49:03 +02:00
Config.in package/google-breakpad: needs C++17 2024-04-07 17:14:46 +02:00
Config.in.legacy boot/uboot: remove BR2_TARGET_UBOOT_NEEDS_TI_K3_BOOT_FIRMWARE 2024-05-06 12:49:29 +02:00
COPYING
DEVELOPERS DEVELOPERS: add myself to python-yamllint 2024-05-08 18:32:05 +02:00
Makefile Add BR2_ROOTFS_{PRE_BUILD|POST_{BUILD|FAKEROOT|IMAGE}}_SCRIPT_ARGS 2024-03-28 21:47:04 +01:00
Makefile.legacy
README

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on OFTC IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches