Go to file
Yann E. MORIN 5894ab0107 package/python3: ensure pyc embed rooted paths
To report usable tracebacks, pyc files embed the path of the original py
files, so that users can more easily try and debug the reported issue.

We generate the pyc files by calling the python3-supplied compileall
script, to scan the directory where python modules are installed. Since
this is done on the build machine, we tell compileall.py to strip away
the TARGET_DIR prefix, as that has no meaning at runtime.

However, compileall.py forgets [0] to keep a leading / in the front of
the paths, thus generating non-rooted paths., e.g.:
     /path/buildroot.ouput/targt/usr/lib/python3.10/argparse.py
gets embedded as:
     usr/lib/python3.10/argparse.py

This is a bit confusing but, as far as we could see, should be mostly be
used for display purposes in tracebacks, and does not seem to impact
actual functionality.

We fix that by instructing compileall.py that the embedded paths should
be rooted to / which generates proper paths in tracebacks.

And alternate solution would be to swith gears, and tell compileall.py
exactly the resulting runtime "base" directory, which replaces the
stripping and prefixing; i.e. it's either:
    -s $(TARGET_DIR) -p /
or
    -d /usr/lib/python$(PYTHON3_MAJOR_VERSION)

We choose to keep the first solution, because that is semantically what
we really want to do: to strip the leading build-time path, rather than
to force anything.

Note: the python test-suite was executed with both solutions (in a
pyc-only setup), and the results were exactly the same; so in practice,
-d or -s+-p yield the same results.

Many thanks go to Vincent for reporting the issue and suggesting the
solutions.

[0] Not sure whether this is a bug or a feature...

Reported-by: Vincent Fazio <vfazio@xes-inc.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-08-29 21:14:45 +02:00
arch arch: set ld's common-page-size explicitly 2022-08-23 23:51:48 +02:00
board board/freescale/common/imx: align u-boot-spl to 4 bytes 2022-08-23 23:29:19 +02:00
boot boot/edk2: fix legal-info 2022-08-27 09:50:41 +02:00
configs Revert "configs/bananapi_m1: use NEON+VFPv4 as FPU strategy" 2022-08-15 21:03:51 +02:00
docs docs/manual: patch subjects shall not be numbered 2022-08-28 11:51:23 +02:00
fs fs/tar: add option for zstd compression 2022-07-23 22:40:01 +02:00
linux linux/linux: fix firmware-imx dependency 2022-08-14 12:28:25 +02:00
package package/python3: ensure pyc embed rooted paths 2022-08-29 21:14:45 +02:00
support package/pkg-python: clean conflicting pep517 packages before install 2022-08-22 11:54:25 +02:00
system package/systemd: add setting for systemd default.target 2022-05-02 22:58:44 +02:00
toolchain toolchain/Config.in: update gcc bug 101915 comment 2022-08-07 14:56:58 +02:00
utils utils/genrandconfig: remove spurious semicolon 2022-08-24 13:21:39 +02:00
.clang-format .clang-format: initial import from Linux 5.15.6 2022-01-01 15:01:13 +01:00
.defconfig arch: remove support for sh64 2016-09-08 22:15:15 +02:00
.flake8 Revert ".flake8: fix check for 80/132 columns" 2021-01-02 17:38:20 +01:00
.gitignore update gitignore 2013-05-04 12:41:55 +02:00
.gitlab-ci.yml utils/checkpackagelib/lib_sysv: run shellcheck 2022-02-06 18:27:03 +01:00
.shellcheckrc utils/check-package: improve shellcheck reproducibility 2022-07-25 23:52:47 +02:00
CHANGES Update for 2022.08-rc1 2022-08-12 21:31:20 +02:00
Config.in Config.in: move toolchain menu before build options 2022-07-27 11:11:19 +02:00
Config.in.legacy Config.in.legacy: add missing select 2022-08-15 11:03:38 +02:00
COPYING COPYING: add exception about patch licensing 2016-02-26 19:50:13 +01:00
DEVELOPERS package/python-qrcode: new package 2022-08-08 22:24:45 +02:00
Makefile Update for 2022.08-rc1 2022-08-12 21:31:20 +02:00
Makefile.legacy Remove BR2_DEPRECATED 2016-10-15 23:14:45 +02:00
README docs: move the IRC channel away from Freenode 2021-05-29 22:16:23 +02:00

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