summaryrefslogtreecommitdiffstats
path: root/meta/lib
Commit message (Collapse)AuthorAgeFilesLines
* Revert "sstatesig.py: show an error instead of warning when sstate manifest ↵Anuj Mittal2021-03-281-1/+1
| | | | | | | | | | | | isn't found" This is causing problems. See: https://lists.openembedded.org/g/openembedded-core/message/149374 This reverts commit da6b76bf6152b2a60c6a31756c287289c3559a74. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/reproducible: Don't call sync between each file compareRichard Purdie2021-03-281-1/+1
| | | | | | | | | | | | | Calling sync between each file compare is horrible performance wise as we compare thousands of files. We don't care about IO latency here so disable. (From OE-Core rev: 1fddd6b891265956e0a26963459e7511d757cace) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 25f78abd8bbeb201fd9452e7983e015027954948) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/pam: Need shadow installed for the testsKhem Raj2021-03-101-0/+3
| | | | | | | | | | | | | | | | Distros may not use shadow for login manager secondly login --help returns 1 only with shadow provided login utility, with busybox it returns normal 0, the testcase clearly assumes shadow being part of image, therefore add needed checks to ensure the pre-requisites are met (From OE-Core rev: 0535f0bbc792a5124a375e087a3a5b0c27c19456) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 0820aeba74869bf6e85b200f39bc610a43ab9a7a) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstatesig.py: show an error instead of warning when sstate manifest isn't foundMartin Jansa2021-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * not sure if there are some valid use-cases for missing manifest, but recently I'm seeing increasing number of build failures where something from native recipe is missing (seen it with pseudo, autoconf, nodejs recently) and the only indication that something is wrong (before showing sometimes misleading error like: recipe-sysroot-native/usr/bin/node: No such file or directory is this warning: NOTE: Running task 7844 of 12431 (/meta-oe/meta-oe/recipes-devtools/nodejs/nodejs_12.20.2.bb:do_prepare_recipe_sysroot) NOTE: recipe nodejs-12.20.2-r0: task do_prepare_recipe_sysroot: Started WARNING: nodejs-12.20.2-r0 do_prepare_recipe_sysroot: Manifest /BUILD/sstate-control/manifest-x86_64_ubuntu-18.04-nodejs-native.populate_sysroot not found in x86_64 x86_64_ubuntu-18.04 (variant '')? NOTE: Running task 7845 of 12431 (/meta-oe/meta-oe/recipes-devtools/nodejs/nodejs_12.20.2.bb:do_unpack) NOTE: recipe nodejs-12.20.2-r0: task do_unpack: Started WARNING: nodejs-12.20.2-r0 do_prepare_recipe_sysroot: Manifest /BUILD/sstate-control/manifest-x86_64_ubuntu-18.04-nodejs-native.populate_sysroot not found in x86_64 x86_64_ubuntu-18.04 (variant '')? NOTE: recipe nodejs-12.20.2-r0: task do_prepare_recipe_sysroot: Succeeded if I rebuild that native dependency, then it gets fixed and I don't see these failures in clean builds (as without sstate and with empty TMPDIR), only in incremental builds * but if there isn't valid reason for missing manifest file, then I think it would be better to error early (or even bb.fatal()) (From OE-Core rev: da6b76bf6152b2a60c6a31756c287289c3559a74) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 95607a26854d873399d2b9d7e5fcbffc0cbdba4c) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/commands: Fix compatibility with python 3.9Richard Purdie2021-03-101-2/+2
| | | | | | | | | | | Python 3.9 dropped isAlive() so use the preferred is_alive(). (From OE-Core rev: f101408bd43a5d41cb1710a7a848370292f84290) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 9bb06428cbb2ac0f3d98a1696f050d3393385503) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe/recipeutils: Fix copying patches when BBLAYERS entries are not normalisedAndrei Gherzan2021-03-101-1/+1
| | | | | | | | | | | | | | | | | | `devtool` uses `copy_recipe_files` for the upgrade operation when creating the new, workspace recipe. Before handling the copy operations, the function checks the entry in `SRC_URI` against `FILE` while in turn uses absolute paths. When BBLAYERS contains entries that are not normalised, this check will fail resulting in having the recipe in the workspace without the initial patches. Signef-off-by: Robert Drab <robert.drab@huawei.com> (From OE-Core rev: 185a874d29706c65fb89920c4177fd6a0bb14711) Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 777fc24ab2c332954b56dac28cd9b3032808828c) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* df.py: Add feature check for read-only-rootfsWes Lindauer2021-03-101-0/+2
| | | | | | | | | | | | | | If the target is using a read-only rootfs, the available space on '/' will be zero. This will cause the test to incorrectly fail and skipping seems appropriate in this case. (From OE-Core rev: ca408f6c78c2a526c699e3978634c85d2fbd0cfe) Signed-off-by: Wes Lindauer <wesley.lindauer@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit af1dbea3c9b9b42a3e6803b231e425423d70e210) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: reproducible: Add more loggingJoshua Watt2021-02-261-0/+3
| | | | | | | | | | | | | | The reproducible build tests can take a long time, so having more logging messages at various points in the build can help debug where the build is taking a long time. (From OE-Core rev: 3ea201b2bcb40a3de6a2e36a43859fe354706b26) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 6b792afe8759d62af8e713b86dad8f6721961a05) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: reproducible: Fix SSTATE_MIRRORS variableJoshua Watt2021-02-261-1/+1
| | | | | | | | | | | | | The SSTATE_MIRRORS variable was misspelled, which allowed the "clean" test build to pull from the mirror. (From OE-Core rev: 99fc5a5847b82620904a0e120d92cad6bb79021a) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e42497bd84d0bb370a9f7b0448bff29f01fd1b0c) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager/deb: Fix image generation with package removalRichard Purdie2021-02-261-0/+4
| | | | | | | | | | | | | | | | | | | When building SDKs with the deb backend you could see errors like: Setting up nativesdk-python3-ndg-httpsclient (0.5.1-r0) ... mkdir: cannot create directory ‘/usr/lib/opkg’: Permission denied dpkg: error processing package nativesdk-python3-ndg-httpsclient (--configure): which is due to environment misconfiguration when removing packages. Fix this by setting the same environment variables as used for installation. (From OE-Core rev: ffdd5e3d61995f78aa57a7f45d21ebc1513cb5a4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit f23c7e319a192ada14bb9a82822ef2967309aaea) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* deb: export INTERCEPT_DIR for remove actionsRichard Leitner2021-02-261-0/+2
| | | | | | | | | | | | | | | | | | | | During the do_populate_sdk task apt-get purge is called by deb's remove function. This fails with error messages similiar to the following one if any of the included packages uses intercepts as the INTERCEPT_DIR isn't exported: .../*.postinst: line 4: /postinst_intercept: No such file or directory Therefore fix it by exporting the INTERCEPT_DIR variable within the remove function. (From OE-Core rev: 697c75071932a48ec8d34b778fca68e18bec433a) Signed-off-by: Richard Leitner <richard.leitner@skidata.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit f18adf53dd4bf5dd3adef82b2dcc34a6cdfd0c89) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: debug mode to keep tmp directoryLee Chee Yang2021-02-261-0/+2
| | | | | | | | | | | | | | | | | | files in wic tmp directory can be usefull for debugging, so do not remove tmp directory when wic create run with debugging mode (-D or --debug). also update wic.Wic.test_debug_short and wic.Wic.test_debug_long to check for tmp directory. [YOCTO#14216] (From OE-Core rev: 04d334d5bc5353c39c5059d25d97f111a9e368d9) Signed-off-by: Lee Chee Yang <Chee.Yang.Lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a122e2418b67d38f691edcf8dd846c167d6b4fa9) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: drop _PYTHON_SYSCONFIGDATA_NAME hacksAlexander Kanavin2021-02-111-4/+0
| | | | | | | | | | (From OE-Core rev: 94a8eff9a95313e29683ebaecb83378a3c776b48) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 7901859e38de06c56b8535a8425e76cb114c57dc) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/selftest: test_permissions also test bitbake imageLee Chee Yang2021-02-111-0/+16
| | | | | | | | | | | | | | | | existing test case test_permissions use Wic command as standalone tools to create wic image and check that wic image for permissions. add extra steps to the test case to also check against image build using bitbake do_image_wic. (From OE-Core rev: d0a7383ca3e8ac206c88ac3cc1b8e1f18b439964) Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 551ce73a90757ba43501fe5cf9ac84a7b77de549) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstatesig: Add descriptive error message to getpwuid/getgrgid "uid/gid not ↵Tomasz Dziendzielski2021-02-111-2/+4
| | | | | | | | | | | | | | | | | | | | | | | found" KeyError If path is not owned by any user installed on target it gives insufficient error "getpwuid(): uid not found" which may be misleading. This exception occurs if uid/gid of path was not found in PSEUDO_PASSWD files, which simply means the path is owned by host user and there is host user contamination. Add more information to the exception message to make it easier for user to debug. [YOCTO #14031] (From OE-Core rev: ca324a6fef99eef638a3577543592443a043f4e7) Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 38540b59ed4ec8632e30a5fd6364b010d9da8470) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/patch.py: Don't return command stderr from runcmd functionTomasz Dziendzielski2021-02-051-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | If a function returns any stderr it will be passed to extractPatches and used as path to patch. For example subprocess command output can be: | sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) | /tmp/oepatchhuqle8fj/0001-foo.patch | /tmp/oepatchhuqle8fj/0002-bar.patch that will result in: | FileNotFoundError: [Errno 2] No such file or directory: 'sh:' To fix this I separated output, made the function return stdout and print stderr only in case of command error. (From OE-Core rev: 482589e2cc7c3ddeefb0a0fb98d97a9cbb18c9ec) (From OE-Core rev: 1dadeb58e88c4d953be612654fe4a76b51ff0553) Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 5e2450731c1f70fb72af0b8349905b359d3cd2b1) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve_check: add CVE_VERSION_SUFFIX to indicate suffix in versioningLee Chee Yang2021-02-052-20/+31
| | | | | | | | | | | | | | | | | | | | | | | add CVE_VERSION_SUFFIX to indicate the version suffix type, currently works in two value, "alphabetical" if the version string uses single alphabetical character suffix as incremental release, blank to not consider the unidentified suffixes. This can be expand when more suffix pattern identified. refactor cve_check.Version class to use functools and add parameter to handle suffix condition. Also update testcases to cover new changes. (From OE-Core rev: 5dfd5ad5144708b474ef31eaa89a846c57be8ac0) (From OE-Core rev: 73f8c25a44ee33866a8fa61824437285cea96249) Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 86b42289bda5bc2a4eff221ab476f170dd3d3794) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve-check: replace Looseversion with custom version classLee Chee Yang2021-02-052-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way distutils.version.LooseVersion compare version are tricky, it treat all these ( "1.0-beta2", "1.0-rc1", "1.0A", "1.0p2" and "1.0pre1") as greater version than "1.0". This might be right for "1.0A" and "1.0p1" but not for the rest, also these version could be confusing, the "p" in "1.0p1" can be "pre" or "patched" version or even other meaning. Replace Looseversion with custom class, it uses regex to capture common version format like "1.1.1" or tag format using date like "2020-12-12" as release section, check for following known string/tags ( beta, rc, pre, dev, alpha, preview) as pre-release section, any other trailing characters are difficult to understand/define so ignore them. Compare release section and pre-release section saperately. included selftest for the version class. [YOCTO#14127] (From OE-Core rev: 6ced85e9ddd3569240f1e8b82130d1ac0fffbc40) (From OE-Core rev: 02a44b507a1e49a4c460f3e1bec92832b71dfe08) Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3807c6d9a78ac8ade24c9c69cfe2b9624c49a20d) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/cases/tinfoil.py: increase timeout 10->60s test_wait_eventYi Fan Yu2021-02-051-2/+4
| | | | | | | | | | | | | | | | | | | | 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 (From OE-Core rev: be02aa9283f805de718badd5ea12c4968da8774f) (From OE-Core rev: c925b83cbd31345f788515ca8b642b14e5e11898) Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 1d803b70e599521ad0c743f49007e6fc5c055d1c) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/utils: Return empty string in parallel_makeTomasz Dziendzielski2021-01-271-1/+1
| | | | | | | | | | | | | | | | In cmake.bbclass we set CMAKE_BUILD_PARALLEL_LEVEL using parallel_make function and if PARALLEL_MAKE is set to empty string then this variable is exported as "None" causing cmake to fail with: "'CMAKE_BUILD_PARALLEL_LEVEL' environment variable invalid number 'None' given." (From OE-Core rev: 7ee65c50f7a38c22e3fb43b0c89e81aff24a2b7f) Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2f790ded554a52ac18d1c28002142f9c62abec8b) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest: Add argument to keep build dirPaul Barker2021-01-181-4/+13
| | | | | | | | | | | | | | | | The oe-selftest code already keeps the selftest build directory in place if any tests failed. By default the build directory is deleted if all tests pass but there may be cases where it's desirable to keep this directory around, for example to compare intermediate files between passing and failing test runs. (From OE-Core rev: f41c17a155e9bfd233bc2166c6ab7f5e547f39fa) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 67aa7069dbe8f5f5f186eb67708ece5c4bd42976) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake.conf: Prevent pyc file generation in pseudo contextPaul Barker2021-01-121-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 7aa1ae139b9131faff04c0ed156fd8efcde114f6) 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: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/path: Add canonicalize()Peter Kjellerstedt2021-01-121-0/+21
| | | | | | | | | | | | | | | 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. (From OE-Core rev: 5c9931e0ffcb1663f529289f2e03c549fdb3c4da) 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: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/commands: Ensure sync can be found regardless of PATHRichard Purdie2021-01-121-0/+3
| | | | | | | | | | | | Avoid command not found errors shown in selftest logs due to changes to PATH settings which also risks intermittent problems due to IO load. (From OE-Core rev: 8d7f1c1574ceaff11966331855491ef7c96fd110) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 40bcae01b0be2f293dea9ab42c6b7f8f47827cf5) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/cases/devtool.py: fix typo in ignore_patterns callSteve Sakoman2021-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Causes intermittent autobuilder errors: 2020-12-21 19:34:23,035 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last): File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/lib/oeqa/selftest/cases/devtool.py", line 68, in setUpModule bb.utils.edit_bblayers_conf(bblayers_conf, None, None, bblayers_edit_cb) File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/bitbake/lib/bb/utils.py", line 1460, in edit_bblayers_conf (updated, newlines) = edit_metadata(newlines, ['BBLAYERS'], handle_bblayers) File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/bitbake/lib/bb/utils.py", line 1290, in edit_metadata if handle_var_end(): File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/bitbake/lib/bb/utils.py", line 1215, in handle_var_end (newvalue, newop, indent, minbreak) = varfunc(in_var, full_value, op, newlines) File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/bitbake/lib/bb/utils.py", line 1425, in handle_bblayers res = edit_cb(layer, canonicalise_path(layer)) File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/lib/oeqa/selftest/cases/devtool.py", line 60, in bblayers_edit_cb shutil.copytree(pth, destdir, ignore=ignore_patterns('*.pyc', '__pycache__')) NameError: name 'ignore_patterns' is not defined (From OE-Core rev: d8bdee355b4d42f0488ed91a3e5939ae3e574c92) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* uninative: Don't use single sstate for pseudo-nativeRichard Purdie2020-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: d3ec2ecdf8915a9fb1c4ea36a29b05090abf089c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 6e3785a3f1f3cf68f5fe101cd6bebe91db165973) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/lib/oe/reproducible.py: gitsm:// works just as fine as git:// for ↵Alexander Kanavin2020-12-181-1/+1
| | | | | | | | | | | | | | | timestamps This in particular addresses vulkan-samples reproducibility which made me scratch my head for a while. (From OE-Core rev: 9010bd445740344a9a3c983e5767552eb684af12) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 4a2936126f12eeacecced051fa339c32c1f16576) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/lib/oeqa/manual/oe-core.json: Update test_bitbake_devshellsangeeta jain2020-12-181-1/+1
| | | | | | | | | | | | | Update command used for cross compilation to include ${CONFIGUREOPTS} to ensure right arguments are passed for cross compiling on any host. (From OE-Core rev: b1a1e936169d9db8d5de46aace9370f5e695c24d) Signed-off-by: sangeeta jain <sangeeta.jain@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e995e67bc7a3d30adf9f8d0d2f4df92a941baeae) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/devtool: use Yocto mirror for pv-1.5.3 tarballRoss Burton2020-12-181-1/+1
| | | | | | | | | | | | | | Some of the selftests failed over the weekend with "access denied" errors fetching this tarball. Instead of relying on upstream when fetching the tarball, use the Yocto source mirrors instead. (From OE-Core rev: bae9a74f4fb86d91721b493e97da5a5034c62828) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 988e0ff4131f46dfed14516ff5f61d72b9fb6941) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/context: initialize _run_end_timeKonrad Weihmann2020-11-201-0/+1
| | | | | | | | | | | | | with _run_start_time as value. For partial results of interrupted runs, this info might be otherwise missing for at least one testcase (From OE-Core rev: a91308482e1bb524df413d4342a9ebb472314663) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 1c5e8baf57fa2a33b9ef507b11d9ea9acaa77238) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/context: expose results as variableKonrad Weihmann2020-11-201-0/+3
| | | | | | | | | | | | | | | register an unittest handler for testresults and expose it as variable result. With this even partial results from an interrupted test suite run can be made available (From OE-Core rev: ba41688f7f0cb44293321df6c69fe47ac1804d63) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a97ae47525157871b6c098ffc352293e365a4335) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/buildhistory_analysis: Avoid tracebacks from file comparision codeRichard Purdie2020-10-301-2/+4
| | | | | | | | | | We're seeing tracebacks from buildhistory analysing the python 3.8 -> 3.9 upgrade due to the significant file renames. Avoid these by checking before removal as they can happen multiple times. (From OE-Core rev: b1eb390bbcb995c0da70478e17f9170721c75341) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* deb: replace deprecated apt force-yes argumentRichard Leitner2020-10-301-1/+1
| | | | | | | | | | | | | | apt-get deprecated --force-yes in favor of various options starting with --allow [1]. Replace it to avoid the following warning: W: --force-yes is deprecated, use one of the options starting with --allow instead. [1] https://salsa.debian.org/apt-team/apt/-/blob/master/debian/changelog (From OE-Core rev: 4af737e2643f498d1ff4c387207bd8c4f3d405b8) Signed-off-by: Richard Leitner <richard.leitner@skidata.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstatesig: Log timestamps for hashequiv in reprodubile builds for do_packageRichard Purdie2020-10-301-0/+6
| | | | | | | | | | | | | Currently if a task generates the same output with different timestamps, hasequiv won't detect it but reproducibile builds will fail tests due to the different timestamps. Add do_package timestamps to the hash when reproducibile builds are enabled to avoid this. (From OE-Core rev: 11e8200ccec765ff6a4263e06512e5751eca261a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* imagefeatures: New test case, test_empty_image, addedKhairul Rohaizzat Jamaluddin2020-10-261-1/+11
| | | | | | | | | | | | | | | | | | | An empty image build file exists under the meta-selftest folder, test-empty-image.bb, which builds an image with no additional packages. However, there were no further selftest created to verify its emptiness This change consists of the selftest related to the said image to verify its emptiness and the 'import glob' moved as global import instead of local import. The expected outcome of the test should be TRUE or 1 if the .manifest file content is empty. [YOCTO #8455] (From OE-Core rev: 1f8bdaa746c6e7efc07789256d5c050780c81f4c) Signed-off-by: Khairul Rohaizzat Jamaluddin <khairul.rohaizzat.jamaluddin@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: Add sync call to command executionRichard Purdie2020-10-203-16/+15
| | | | | | | | | | | | We previously put a sync call into devtool to try and combat the bitbake timeout issues on the autobuilder. It isn't enough as the timeouts occur mid test. They are also occurring on non-devtool tests. Add in sync calls around command execution instead. (From OE-Core rev: ceca5ed121e2b54415a7ab3a217882e4ea86923a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs: introduce IMAGE_LOG_CHECK_EXCLUDESKonrad Weihmann2020-10-201-0/+2
| | | | | | | | | | | | | | | When using rpm as package manager and trying to install a file called '/usr/share/doc/What to when an Error occurs.txt' log_check falsely errors out on the build, because used regex match on 'DEBUG: Removing manifest: /path/usr/share/doc/What to when an Error occurs.txt'. To handle such cases introduce IMAGE_LOG_CHECK_EXCLUDES, to allow user to add custom exclude regex to log_check exclude list (From OE-Core rev: 7c7555a79b8bdef0a8d7fbd57e9ddf059066de76) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* IMAGE_LOCALES_ARCHIVE: add option to prevent locale archive creationMichael Thalmeier2020-10-131-6/+7
| | | | | | | | | | | | Under some circumstances it is not desirable to create a combined locale archive (/usr/lib/locale/locale-archive). The new variable IMAGE_LOCALES_ARCHIVE defaults to '1', so the default behaviour is not changed. (From OE-Core rev: 8d78b819c2ec33fce3a34254fa90864ee5fa7617) Signed-off-by: Michael Thalmeier <michael.thalmeier@hale.at> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/runtime_test: Exclude gpg directory from pseudo databaseRichard Purdie2020-10-101-0/+1
| | | | | | | | | Avoid pseudo abort()s like: path mismatch [1 link]: ino 6295376 db '/tmp/oeqa-feed-sign-2mw7z81v/S.gpg-agent.yocto-native' req '/tmp/jwkivmu6'. (From OE-Core rev: 189630ca6cdf7ceb6cf9b8f9d86c58997f505efc) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake-bblayers/create: Make the example recipe print its messageYoann Congal2020-10-101-1/+3
| | | | | | | | | | | | | | The example recipe is setup to print a message using bb.plain() in the "do_build" task but this task is "noexec" so the message never prints. This might be confusing. This moves the message printing into another "do_display_banner" task and add it to the do_build "before" list. (From OE-Core rev: 252385bef9b226f32691b8513869ea3e41813b40) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest: add test for recipes with patches in overridesRoss Burton2020-10-081-0/+20
| | | | | | | | | | devtool doesn't quite behave right when a recipe has patches applied in overrides, so add a test case to exercise that behaviour. (From OE-Core rev: ad89c3254cc6c06026f1bebe23ec3717c1546633) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest: skip npm tests if nodejs-native isn't availableRoss Burton2020-10-082-0/+8
| | | | | | | | | | The tests are actually skipped if meta-oe isn't present which isn't quite the same thing, but hopefully close enough. (From OE-Core rev: d22ed015d8f38241acb783e1a468fb15d4317670) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* base/bitbake.conf: Enable pseudo path filteringRichard Purdie2020-10-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a pretty big change to the way pseudo operates when used in OpenEmbedded. Normally, pseudo monitors and logs (adds to its database) any file created or modified whilst in a fakeroot environment. There are large numbers of files we simply don't care about the permissions of whilst in that fakeroot context, for example ${S}, ${B}, ${T}, ${SSTATE_DIR}, the central sstate control directories, This change uses new functionality in pseudo to ignore these directory trees, resulting in a cleaner database with less chance of "stray" mismatches if files are modified outside pseudo context. It also should reduce some overhead from pseudo as the interprocess round trip to the server is avoided. There is a possible complication where some existing recipe may break, for example, we found a recipe which was writing to "${B}/install" for "make install" in do_install and since we listed ${B} as not to be tracked, there were errors trying to chown root for files in this location. This patch fixes a few corner cases in OE-Core when used with this new ignore list: * The archiver directory matched a "${WORKDIR}/deploy*" pattern so was renamed to something else since that directory does need its root permissions * The ${S} and ${B} ignoring is conditional on them being different to ${WORKDIR} * package_write_* task output (the debs/rpms/ipks) are now owned by the build user so we don't want the file ownership information in the hashequiv outhash calculation even if they are built under pseudo. * The fontcache postinstall intercept is run under qemu outside of pseudo context so delete files it may delete up front where pseudo can see this. * SSTATE_DIR is in PSEUDO_PATHS_IGNORE, which is in FAKEROOTENV which is cached by bitbake. We therefore need to trigger reparsing if this changes, which means SSTATE_DIR can be in BB_HASHBASE_WHITELIST but not BB_HASHCONFIG_WHITELIST. Rework the variables to handle this. This otherwise breaks some of our sstate tests in oe-selftest. * Ignore the temp directory wic uses for rebuilding rootfs. (From OE-Core rev: ad8f5532ffaead9a5ad13e1034fe9e5e1b7979f4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/devtool: Add sync call to test teardownRichard Purdie2020-09-301-0/+7
| | | | | | | | | | Devtool tests are heavy on IO and if bitbake can't write out its caches, we see timeouts. Call "sync" around the tests to ensure the IO queue doesn't get too large, taking any IO hit here rather than in bitbake shutdown. (From OE-Core rev: ce265cf467f1c3e5ba2edbfbef2170df1a727a52) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testsdk.py: remove workspace/sources to avoid failure in case of multilibChen Qi2020-09-301-0/+3
| | | | | | | | | | | | | | | | | | When multilib is enabled, there are multiple environment scripts, and the test cases for eSDK are executed for each environment script. And we will have the following problem when executing test cases for the second environment script. ERROR: Source tree path /.../workspace/sources/librdfa already exists and is not empty So after executing test cases for one environment, we clean up the sources diretory to avoid such failure. (From OE-Core rev: f55924d8d2258ca8b60c46d78ae2de06add59798) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/cases/devtool.py: avoid .pyc raceTim Orling2020-09-301-1/+2
| | | | | | | | | | | | | | | | | In certain conditions, most likely under heavy load on the AutoBuilder, the prebuilt .pyc files are attempting to be executed before they have been completely copied. Avoid this by not copying the .pyc files (nor the __pycache__ directory). The impact of python3-native recreating the .pyc files should hopefully be negligible. YOCTO#13421 YOCTO#13803 (From OE-Core rev: 4df098aeecd589ddd11a883e281285588a6966ca) Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* target/ssh.py: Add dump_target supportSaul Wold2020-09-301-0/+2
| | | | | | | | | | | | | | This adds the dump_target support when the ssh command fails with a 'No route to host'. This is will provide additional data when a Qemu target fails to respond during autobuilder testing. This does not fix 14002 [0], but may help track down why qemu looses networking [0] https://bugzilla.yoctoproject.org/show_bug.cgi?id=14002 (From OE-Core rev: cef1a2b03b359c018911abc29db1895d0f46814c) Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage: Add testimage_dump_target to kwargsSaul Wold2020-09-301-0/+4
| | | | | | | | | | | | | | | | | | This passes the list of commands to run on the OEQemuTarget when the TargetDumper needs to run in a test context due to a failure on the target. This is added here as a kwargs because the 'd' dictionary is not available in the staticmethod getTarget in the OERuntimeTestContextExecutor class. The OEQemuTarget is different from the QemuTarget which already uses the list of commands from testimage_dump_target from 'd'. The create_dir() is needed to initialize the TargetDumper's dump_dir variable. (From OE-Core rev: a63675fab4d9f638570912b15a07932f549cc4d1) Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* utils: respect scheduler affinity in cpu_count()Ross Burton2020-09-301-2/+1
| | | | | | | | | | | | | | | cpu_count() returns multiprocessing.cpu_count() but that is simply returns os.cpu_count() so we could use that directly. However this returns the number of CPUs on the host, not the number of usable CPUs on the host. If the user is using scheduler affinity then the number of usable CPUs may be less, so when determining how many cores we can use check the affinity instead. (From OE-Core rev: e2e8ccbe410b2f38bcd9525982b2261cf71aab60) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/runtime : add test for RTC(Real Time Clock)Teoh Jay Shen2020-09-281-0/+38
| | | | | | | | | This test is checking the functionality of the RTC(Real Time Clock). The Check_if_RTC_(Real_Time_Clock)_can_work_correctly manual test case from oeqa/manual/bsp-hw can be replace by this runtime test. (From OE-Core rev: c6961c2fc04edbc5bc3827c7703997085d9c609e) Signed-off-by: Teoh Jay Shen <jay.shen.teoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>