summaryrefslogtreecommitdiffstats
path: root/meta/classes/archiver.bbclass
AgeCommit message (Collapse)Author
2023-12-23archiver.bbclass: Drop tarfile module to improve performanceRobert Yang
* The tarfile module doesn't support xz options or environment varible XZ_DEFAULTS, this makes do_ar_patched incrediblely slow when the file is large, for example, chromium-x11 is about 3GB: - "bitbake chromium-x11 -car_patched" hasn't been done after 3 hours on my host, I checked the partial tar.xz file is only 1.5GB, so maybe more than 6 hours is required to complete the task. - Now only less than 4 minutes is needed on the same host. * Need add xz to HOSTTOOLS when archiver.bbclass is enabled and compression is xz. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-13archiver.bbclass: Improve work-shared checkingRobert Yang
There are other recipes except the listed ones which use work-shared, improve the checking to make other recipes such as llvm-project-source work with do_ar_patched. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-05-25archiver: move exclusion logic in a dedicated functionAntonin Godard
Extending archiver is not possible without duplicating the anonymous function's logic. Move this logic in a separate function "include_package" which returns a bool. Signed-off-by: Antonin Godard <antoningodard@pm.me> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-02archiver: avoid using machine variable as it breaks multiconfigJose Quaresma
STAGING_KERNEL_DIR uses the MACHINE name so it breaks the multiconfig and in this cases it will run the shared recipes twice, one for each machine. STAGING_KERNEL_DIR it's been introduced in commit 5487dee2e1 Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12archiver.bbclass: some recipes that uses the kernelsrc bbclass uses the ↵Jose Quaresma
shared source This fix a race that happens when building some of the followning recipes with kernel at same time. The kernelsrc uses the kernel shared source dir as their source S = "${STAGING_KERNEL_DIR}" and this will cause a race in the do_unpack_and_patch task, when bitbake runs the bb.build.exec_func('do_unpack', d) because do_unpack will clean the source dir on startup. | ok: note that S != "${STAGING_KERNEL_DIR} for this ones openembedded-core/meta/recipes-kernel/perf/perf.bb:inherit kernelsrc meta-openembedded/meta-oe/recipes-kernel/usbip-tools/usbip-tools.bb:inherit kernelsrc autotools-brokensep | broken meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb:inherit kernelsrc kernel-arch bash-completion meta-openembedded/meta-oe/recipes-kernel/spidev-test/spidev-test.bb:inherit bash-completion kernelsrc kernel-arch meta-openembedded/meta-oe/recipes-kernel/intel-speed-select/intel-speed-select.bb:inherit kernelsrc meta-openembedded/meta-oe/recipes-kernel/bpftool/bpftool.bb:inherit bash-completion kernelsrc kernel-arch The issue can be replicated with: INHERIT += "archiver" ARCHIVER_MODE[src] = "original" ARCHIVER_MODE[diff] = "1" And: R=<recipe> bitbake -c cleansstate virtual/kernel $R && bitbake $R Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12classes: Add SPDX license identifiersRichard Purdie
As stated in our top level license files, the license is MIT unless otherwise stated. Add SPDX identifers accordingly. Replace older license statementa with the standardised syntax. Also drop "All Rights Reserved" expression as it isn't used now, doesn't mean anything and is confusing. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12classes: Add copyright statements to files without oneRichard Purdie
Where there isn't a copyright statement, add one to make it explicit. Also drop editor config lines where they were present. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-28archiver.bbclass: remove unsed do_deploy_archives[dirs]Jose Quaresma
Remove as commit b3afe7d redifines it. https://git.openembedded.org/openembedded-core/commit/?id=b3afe7d9bd25a943e947de3ec064ea245173c5a8 Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-15archiver: don't use machine variables in shared recipesJose Quaresma
When using multiconfig with the same TMP folder we can have races because the shared recipes like gcc-source run twice. ARCHIVER_OUTDIR = ${ARCHIVER_TOPDIR}/${TARGET_SYS}/${PF}/ which includes TARGET_SYS and between the two different MACHINE values, this changes from 'arm-poky-linux-gnueabi' to 'aarch64-poky-linux'. This leads to the task running twice, once for each multiconfig. To solve this we need to store the shared output in a common place for all machines and in this way the stamps will be the same for each machine so the gcc-source will on run once regardless of the machine used. Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-11archiver: use bb.note instead of echoJose Quaresma
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-21meta/scripts: Automated conversion of OE renamed variablesRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-18archiver: Fix typoRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-30archiver: Default to xz compresison instead of gzRichard Purdie
We should default to xz or zstd instead of gz, pick xz for now as it is more tested. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-28archiver: Configurable tarball compressionIan Ray
In order to be more efficient, we use xz as compression method to create GPL sources archives. Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com> [V1 was https://patchwork.openembedded.org/patch/155985/] [Rebased] Signed-off-by: Ian Ray <ian.ray@ge.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2021-07-28archiver.bbclass: fix do_ar_configured failure for kernelChangqing Li
Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-24archiver.bbclass: Fix patch error for recipes that inherit dos2unix.leimaohui
do_unpack_and_patch error happens for these recipes inherit dos2unix. Signed-off-by: Lei Maohui <leimaohui@fujitsu.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-18archiver: Fix typosDaniel Ammann
Signed-off-by: Daniel Ammann <daniel.ammann@bytesatwork.ch> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-15archiver.bbclass: Fix --runall=deploy_archives for imagesRobert Yang
Fixed: INHERIT += "archiver" COPYLEFT_LICENSE_INCLUDE = "*" $ bitbake core-image-minimal --runall=deploy_archives [snip] KeyError: '/path/to/meta/recipes-core/images/core-image-minimal.bb:do_ar_original' [snip] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-07base/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>
2020-07-05classes/archive: do_configure should not depend on do_ar_patchedJoshua Watt
The commit d4be264061 ("classes/archiver: run do_unpack_and_patch after do_preconfigure") correctly moved do_unpack_and_patch to depend on do_preconfigure, but left do_ar_patched as a dependency of do_configure introduced from 8a7c779487 ("classes/archiver: Create patched archive before configuring"). Having do_configure depend on do_ar_patched is blatantly wrong. Firstly, doing so causes the taskhash of do_configure to change which is undesirable. Secondly, the anon python that sets up the tasks carefully skips GCC recipes that depend on gcc-source to provide their source code since running do_unpack_and_patch in them would delete the source code. Adding in the dependency effectively bypasses this and makes these recipes delete the shared gcc-source This fixes errors (for real this time) like: cat: .../gcc/defaults.h: No such file or directory when making certain configuration changes. For posterity, you could easily reproduce gcc-source being erased by running the commands (replacing aarch64 with your correct target arch): bitbake -c cleanall gcc-source gcc-cross-aarch64 bitbake -c do_deploy_archives gcc-source # The following would fail because # gcc-cross-aarch64:do_unpack_and_patch erases shared source, so # do_configure after that fails. bitbake gcc-cross-aarch64 Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-02classes/archiver: run do_unpack_and_patch after do_preconfigureJoshua Watt
The commit 8a7c779487 ("classes/archiver: Create patched archive before configuring") fixed a race condition when using the archiver, but introduced a bug where the GCC source would occasionally be deleted due to the archiving code running before do_preconfigure. Instead, make sure the archiving code runs after do_preconfigure by making do_unpack_and_patch depend on it. This makes more sense anyway since do_preconfigure is effectively an extension of do_patch. This fixes errors like: cat: .../gcc/defaults.h: No such file or directory when making certain configuration changes Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-17classes/archiver: Create patched archive before configuringJoshua Watt
do_configure and do_preconfigure can modify source files, which causes race conditions if these tasks run in parallel with do_ar_patched. Add explicit task dependencies to ensure that do_ar_patched finishes before these tasks start. Specifically, this fixes a race condition with gcc-source where do_ar_patched races with do_preconfigure deleting gcc/gengtype-lex.c Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-05archiver: Capture git submodules in mirror archiverPaul Barker
Using the new Fetch.expanded_urldata() function we can get URL data for all git submodules. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-24archiver.bbclass: Fix duplicated SRC_URIs for do_ar_originalRobert Yang
The argument urls of bb.fetch2.Fetch(urls, d) are duplicated to SRC_URI, which caused errors like: bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError: Fetcher failure: The SRCREV_FORMAT variable must be set when multiple SCMs are used. The SCMs are: git://github.com/docker/notary.git;destsuffix=git/src/github.com/docker/notary git://github.com/docker/notary.git The first one is from original SRC_URI, the second one is from the variable 'urls', so cleanup SRC_URI before call bb.fetch2.Fetch() can fix the problem. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-18archiver.bbclass: Make do_deploy_archives a recursive dependencyPaul Barker
To ensure that archives are captured for all dependencies of a typical bitbake build we add do_deploy_archives to the list of recursive dependencies of do_build. Without this, archives may be missed for recipes such as gcc-source which do not create packages or populate a sysroot. do_deploy_archives is also added to the recursive dependencies of do_populate_sdk so that all sources required for an SDK can be captured. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-21archiver.bbclass: Correct a typoPeter Kjellerstedt
Also add a missing space in a warning message. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-10archiver.bbclass: Add new mirror archiver modePaul Barker
We define a new method of populating a source mirror using the archiver bbclass instead of simply copying the contents of the downloads directory. This allows the archiver features such as copyleft license filtering and recipe type filtering to be used when preparing a source mirror. This new archiver mode is selected by setting `ARCHIVE_MODE[src]` to 'mirror'. The source mirror mode can either be 'split' (default) or 'combined', controlled by `ARCHIVER_MODE[mirror]`. Additionally, sources can be excluded as needed by setting `ARCHIVER_MIRROR_EXCLUDE` to a list of URI prefixes. These options are described in more detail in the new entries in the header of archiver.bbclass. New oeqa selftest cases are added to cover the mirror archiver mode. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-11-14archiver: avoid empty incfile in ar_recipegrygorii tertychnyi
do_ar_recipe fails on perf recipe on line: include ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'perf-perl.inc', '', d)} 1. "${...}" part expands into empty string 2. bb.utils.which() takes empty string and returns first directory name from bbpath 3. shutil.copy() fails on copying directory: Exception: IsADirectoryError: [Errno 21] Is a directory: ...... Hence, check "incfile" variable on each step. Signed-off-by: grygorii tertychnyi <gtertych@cisco.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-19classes/archiver: Fix WORKDIR for shared sourceJoshua Watt
When archiving patched source, WORKDIR should only be changed to ${ARCHIVER_WORKDIR} if the recipe doesn't use a shared work directory. This matches the behavior of do_unpack_and_patch for these recipes. This fixes kernel recipes that set S = "${WORKDIR}/git" Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-06archiver.bbclass: Do not archive srpm's if there are no package tasksNathan Rossi
Do not attempt to archive recipes which have no packaging tasks (e.g. inherits nopackages). Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-06archiver/package_rpm: Fix the worst src.rpm generation raceRichard Purdie
The package_rpm code is writing outside the task's sstate directory into the sstate of do_deploy_archives. This is "out of spec" since if the task is installed from sstate, the files are not restored. This means the files may appear/disappear, things are not deterministic and there are races. Extend the do_package_write_rpm code to handle writing the src.rpm into place to avoid these issues. There are other problems but this avoids races around this file. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-27archiver.bbclass: Fix COPYLEFT_LICENSE_{IN, EX}CLUDEAdrian Bunk
Setting them to empty before inheriting copyleft_filter made them not getting their documented values there. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-06archiver: Drop unwanted directoriesFabien Lahoudere
In sources directory we can find patches/ and temp/. The first one is filled with symbolic link unusable on another machines. The second contains yocto logs to create this archives and are typically copied when 'S = "${WORKDIR}"' Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-10archiver: remove left-over debuggingRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-01archiver: generalise task running when in configured modeRoss Burton
When in configured mode the archive will re-run configure itself, but that doesn't work if there are other tasks that need to run such as cmake's generate_toolchain_file. Instead of hard-coding a list of classes and tasks, obtain the list of tasks preceeding do_configure, filter out ones we don't want to re-run such as do_patch and do_prepare_recipe_sysroot, and run those too. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-01archiver: check tasks exist before adding dependenciesRoss Burton
Some recipes don't have do_configure, or have them but are marked as noexec. Check for their existance before hooking up dependencies. [ YOCTO #12868 ] Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05archiver: Fix archive for linked kernel sourceTom Hochstein
When archiving a kernel, if S is ${WORKDIR}/git, then ${WORKDIR}/git is in fact a soft link into work-shared, and the archive contains just the soft link. Fix by archiving the real directory. Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05archiver: Fix build errors for kernels that don't use kernel-yocto.bbclassTom Hochstein
Special handling for kernel source in work-shared was incorrectly limited to kernel-yocto.bbclass instead of kernel.bbclass. Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-16archiver: remove deploy_all_archives task as --runall replaces itRoss Burton
2018-01-29archiver: don't require that images are built using RPM to build SRPMsRoss Burton
The requirement for images being built using RPM is too strict to have access to the RPM functions, simply checking that package_rpm is in PACKAGE_CLASSES is sufficient. Also fail if SRPMs are requested but package_rpm isn't enabled, instead of silently not doing what we were asked. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-10-16archiver: preserve sysroot paths in configured mode for multilibHongxu Jia
In the following commit, the archiver expanded RECIPE_SYSROOT to preserve sysroot paths in configured mode: ... commit aa2240657b015d46e9ba4bcb6264709a82313d83 Author: Ross Burton <ross.burton@intel.com> Date: Tue Jun 6 15:23:18 2017 +0100 archiver: preserve sysroot paths in configured mode ... In meta/conf/multilib.conf, it overrides the variables of STAGING_DIR_HOST, STAGING_DIR_TARGET and RECIPE_SYSROOT with "${WORKDIR}/${MLPREFIX}recipe-sysroot". So the archiver should also expand STAGING_DIR_HOST and STAGING_DIR_TARGET to preserve sysroot paths in configured mode for multilib. [YOCTO #11584] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-06archiver: preserve sysroot paths in configured modeRoss Burton
do_ar_configured alters WORKDIR but also expects to be able to run do_configure, so forcibly expand the paths to the sysroots as otherwise they'll point to a non-existant directory in the temporary WORKDIR. [ YOCTO #11584 ] Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-06archiver.bbclass: fix do_ar_original error for matchbox-desktopDengke Du
Error: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ERROR: matchbox-desktop-2.1-r0 do_ar_original: Can not determine archive names for original source because 'name' URL parameter is unset in more than one URL. Add it to at least one of these: git://git.yoctoproject.org/matchbox-desktop-2 file://vfolders/%2A ERROR: matchbox-desktop-2.1-r0 do_ar_original: Function failed: do_ar_original ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function do_ar_original, when recipes have more than one source, it added the "name" URL parameter as suffix to identify the created tarball. But the URL type "file://" that we always used to represent a series of patches, it didn't have "name" parameter, so it failed. So set "name" to the folder name to identify the created tarball, for example: In matchbox-desktop bb file, the SRC_URI contains: file://vfloders/* We set "name" to "vfolders" to identify the created tarball. In connman-gnome bb file, the SRC_URI contains: file://images/* We set "name" to "images" to identify the created tarball. Signed-off-by: Dengke Du <dengke.du@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-06archiver.bbclass: adapt do_unpack_and_patch to RSSMikko Ylinen
do_unpack_and_patch was not correctly run until recently ("archiver.bbclass: various fixes for original+diff mode") but with the fix applied, the errors we get indicate the function is not adapted to work with recipe specific sysroots. do_unpack_and_patch sets WORKDIR to ARCHIVER_WORKDIR which affects all path settings relative to WORKDIR, inluding the paths to recipes' sysroots. IOW, when do_unpack and do_patch are run, they cannot find the necessary native tools and files located in the sysroot (e.g., quiltrc) because the paths point to ARCHIVER_WORKDIR. Adapt do_unpack_and_patch to RSS by restoring the original STAGING_DIR_NATIVE after WORKDIR is changed to ARCHIVER_WORKDIR. Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-03archiver: Escape recipe name in regexJoshua Watt
The recipe name needs to be escaped when using it in a regular expression so that and special characters are treated literally Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-05-18archiver: avoid archiving source for glibc-localeZhenbo Gao
Avoid archiving source for glibc-locale as its tasks do_fetch do_unpack and do_patch have already been deleted. Signed-off-by: Zhenbo Gao <zhenbo.gao@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-05-18archiver.bbclass: do not cause kernel rebuildsPatrick Ohly
Adding or removing archiver.bbclass from a build configuration causes rebuilds of linux-yocto-based kernels because of the do_kernel_configme->do_unpack_and_patch task dependency. This particular dependency can be ignored for the do_kernel_configme sstate signature calculcation. Idea for the fix from Richard Purdie. Note that building the kernel and adding archiver.bbclass later to archive sources leads to do_unpack_and_patch running after do_kernel_configme (because that already ran in the first build), which might be problematic. This is independent of the change here. The use case in YOCTO #11441 is to removed archiver.bbclass between a production build with archiving enabled and builds via oe-selftests without archiving. That direction is fine. Fixes: YOCTO #11441 Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-05-18archiver.bbclass: various fixes for original+diff modePatrick Ohly
The diff.gz gets created in do_unpack_and_patch, but do_deploy_archives did not depend on it, so there was a race condition. For example, "bitbake linux-intel:do_deploy_archives" without a prior "bitbake linux-intel:do_kernel_configme" did not deploy the diff.gz. When do_unpack_and_patch ran first, it failed because the output directory didn't exist yet and the error was not detected because the result of the diff command wasn't checked. Changing the current working directory in create_diff_gz() without returning to the original directory caused warnings like this: WARNING: linux-intel-... do_unpack_and_patch: Task do_unpack_and_patch changed cwd to .../tmp-glibc/work-shared/intel-corei7-64 Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-05-18archiver.bbclass: enhance do_ar_recipe task signaturePatrick Ohly
Previously, do_ar_recipe ran again unnecessarily when adding or removing classes like buildhistory.bbclass, because that changes the BBINCLUDED variable which do_ar_recipe uses to find .bbappend files. This is both extra work and also sometimes triggered "basehash changed" errors (seen under oe-selftest, which adds machine.inc and bblayers.inc) because BBINCLUDED is special and does not cause the basehash to be recalculated. The file *content* already was not considered in the task signature, instead relying indirectly on PF (which includes the revision assigned by a PR server) to ensure that a new versioned source archive gets created each time there is a rebuild. Therefore it makes sense to use the same mechanism and also ignore the file *list*, i.e. exclude BBINCLUDED from the task signature. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-03-21meta: replace uses of bb.data.expand(VARNAME, d) with d.expand(VARNAME)Joshua Lock
bb.data.expand(x, d) is deprecated API. [YOCTO #10678] Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>