mirror of
https://git.busybox.net/buildroot.git
synced 2024-12-02 18:03:39 +08:00
5894ab0107
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> |
||
---|---|---|
arch | ||
board | ||
boot | ||
configs | ||
docs | ||
fs | ||
linux | ||
package | ||
support | ||
system | ||
toolchain | ||
utils | ||
.clang-format | ||
.defconfig | ||
.flake8 | ||
.gitignore | ||
.gitlab-ci.yml | ||
.shellcheckrc | ||
CHANGES | ||
Config.in | ||
Config.in.legacy | ||
COPYING | ||
DEVELOPERS | ||
Makefile | ||
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