summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2021-02-08python3targetconfig.bbclass: Make py3 dep and tasks only for target recipespkj/_PYTHON_SYSCONFIGDATA_NAME-dunfellKhem Raj
python3targetconfig append target python3 to dependencies unconditionally, and here its inherited unconditionally too but distutils3-base is inherited in BBCLASSEXTEND'ed recipes and other not-target recipes as well. Hence the change added via 9c8f666097802cb594a759989edcf01603a22df3 is now bridging the native dependencies with target python3 and thats resulting all sorts of rebuilds for multimachine builds e.g. MACHINE=qemuarm bitbake python3-scons-native MACHINE=qemumips bitbake python3-scons-native results in rebuilds for python3-scons-native bitbake-diffsigs shows Hash for dependent task python/python3-scons-native_3.1.2.bb:do_populate_sysroot changed from 1cdb93193b416477df6faa137e83a967b433c7aa29033146b405153f73f36933 to 3cea1e7cbedd121ecb768fbc291cc4e4d7d3b5c0442897 0e3b97bd058d162065 Hash for dependent task python/python3-scons-native_3.1.2.bb:do_install changed from 8d6018fd03ffc6060a04532dc39a5b7ccca1be026a69d069cb4fb11aef86dd89 to c5f1d173596a8e910f45a2b6e0b4dab96cd0102be4d62bd3156 229cb0f5ebb11 Hash for dependent task python/python3-scons-native_3.1.2.bb:do_compile changed from e3ee4b52a15267e6ae7853ec19a666b2fb62608a597608793336382d1c45f8a0 to 1e582043dfe6b3e00aaa532f363ce6afb37652abe837dac 7cc9769194c43eae1 Hash for dependent task python/python3-scons-native_3.1.2.bb:do_configure changed from 770a4d5a77a96ebd9e1e7368f710bca3f88e3b1266dffa3b2d0360b1e3a81e27 to a366982778b03eee5165c3117ee778f848acdfaa2 b346650fbdf114ac70ab57b Hash for dependent task python/python3-scons-native_3.1.2.bb:do_prepare_recipe_sysroot changed from 958910037856ff5d5eb2b5162b3cdd02a3a710fc543b933cfeba771ee095cb72 to 474333fb565f908992fd3716 4935aaecf31a79e867826fe634cde4f44171d8e7 Hash for dependent task python/python3_3.9.0.bb:do_populate_sysroot changed from 7ac1c4fcbb2eacf98d2c32d991751bd2f3c7d55e2e32f2c9e485e7f5975fecf8 to 25dcfe74a95af19cce8df7c29311cc5edbbf6ad 08777e46a6fa6e417c0445018 ... Therefore limit effects of this class only for target recipes. Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Alexander Kanavin <alex.kanavin@gmail.com> Cc: Martin Jansa <Martin.Jansa@gmail.com> Cc: Jose Quaresma <quaresma.jose@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-08gpgme: use python3targetconfigAlexander Kanavin
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-08meta: drop _PYTHON_SYSCONFIGDATA_NAME hacksAlexander Kanavin
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-08distutils3-base.bbclass: use python3targetconfigAlexander Kanavin
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-08python3-pycairo: use python3targetconfigAlexander Kanavin
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-08python3: split python target configuration into own classAlexander Kanavin
Setting _PYTHON_SYSCONFIGDATA_NAME in python3native class globally was problematic as it was leaking into host python environment, which was causing tracebacks depending on host distro and action (typically anything involving importing sysconfig module). The new class sets the variable only in specific tasks where it is needed, and should be inherited explicitly: - use python3native to run scripts with native python - use python3targetconfig to run scripts with native python if those scripts need to access target config data (such as correct installation directories). This also adds a dependency on target python, so should be used carefully to avoid lengthening builds. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-29staging: Clean up files installed into the sysrootRichard Purdie
There are a variety of files being installed into $datadir which we don't need. Pick the top "offenders" which amount of thousands of files and simply don't install them. These include things like test data, terminfo data, locale data for native tools and so on. This saves copying these files into native and target sysroots and should improve performance (smaller sstate, fewer files to copy around). With this and the python recipe change, alsa-tools went from: recipe-sysroot: 18357 recipe-sysroot-native: 14129 to recipe-sysroot: 10809 recipe-sysroot-native: 8079 which is a decent improvement. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 366c72941fe1c24d0b1d96df46e13cb9eb4e79d6) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-29python3: Avoid installing test data into recipe-sysrootRichard Purdie
There are several thousand files in the test directory which we don't need. Adding these for the native and target sysroots is a crazy amount of files to be throwing around needlessly. Delete the files from the sysroot side of things to tidy up the sysroots and improve performance. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit f6bced03011ad1663d68b0322a2f8aeb4d836646) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-29ncurses: Don't put terminfo into the sysrootRichard Purdie
This recudes the file count from ~2850 to ~100 which is a huge win for reducing build directory clutter, its unlikely anything uses the terminfo data or man pages in the sysroot. This is especially helpful as we usually end up with two copies of these sets of files. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 443633dfc20177ef88a388d96745675817510c99) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-29externalsrc: Detect code changes in submodulesTomasz Dziendzielski
The srctree_hash was calculated only from main source directory ignoring changes in submodules. [YOCTO #13748] Use submodule--helper to determine all submodules, and calculate hash from all git tree objects names combined. Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 50ff9afb3990bcf60b4fa1f937506cb84028c32d) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28strace: increase ptest timeout duration 120->240sYi Fan Yu
solve qual_fault-syscall.test and qual_fault.test failing due to timeout. Bug 14165 Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 5af9f32d9b12654793289f44366251f978f6378a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28timezone: upgrade to 2021aOvidiu Panait
Release 2021a - 2021-01-24 10:54:57 -0800 Changes to future timestamps South Sudan changes from +03 to +02 on 2021-02-01 at 00:00. (Thanks to Steffen Thorsen.) Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ed9114df2086c4ad0544cf99c9c1ff8fb7b830b9) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28selftest/devtool: Add modify_localfiles_only test checking symlink pathTomasz Dziendzielski
If recipe uses only file:// fetcher devtool unpacks sources under oe-local-files/ and adds symlink in source root directory. We need to verify if the symlink in subdirectory has correct path. See [YOCTO #13738] for details. Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 044c90d152bfd1b2a23272df39327ba4cd862dff) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28ovmf-shell-image: image is only buildable on x86-64Ross Burton
This image is only buildable for x86-64, so add a COMPATIBLE assignment to ensure it isn't attempted on others. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit bdd8208675c8a0c0232c678804a8b62cd74f1d48) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28core-image-sato-sdk-ptest: these images need ptestRoss Burton
As this image isn't buildable without ptest (the packages won't exist), depend on the ptest DISTRO_FEATURE to ensure we don't try and build it. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 0fe856d726c6d9c35533e32e70fbe05ef2b88b17) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28dtc: improve reproducibilityOleksiy Obitotskyy
Makefile override CFLAGS, so -fmacro/debug-prefix-map optiions was omitted and binaries contains absolute patch to sources. Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit b58e808a087bbc0a5abd78fd34bb6f1c0c93ba25) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28devtool: Fix file:// fetcher symlink directory structureTomasz Dziendzielski
Add relative path if file is under directory. [YOCTO #13738] Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 19ddacc1b38f9ebb86a9359963ccc3c707f7125e) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28oeqa/selftest/cases/tinfoil.py: increase timeout 10->60s test_wait_eventYi Fan Yu
The test would timeout on autobuilders. This patch increases the timeout to 60s The test will now also exit as soon as we receive the 2 expected events Expected runtime is around 1s if successful Bug 14158 Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit be02aa9283f805de718badd5ea12c4968da8774f) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28externalsrc: Fix parsing error with devtool non-git sourcesTomasz Dziendzielski
If srcdir is under poky directory (e.g. devtool poky/build/workspace/sources) and is not a git repository then ${@srctree_hash_files(d)} will run "git rev-parse --git-dir" and detect poky directory as git-dir and run "'git', 'add', '-A', '.'], cwd=s_dir" trying to add srcdir but build dir is in .gitignore and latest git will fail with "The following paths are ignored by one of your .gitignore files: build" which will end with "ExpansionError during parsing". In this commit I added a check if git_dir is the same as git-dir from TOPDIR (which will detect poky directory) and if yes, then treat srcdir as non-git sources. Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 95fbac8dcad6c93f4c9737e9fe13e92ab6befa09) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28devtool: Fix source extraction for gcc shared sourceTomasz Dziendzielski
If do_patch task is disabled then prepare do_configure dependencies to fetch external sources and create symlink to ${S} in devtool workspace. [YOCTO #13036] Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 9e47319bfe62d289b90f7545a64dbdc1cbde7f1d) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28toolchain-shar-relocate.sh: Fix handling files with colonsOleksiy Obitotskyy yIEf0zt.mo
Files could contain colons in name and we should not use colons (':') as field separator. E.g. perl/python man pages packages. Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 50d2ed0689f1aed6f33b4992d37e2e991c99eb07) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28flex: Fix --noline option behaviorOleksiy Obitotskyy
Option --noline or -L does not handled properly. So generated code contains #line directives with file absolute path and prevents to create reproducible builds. Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 0bf2cb7dc2123f220accf1542c2ae4c4b4b8275a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28flex: Refresh patchzangrc
The patch changes the same file twice which causes issues with some patch tools (not used in YP by default). Refresh the patch to clean this up anyway. RP: Tweak commit message Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit cb6e65f8196fd6587c75c3ab2cf060c00a074ec6) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28flex: fix build with autoconf 2.70Ross Burton
autoconf 2.70 is coming soon which has some small behavioural fixes, so backport a patch from upstream to fix the build with that release. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 946610f2cc8cd42265ee3fab6c73ad4831aaeb4e) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28oeqa/ptest: print a warning if ptests failedAlexander Kanavin
This allows spotting ptest regressions without having hard ptest failures (for that full ptest stability should be achieved). Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 79b54d902df2788b0822b6c9cc14705ab00e6a5b) Signed-off-by: Steve Sakoman <steve@sakoman.com> (cherry picked from commit 5232c0b480eba4537c8db71c95189950011fb64d) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28sanity.bbclass: sanity check for if bitbake is present in PATHDorinda
If a user executes the environment script instead of sourcing it, there's an error about an empty element in PATH. This is because bitbake isn't present in environment variable PATH. Hence, this patch adds a sanity check to verify if bitbake is present in PATH and if bitbake isn't present issue a warning message. [YOCTO #13822] Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e08799913a7f207bc63e085eb98196fd61ed57bc) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28sanity: Verify that user isn't building in PSEUDO_IGNORE_PATHSDorinda
If a user builds in a path in PSEUDO_IGNORE_PATHS, random failures are generated. Hence this patch adds a sanity check in sanity.bbclass to ensure that a user isn't building in PSEUDO_IGNORE_PATHS. [YOCTO #14179] Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 7a681525e904914e938de25df5cc64209097d15d) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28wic: Optimise fstab modification for ext2/3/4 and msdos partitionsPaul Barker
The fix for [Yocto #13994] required the rootfs directory to be copied (using hardlinks if possible) when modifying the fstab file under wic. We can optimise this copy away for filesystems where we have the tools to modify the contents of the partition image after it is created. For ext2/3/4 filesystems we have the debugfs tool and for msdos/vfat filesystems we have the mcopy tool. So for any of these filesystems we skip the modification of the fstab file in the rootfs directory (and skip the associated copy unless it is otherwise necessary) and update the contents of fstab directly in the partition image. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 5fb8ae0e9159597d7eaa9307a3a8543800bf9405) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28wic: Copy rootfs dir if fstab needs updatingPaul Barker
By default, wic updates the /etc/fstab in the rootfs to include details of additional partitions described in the selected wks file. If this modification is performed in place, other tasks which create an image file from the rootfs directory (e.g. do_image_tar and do_image_ext4) will pick up the modified fstab file which would not be appropriate for those images as they do not include the additional partitions described in the wks file. wic does undo modifications to the fstab file once it has finished creating the filesystem image, however this leaves open a race condition if one of the other tasks reads the contents of the fstab file from the rootfs directory between the point where wic modifies the fstab file and the point where wic restores the files original content. This could be solved by adding a lockfile for tasks which use the rootfs directory to ensure that no other such task is reading the rootfs directory while do_image_wic is running. This would serialize several do_image_* tasks and result in slower builds, especially for large images. Another drawback of this solution is that it is hard to selectively optimise - adding lockfiles to do_image_* tasks would result in these tasks always being serialized even if no fstab modification will take place. An alternative solution is to copy the rootfs directory when fstab needs to be modified. The code to do this in wic already exists as it is needed when including or excluding content in the rootfs. This still results in an impact on build times but the copy uses hardlinks if possible (so little data is actually copied) and we can make selective optimisations to improve things. The rootfs copy will only take place if fstab modification is required (or if it was already needed to include or exclude rootfs content). We can also follow up with further optimisations after this commit. So this second solution is chosen. Fixes [Yocto #13994] Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ce682a73b7447652f898ce1d1d0416a456df5416) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28wic: Add --change-directory argumentRicardo Ribalda Delgado
This option allows to specify which part of a rootfs is going to be included, the same way the -C argument on tar. Thanks to this option we can make sure the permissions and usernames on the target partition are respected, and also simplify the creation of splitted partitons, not neeting to invoke external vars or using .wks.in files. Eg: part / --source rootfs --ondisk sda --fstype=ext4 --exclude-path=etc/    part /etc --source rootfs --fstype=ext4 --change-directory=etc Cc: Paul Barker <pbarker@konsulko.com> Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2265d089a58e1f78f26d623ee667c420cb1c3bd4) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28wic: Update pseudo db when excluding content from rootfsPaul Barker
To exclude content from the rootfs, wic makes a copy (using hardlinks if possible) of the rootfs directory and associated pseudo db, then removes files & directories as needed. However if these files and directories are removed using the python functions os.remove and shutil.rmtree, the copied pseudo db will not be updated correctly. For files copied from the original rootfs, if hardlinks were used successfully when copying the rootfs this should mean that the relevant inodes can't be reused and so the risk of pseudo aborts should be avoided. However, this logic doesn't apply for directories (as they can't be hardlinked) or for files added via the '--include-path' argument (as they weren't present in the original rootfs) and so there remains some risk of inodes being reused and the pseudo db becoming corrupted. To fix this, use the 'rm' command under pseudo when removing files & directories from the copied rootfs to ensure that the copied pseudo db is updated. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit d5db7e268947f0392c2126137571a44acd29ccd6) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28image_types_wic: Move wic working directoryPaul Barker
By default the wic working directory is placed under the output directory. When invoking wic under bitbake, the wic output directory is added to PSEUDO_PATHS_IGNORE to avoid issues with files being removed from outside a pseudo environment (see oe-core commit ad8f5532ff). However, wic will copy the rootfs directory into its working directory if it needs to add or remove content before creating a filesystem image. This copy of the rootfs directory must be tracked by pseudo in order to keep the permissions correct in the resulting image. So we can't have the wic working directory under a path in PSEUDO_PATHS_IGNORE unless we like broken permissions. To fix this the new '-w' argument to wic is used to move the working directory away from the output directory. Note that wic deletes the temporary working directory automatically when it finishes creating an image so users won't normally see the 'tmp-wic' directory under WORKDIR. Fixes [Yocto #14129] Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 4d07169499c47fa9dc759e6f81843416a6dc25c5) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28wic: Ensure internal workdir is not reusedPaul Barker
If a path is specified for the internal wic working directory using the -w/--workdir argument then it must not already exist. Re-using a previous workdir could easily result in rootfs and intermediate files from a previous build being added to the current image. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2e40c8d4109024ff704c5ce40d98050ca7f34dd5) Signed-off-by: Steve Sakoman <steve@sakoman.com> (cherry picked from commit 5dcdb76f89c2e5bbc383e2921589482cd1c51491) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28wic: Allow exec_native_cmd to run HOSTTOOLSPaul Barker
This allows programs from HOSTTOOLS (e.g. 'install', 'rm', 'mv', etc) to be more easily executed by wic. Without this change only programs from an actual *-native recipe built by bitbake can be executed by wic. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 8eb186acdecfbb3151c9a0ab148358e3fe5cce39) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28wic: Add workdir argumentPaul Barker
This allows the path for the temporary workdir used by wic to be set when running wic from bitbake or directly from the command line. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2e7314ac3a3cab89de93c932e8efc75de0feb0a7) Signed-off-by: Steve Sakoman <steve@sakoman.com> (cherry picked from commit a2308800b7eb5215982db7269d74d6292075f19f) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28pseudo: Update for arm host and memleak fixes/cleanupRichard Purdie
Pulls in: makewrappers: support architecture-overrides in wrapper modifiers makewrappers: fix Python 2 hangover Fix some memory leaks Disable deprecated function warnings Silence switch block warnings pseudo_util: don't overrun strings when looking for keys Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 11a3a9203ad595e7fa92acf442a7f3216d6e3830) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28pseudo: Add lchmod wrapperRichard Purdie
New versions of glibc have an lchmod function so we need to wrap it. Identified through a reproducibility issue in initramfs-base where /dev/console created by mknod from coreutils changed permissions depending on the host distro (mknod used the gnulib wrapper on most hosts but newer ones used the libc call). [YOCTO #14162] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 20a645664977530e602e1ac97e8dc0962e730e6c) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28bitbake.conf: Add /run/ to PSEUDO_IGNORE_PATHSRichard Purdie
Builds were failing on WSL2 which turns out to be due to accesses to /run/ on those systems. Add this to PSEUDO_IGNORE_PATHS to fix builds on WSL2. [YOCTO #14175] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 1d1bf51217e8b4d54af28739d3271484ee5a7974) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28license.bbclass: Add COMMON_LICENSE_DIR and LICENSE_PATH dirs to ↵Martin Jansa
PSEUDO_IGNORE_PATHS * now without ${COREBASE}/meta in PSEUDO_IGNORE_PATHS after: 73d538f207 bitbake.conf: Prevent pyc file generation in pseudo context the do_package tasks are failing when LICENSE_CREATE_PACKAGE is enabled pseudo.log shows that it's because of license texts copied from ${COREBASE}/meta: path mismatch [46 links]: ino 96733640 db '/OE/build/tmp-glibc/work/all-oe-linux/foo/1.0/image/usr/share/licenses/foo/generic_Apache-2.0' req '/OE/build/openembedded-core/meta/files/common-licenses/Apache-2.0'. Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 39423a33595e7ade82fc88f55823660f8532cb84) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28bitbake.conf: Prevent pyc file generation in pseudo contextPaul Barker
This also effectively reverts commit b6d30c21b0: bitbake.conf: Extend PSEUDO_IGNORE_PATHS to ${COREBASE}/meta The contents of ${COREBASE}/meta were ignored as pyc files could be generated for the contents of the lib subdirectory if python modules were imported within a pseudo context. However this doesn't protect us from pyc files being generated in the lib directories for other layers. It's far better to tell python not to produce pyc files when running under pseudo (by setting the PYTHONDONTWRITEBYTECODE variable) as this will cover any location where pyc files could possibly be created. This variable is set in FAKEROOTBASEENV so that it applies to the bitbake-worker instance for fakeroot tasks, preventing pyc files from being generated for imports in python tasks themselves. Also add a test case to ensure that pyc files are not created in tasks which are executed under pseudo. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 73d538f20743017a44cea4c20dbe09a0327cfc71) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28wic: Pass canonicalized paths in PSEUDO_IGNORE_PATHSPeter Kjellerstedt
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 55618cbd58d6784a82e773f323723be6f722232f) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28bitbake.conf: Canonicalize paths in PSEUDO_IGNORE_PATHSPeter Kjellerstedt
Use oe.path.canonicalize() to canonicalize the paths in PSEUDO_IGNORE_PATHS before passing them to pseudo. This is needed since pseudo will compare them to paths that are canonicalized. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 1f2a497daa09cf3459e27ad6e0e8513938b52c79) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28lib/oe/path: Add canonicalize()Peter Kjellerstedt
oe.path.canonicalize() is used to canonicalize paths (i.e., remove symbolic links and "..", and make them absolute). It takes a string with paths separated by commas, and returns the canonicalized path in the same format. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 282b19c0e27488ec119f00fb2542ffdc1af54e2a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28pseudo: Drop patches merged into upstream branchRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 7386a116222979e6de60c39d2c094d5f216fb101) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28distutils3: allow setup.py to be run from a different directory to ${S}Jack Mitchell
Sometimes setup.py can be buried deep in a source tree. This has traditionally been solved with setting S to the subdirectory in the source. However with the new pseudo changes, some python modules make changes to files beneath ${S}, for example: S = "${WORKDIR}/git/python/pythonmodule" then in setup.py it works with source code in a relative fashion, such as: ../../src This causes pseudo to abort as it isn't tracking the paths. Therefore implement the variable DISTUTILS_SETUP_PATH so that recipes can use: S = "${WORKDIR}/git" DISTUTILS_SETUP_PATH = "${S}/python/pythonmodule" inherit distutils3 This allows the full source tree to be monitored, while distutils can run setup.py from a location other than ${S}. Signed-off-by: Jack Mitchell <ml@embed.me.uk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ddcc349cede0c4fe1909df1ded7b0a7c509cd758) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28pseudo: Update to print PSEUDO_LOGFILE in abort message on path mismatchesTomasz Dziendzielski
Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 9259d684415e3e7923de74359a4ed3487e0e9da7) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28pseudo: Simplify pseudo_client_ignore_path_chroot()Peter Kjellerstedt
This also plugs a memory leak in pseudo_client_ignore_path_chroot(). Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit d8dddd5054a1c4e20a3e32fa9ab31f5859d6fbb6) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28uninative: Don't use single sstate for pseudo-nativeRichard Purdie
pseudo-native is a bit special. It conditionally compiles in support for xattr, statx and statvfs amongst other options. If a pseudo-native binary is used on a system where these functions are present but it wasn't compiled in we see hard to debug permissions problems. An example is the devtool.DevtoolExtractTests.test_devtool_deploy_target oe-selftest which shows a cryptic error: File "/home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/lib/oeqa/selftest/cases/devtool.py", line 1388, in test_devtool_deploy_target self.assertEqual(filelist1, filelist2) File "/usr/lib64/python3.9/unittest/case.py", line 831, in assertEqual assertion_func(first, second, msg=msg) File "/usr/lib64/python3.9/unittest/case.py", line 1037, in assertListEqual self.assertSequenceEqual(list1, list2, msg, seq_type=list) File "/usr/lib64/python3.9/unittest/case.py", line 1019, in assertSequenceEqual self.fail(msg) File "/usr/lib64/python3.9/unittest/case.py", line 670, in fail raise self.failureException(msg) AssertionError: Lists differ: ['-rwxr-xr-x 6000 6000 /etc/init.d/mdmonitor', '-rw-r-[10124 chars]n.8'] != ['-rwxr-xr-x root root /etc/init.d/mdmonitor', '-rw-r-[10124 chars]n.8'] First differing element 0: '-rwxr-xr-x 6000 6000 /etc/init.d/mdmonitor' '-rwxr-xr-x root root /etc/init.d/mdmonitor' This is due to a version of pseudo without statx being used on a system where ls uses statx, hence the files are displayed as 6000.6000 instead of root.root. Avoid this by always building pseudo-native for the specific distro in question rather than using a universal sstate feed. This hopefully fixes one of the mysterious AB-INT issues. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 6e3785a3f1f3cf68f5fe101cd6bebe91db165973) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28bitbake.conf: Exclude ${CCACHE_DIR} from pseudo databaseMingli Yu
When ccache enabled as below: INHERIT += "ccache" CCACHE_DIR = "/path/build/ccache" There comes do_install failure for some recipes randomly, take linux-libc-headerswhen as example. $ cat /path/build/tmp/work/corei7-64-wrs-linux/linux-libc-headers/5.8-r0/pseudo/pseudo.log [snip] path mismatch [1 link]: ino 243004209 db '/path/build/ccache/6/stats' req '/path/build/ccache/7/stats.lock'. [snip] Exclude ${CCACHE_DIR} from pseudo database to fix the potential do_install failure. Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit b65e5280bf9e7f1f9c8e6acabab79bcf209e5342) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-28tcl: adapt to potential pseudo changesMingli Yu
It failed as below when rerun do_install for tcl: $ bitbake tcl $ bitbake tcl -f -cinstall [snip] | NOTE: make -j 72 DESTDIR=/build/tmp/work/core2-64-wrs-linux/tcl/8.6.10-r0/image install | abort()ing pseudo client by server request. See https://wiki.yoctoproject.org/wiki/Pseudo_Abort for more details on this. | /build/tmp/work/core2-64-wrs-linux/tcl/8.6.10-r0/temp/run.do_install.3490694: line 184: 3499214 Aborted (core dumped) make -j 72 "$@" By default the S is ${WORKDIR}/${BPN}-${PV}, but after unpack, the tcl source [1] unpacked to ${WORKDIR}/${BPN}${PV} and all the files under ${WORKDIR}/${BPN}${PV} are acutally the source files. But the the main Makefile.in is under ${WORKDIR}/${BPN}${PV}/unix for tcl, so there is below logic in tcl recipe: S = "${WORKDIR}/${BPN}${PV}/unix" To adapt the potential pseudo changes, there is a general logic to exclude ${S} from pseudo database in base.bbclass in [2]. That's to say, just the dir ${WORKDIR}/${BPN}${PV}/unix is excluded from the pseudo database. But it's not enough for tcl, we need to exclude the actual source dir ${WORKDIR}/${BPN}${PV} from pseudo database specifically to fix the above do_install failure. [1] https://downloads.sourceforge.net/tcl/tcl8.6.0-src.tar.gz [2] https://git.openembedded.org/openembedded-core/tree/meta/classes/base.bbclass#n396 Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 0d835f8069a336fd6bab1058d4e605a81c844212) Signed-off-by: Steve Sakoman <steve@sakoman.com>