summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
AgeCommit message (Collapse)Author
2021-02-12meta: drop _PYTHON_SYSCONFIGDATA_NAME hacksAlexander Kanavin
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit d3a81dd0e72a3495bfc7cc969c2bb806b666023d) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-02-09sstatesig: Add descriptive error message to getpwuid/getgrgid "uid/gid not ↵Tomasz Dziendzielski
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] 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: Steve Sakoman <steve@sakoman.com>
2021-02-08lib/oe/patch.py: Ignore scissors line on applying patchTomasz Dziendzielski
The "devtool modify" could remove message body before scissors line, so patches re-generated from git tree were incorrectly modified. Adding --no-scissors to "git am" invocation to prevent this behaviour. [YOCTO #12674] Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 13ea33fbd197b9ee3cf913d9995617115f22798f) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-02-04cve_check: add CVE_VERSION_SUFFIX to indicate suffix in versioningLee Chee Yang
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. Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 5dfd5ad5144708b474ef31eaa89a846c57be8ac0) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-02-04cve-check: replace Looseversion with custom version classLee Chee Yang
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] Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 6ced85e9ddd3569240f1e8b82130d1ac0fffbc40) 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-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-28base/bitbake.conf: Enable pseudo path filteringRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ad8f5532ffaead9a5ad13e1034fe9e5e1b7979f4) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2021-01-19lib/oe/utils: Return empty string in parallel_makeTomasz Dziendzielski
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." 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: Steve Sakoman <steve@sakoman.com>
2021-01-04lib/oe/qa: handle the 'no specific instruction set' ELF e_machine valueRoss Burton
[RP: Update OEQA selftest to match change] Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit b7cfc0f51cc0b4866f913f6eae4fcc6f72d2578c) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2020-12-10meta/lib/oe/reproducible.py: gitsm:// works just as fine as git:// for ↵Alexander Kanavin
timestamps This in particular addresses vulkan-samples reproducibility which made me scratch my head for a while. 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: Steve Sakoman <steve@sakoman.com>
2020-11-14lib/oe/reproducible.py: Fix git HEAD checkJoshua Watt
The check for a git HEAD still wasn't quite correct because it was using the .git directory as the current working directory. Instead, it should be passed as the --git-dir argument when running git. Running `git rev-parse HEAD` in a .git directory with no HEAD reports 'HEAD' and exits with success but then 'git log' will fail, which is not what we want. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit cdbd47dd7e1657b91b65a0940b7cbf119764240f) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2020-11-14lib/oe/reproducible: Fix error when no git HEADJoshua Watt
Fixes an error that occurs when attempting to get the timestamp of the latest commit when there is no HEAD in the git repository. The easiest way to trigger this condition is to use the 'subdir=' option when specifying a 'git://' SRC_URI. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a64caca5b5dbe4a76acd0b5709b2c3e75b245863) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2020-11-14classes/reproducible: Move to library codeJoshua Watt
Moves most of the python code used for dealing with the source date epoch to library code. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a7ede90955bc0c8bec1cbb3cab498ef2583b2f4e) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2020-11-02sstatesig: Log timestamps for hashequiv in reprodubile builds for do_packageRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 11e8200ccec765ff6a4263e06512e5751eca261a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2020-11-02Revert "lib/oe/patch: fix handling of patches with no header"Martin Jansa
* This reverts commit d9971f5dc8eb7de551fd6f5e058fd24770ef5d78. * With the missing Subject line fixed in GitApplyTree.prepareCommit() we should be able to revert, the fix which was trying to help it by parsing GitApplyTree.patch_line_prefix ("%% original patch:") also from Subject line, now GitApplyTree.patch_line_prefix should always end on separate line which is then skipped when copying the lines to resulting patch, see original commit message from Paul: lib/oe/patch: fix handling of patches with no header If a patch applied by a recipe has no header and we turn the recipe's source into a git tree (when PATCHTOOL = "git" or when using devtool extract / modify / upgrade), the commit message ends up consisting only of the original filename marker ("%% original patch: filename.patch"). When we come to do turn the commits back into a set of patches in extractPatches(), this first line ends up in the "Subject: " part of the file, but we were ignoring it because the line didn't start with the marker text. The end result was we weren't able to get the original patch name. Strip off any "Subject [PATCH x/y]" part before looking for the marker text to fix. This caused "devtool modify openssl" followed by "devtool update-recipe openssl" (without any changes in-between) to remove version-script.patch because that patch has no header and we weren't able to determine the original filename. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com>
2020-11-02lib/oe/patch: GitApplyTree: save 1 echo in commit-msg hookMartin Jansa
* also remove the extra blank lines which is often added to patches when refreshed with devtool (GitApplyTree.patch_line_prefix lines are ignored when refreshing .patch files, but newly added blank lines aren't - the leading blank line wasneeded for patches with just the subject line (to prevent the GitApplyTree.patch_line_prefix line ending appended to the commit summary), but we can add it in prepareCommit instead Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com>
2020-11-02lib/oe/patch: prevent applying patches without any subjectMartin Jansa
* this was discovered with $ devtool finish --force-patch-refresh where it was removing some patches and replacing them with patch in filename called "patch:" e.g. this .patch file: https://github.com/OSSystems/meta-browser/blob/311067d2d8a50cee5c836892606444f63f2bb3ab/dynamic-layers/rust-layer/recipes-browser/firefox/firefox/fixes/fix-camera-permission-dialg-doesnot-close.patch confuses devtool which results to create new .patch file called "patch:" $ devtool finish --force-patch-refresh firefox meta-browser NOTE: Starting bitbake server... WARNING: Host distribution "ubuntu-20.04" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution. Loading cache: 100% |###################################################################################################################################################################################################################################| Time: 0:00:00 Loaded 2480 entries from dependency cache. Parsing recipes: 100% |#################################################################################################################################################################################################################################| Time: 0:00:00 Parsing of 1718 .bb files complete (1717 cached, 1 parsed). 2480 targets, 68 skipped, 0 masked, 0 errors. Summary: There was 1 WARNING message shown. INFO: Updating patch 0001-Bug-1554949-Fix-WebRTC-build-failure-with-newer-linu.patch ... INFO: Updating patch pre-generated-old-configure.patch INFO: Adding new patch patch: INFO: Updating recipe firefox_68.0esr.bb INFO: Removing file /OE/build/test-oe-build-time/poky/meta-browser/dynamic-layers/rust-layer/recipes-browser/firefox/firefox/fixes/fix-camera-permission-dialg-doesnot-close.patch INFO: Cleaning sysroot for recipe firefox... INFO: Leaving source tree /OE/build/test-oe-build-time/poky/build/workspace/sources/firefox as-is; if you no longer need it then please delete it manually this looked like incorrect parsing of the git format-patch files exported from workspace/sources (the git format-patch version of fix-camera-permission-dialg-doesnot-close.patch starts like this: $ head 0008-original-patch-fix-camera-permission-dialg-doesnot-c.patch From 37dfa11961b48024bedcfb9336f49107c9535638 Mon Sep 17 00:00:00 2001 From: Takuro Ashie <ashie@clear-code.com> Date: Mon, 20 Aug 2018 10:16:20 +0900 Subject: [PATCH 08/34] %% original patch: fix-camera-permission-dialg-doesnot-close.patch so first I've modified GitApplyTree.extractPatches() to be able to parse the original patch name correctly even in this case where subject is wrapped, but then it still wasn't right, because we ended with correctly named .patch file, but all we could use for Subject line was the name of the original .patch file (instead of the Subject from metadata commit which introduced this .patch files as some other .patch files get when refreshed with devtool. In the end the issue happens even sooner in GitApplyTree.prepareCommit() where it correctly found the Subject from metadata commit, but then didn't apply it when there weren't any other outlines from patch headers. Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com>
2020-07-13lib/oe/recipeutils.py: add AUTHOR; BBCLASSEXTENDTim Orling
If you try to create a plugin for recipetool that adds the AUTHOR field, it is impossible to put it in the recommended position [1] without adding to the recipe_progression variable. While we are at it, also add BBCLASSEXTEND at the end, as also recommended by [1]. [1] http://www.openembedded.org/wiki/Styleguide Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit d687c5b7b10b3decdd80d5c2fd61072a87f061f2) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2020-05-27terminal.py: do not stop searching for autoJoe Slater
If a terminal fails to spawn() we should continue looking. gnome-terminal, in particular can be present but not start. Signed-off-by: Joe Slater <joe.slater@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 6e4babdeee38d32002a4c9129e77466ae4156dd7) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2020-04-02prservice.py: fix do_package with newer Python in Ubuntu 20.04Martin Jansa
* with Ubuntu 20.04 which is using python 3.8 I'm seeing a lot of errors like: ERROR: libxml2-2.9.10-r0 do_package: Can NOT get PRAUTO, exception No module named '_sysconfigdata' not sure what caused this from python 3.8, but this seems to work * PRserv is enabled with: PRSERV_HOST = "localhost:0" Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-01lib/oe/package_manager: don't try to rm /var/lib/opkgJan Luebbe
As opkglibdir starts with a /, os.path.join will ignore self.target_rootfs, leading to an attempt to remove /var/lib/opkg. This only fails if it exists on the host, explaining why this remained undiscovered for long. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-01lib/oe/package_manager: avoid installing provided packages via aptJan Luebbe
If there already is a package providing (and conflicting against) packages what should be installed, apt will try remove the conflicting package (target-sdk-provides-dummy) and any that depend on it (like apt and dpkg). This usually fails because of the protection of essential packages. In that case, no -dev/-dbg packages are installed to the SDK. Avoid this problem by checking which packages are already provided and removing them from the list to be installed. Also sort the list to make it easier to read when debugging. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-01lib/oe/package_manager: collect provided package names when using debsJan Luebbe
This is needed for a later change to avoid installing packages which are already provided by an installed package. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-01lib/oe/package_manager: fix handling of last packageJan Luebbe
In commit 7d214b34e11dc57316ed5c1c7747c4601286f6d2, only the code in the for loop was modified to store the pkgarch value. The code used if there was no empty line at the end was not modified. Instead of fixing the duplicated code, remove it and just make sure that a final empty line is processed. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-01lib/oe/package_manager: make sure to not remove packages in apt installJan Luebbe
apt install can decide to remove already installed packages if there are conflicts. Avoid this by explicitly specifying --no-remove. This will then cause a "E: Packages need to be removed but remove is disabled." message. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-01lib/oe/utils.py: add get_host_compiler_version()Tim Orling
Add helper function to get the host compiler and version. Do not assume compiler is gcc. NOTE: cannot set env to d.getVar("PATH") as that does not contain the session PATH which was set by environment-setup-... which breaks the install-buildtools use-case Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-30prservice.py: Use "with" to control file handle lifetimePeter Kjellerstedt
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-28utils: fix gcc 10 version detectionCharles-Antoine Couret
Utils can not detect GCC 10 correctly due to wrong regex. It generates this error "ERROR: Can't get compiler version from gcc --version output" Sub-version numbers should be 1 or more digits instead of 1 only. Signed-off-by: Charles-Antoine Couret <charles-antoine.couret@mind.be> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-26oe/recipeutils: Drop obsolete GITDIR referenceRichard Purdie
The fetcher GITDIR variable wase dropped a while back, drop the obsolete reference to it (thanks Robert Day). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-06lib/oe/utils: allow to set a lower bound on returned cpu_count()André Draszik
This will be needed for making xz compression more deterministic, as xz archives are created differently in single- vs multi-threaded modes. This means that due to bitbake's default of using as many threads as there are cores in the system, files compressed with xz will be different if built on a multi-core system compared to single-core systems. Allowing cpu_count() here to return a lower bound, will allow forcing xz to always use multi-threaded operation. Signed-off-by: André Draszik <git@andred.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-25abi_version/sstatesig: Introduce HASHEQUIV_HASH_VERSIONRichard Purdie
We've found we need a way to cause a change in signatures and move to a new hash 'namespace' with hashequiv. This introduces a variable which allows us to do this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-06microblaze: Adjust Linux items from microblazeeb to microblazeMark Hatle
Due to recent changes to the tune, in order to match config.guess, the name of the big-endian microblaze architecture was changes to 'microblaze'. Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-04lib/oe/path: try hardlinking instead of guessing when it might failHenning Schild
The comparison of the stat st_dev is not enough to judge whether hardlinking will work. One example would be where you try and hardlink across two bind-mounts of a directory. The st_dev will be the same and the operation will still fail. Instead of implementing a check to try and figure out hardlink support just try hardlinking and fall back to a copy when running into an exception. Signed-off-by: Henning Schild <henning.schild@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-04cmake: prefer CMAKE_BUILD_PARALLEL_LEVELDaniel McGregor
cmake 3.12 introduced this environment variable. Prefer it to passing PARALLEL_MAKE and PARALLEL_MAKEINST on the cmake command line, because it gets passed to second stage cmake invocations while command-line arguments do not (for example, multi-stage clang builds) Signed-off-by: Daniel McGregor <daniel.mcgregor@vecima.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-27lib/oe/package: remove unneeded npm_split_package_dirs functionJean-Marie LEMETAYER
The npm_split_package_dirs function was used by the recipetool when creating npm recipes. This is not the case anymore. Signed-off-by: Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-22lib/oe/package_manager: Improve locale-archive reproducibilityAlex Kiernan
The generation of locale-archive depends on the order of the input files. Fix the order by sorting the file list. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-19machine_dict: Add i686 to the ELF machine dictionaryAlejandro Enedino Hernandez Samaniego
An error like the following is thrown when building baremetal applications on some x86 architectures: (machine, osabi, abiversion, littleendian, bits) \ = oe.elf.machine_dict(d)[target_os][target_arch] Exception: KeyError: i686 Since the i686 (target_arch) key does not exist in the dictionary. Add the key to fix the error. Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-19classes, conf, lib: Add support for powerpc64leKhem Raj
LE is default for modern powerpc64, power8+ PowerPC64 Little Endian Linux ABI specifies Power8 as the minimum ISA. The basic ABI can run on earlier versions of the 64 bit PowerPC ISA, but it was helpful to define a new, minimum instruction set for Linux distribution releases during the switch to Little Endian. Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-16sstatesig: Improve debug output if getpwuid() failsRichard Purdie
If getpwduid fails, we don't see which file it failed on which is key information to aid debugging. Print this information when exceptions are raised. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-10lib/oe/package_manager.py: put the sdk_provides_dummy_target upfrontAlexander Kanavin
Otherwise, the package utilizing this architecure does not get properly prioritized by rpm/dnf. This isn't seen single-lib builds (as the architecture ends up upfront anyway), but is triggered in multulib where the architecture may end up in the middle of the list due to multilib expansion/trimming duplicates. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-03sstatesig: Avoid resetting taskhash within siggen for locked sigsRichard Purdie
Since get_unihash uses taskhash as a key internally, changing it means different bebahour when locked sigs are active verses not active. Under corner cases this leads to a signature mismatch. Avoid this by by adding a wrapper for the place its externally exposed and then not changing the internals. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-03sstatesig: Fix locked signature handling with unihashesRichard Purdie
get_taskhash will call get_unihash internally in the parent class. We need to disable our filter of it whilst this runs else incorrect hashes can be calculated. This is believed to be causing the locked signatures test to fail under some circumstances (depending on whether earlier hashes are being remapped). [YOCTO #13605] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-02sstatesig: Test cross/native hashserv method extensionRichard Purdie
We can have one taskhash which represents multiple native/cross sstate objects since they're stored by BUILD_ARCH or possibly host distro (or host gcc version). We need to put these into separate namespaces on hashserv since their outhashes will never match and we need deterministic lookups for the different namespaces. Use this extramethod option to handle this. This fixes several problematic failures on the autobuilder. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-29chrpath: Cleanup and fix previous patchRoss Burton
Ensure self.data isn't accessed without assignment. Also clean up old style popen use and replace with modern/simpler subprocess. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-28recipeutils: set SRCPV for devupstream variantAlexander Kanavin
Otherwise bitbake is unable to expand it if the main variant is not using a SCM fetcher. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2019-12-28rootfs: don't use oe.cachedpathRoss Burton
Unless cachedpath is used correctly then it's just a glorified clone of os.walk, but without any of the recent optimisations in os.walk. In this codepath there is no point to using cachedpath. Signed-off-by: Ross Burton <ross.burton@intel.com>
2019-12-16sstatesig: Further optimiseRichard Purdie
Optimise the call into the parent function to be only when needed. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-15sstatesig: Optimise get_taskhash for hashequivRichard Purdie
With hashequiv the get_taskhash function is called much more regularly and contains expensive operations. This these don't change based upon hash in a given build, improve the caching within the function to reduce overhead. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-11-10meta/lib/oe/package_manager.py: Enable sha256 checksums in opkg indexerHaris Okanovic
Pass `--checksum md5` and `--checksum sha256` to opkg-make-index. Sha256 checksum enables more reliable install-time validation of IPKs. This is particularly useful when installing from signed feeds -- I.e. feeds using signed Packages index files that deliver otherwise unsigned IPKs. Such feeds rely on hash validation of enclosed IPKs to thwart tampering. After download, opkg verifies IPK's checksum against the (signed) Packages index file. Weak hashes like md5 are prone to collision and therefore tampering. The md5 checksum is purely for backward compatibility. Sha256 validation was recently added to opkg. Newer builds of opkg will use it. Older builds still look for an md5 checksum. Md5 is deprecated and should be removed once old build are phased out. Testing: I ran `bitbake package-index` after building a few IPKs and verified MD5Sum and SHA256sum attributes are present in Packages. Using opkg-utils 0.4.0. Performance Impact: It takes about 40 seconds to cleanly re-index 8000 IPKs on an Intel Xeon E5-1620 machine. This was previously about 20 seconds. NOTE: It's recommended to delete all Packages* files after applying this patch. Otherwise, some IPKs won't have sha256. Signed-off-by: Haris Okanovic <haris.okanovic@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>