aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/externalsrc.bbclass
AgeCommit message (Collapse)Author
2017-01-31externalsrc: Hide created symlinks with .git/info/excludeOla x Nilsson
Add created symlinks to the exclude file. This will both make them less distracting and hide them from the srctree_hash_files function. Signed-off-by: Ola x Nilsson <olani@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-01-16externalsrc.bbclass: Add task buildcleanOla x Nilsson
The buildclean task should call the package build system clean command, just implemented for Make for now. This is meant for recipes where S == B, but can be useful as a standalone task for other recipes too. When S == B, set it to run before do_clean which will do what most developers expect when calling bitbake -c clean. For S != B, do not add it before clean as it is not needed and may take some time. Signed-off-by: Ola x Nilsson <olani@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-01-09externalsrc: Add optional srcdir arg to srctree_hash_filesOla x Nilsson
Make it easier to reuse the function for other dirs than EXTERNALSRC. Signed-off-by: Ola x Nilsson <ola.x.nilsson@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-01-09externalsrc: Set STAMPCLEAN to match STAMPOla x Nilsson
Only the last stamp file should be kept, but unless STAMPCLEAN matches files generated using STAMP old stamp files may linger. This may cause false positives for skipping tasks. Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-16meta: remove True option to getVarFlag callsJoshua Lock
getVarFlag() now defaults to expanding by default, thus remove the True option from getVarFlag() calls with a regex search and replace. Search made with the following regex: getVarFlag ?\(( ?[^,()]*, ?[^,()]*), True\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-16meta: remove True option to getVar callsJoshua Lock
getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-10-11classes/externalsrc: re-run do_configure when configure files changePaul Eggleton
If the user modifies files such as CMakeLists.txt in the case of cmake, we want do_configure to re-run so that those changes can take effect. In order to accomplish that, have a variable CONFIGURE_FILES which specifies a list of files that will be put into do_configure's checksum (either full paths, or just filenames which will be searched for in the entire source tree). CONFIGURE_FILES then just needs to be set appropriately depending on what do_configure is doing; for now I've set this for autotools and cmake which are the most common cases. Fixes [YOCTO #7617]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-20externalsrc.bbclass: Make reparsing work for BBCLASSEXTENDed recipesPeter Kjellerstedt
To make sure changes to any source files are detected when externalsrc is used, it sets BB_DONT_CACHE to force the recipe to be reparsed every time. Previously, this was done conditionally based on whether EXTERNALSRC was set. This worked fine for building the base recipe. But if one tried to build, e.g., a native version of it (provided via BBCLASSEXTEND), the recipe would not be reparsed as expected. To solve the above problem, BB_DONT_CACHE is now set for the base recipe if EXTERNALSRC is set for it or any of it derivatives. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Update to use python3 command pipeline decodingRichard Purdie
In python3, strings are unicode by default. We need to encode/decode from command pipelines and other places where we interface with the real world using the correct locales. This patch updates various call sites to use the correct encoding/decodings. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-05externalsrc: avoid race in temporary git index fileMarkus Lehtonen
Use a unique tempfile as the temporary git index file when determining the git hash of the source tree. A fixed filename was obviously causing races (with the git index.lock file) under oe-selftest where multiple bitbake instances were run against the same source tree at the same time. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-28externalsrc: remove nostamp from do_configureMarkus Lehtonen
Extend the srctree_hash_files() function in externalsrc.bbclass to handle non-Git source trees. If the source tree is not a git repository, srctree_hash_files() now simply adds the whole source tree as a dependency, causing bitbake to basically hash every file in it. Hidden files and directories in the source tree root are ignored by the glob currently used. This has the advantage of automatically ignoring .git directory, for example. During the first bitbake run preparing of the task runqueue may take much longer if the source tree is not a git repository. The reason is that all the files in the source tree are hashed. Subsequent builds are not significantly slower because (most) file hashes are found from the cache. [YOCTO #8853] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-28externalsrc: do not use do_configure[nostamp] for git srctreesMarkus Lehtonen
Be a bit more intelligent than mindlessly re-compiling every time. Instead of always using 'nostamp' flag for do_compile run a python function to get a list of files to add as 'file-checksums' flag. The intention is to only re-run do_compile if something in the source tree content changes. This python function, srctree_hash_files(), works differently, depending if the source tree is a git repository clone or not. If the source tree is a git repository, the function runs 'git add .' and 'git write tree' to get a hash of the working tree and writes this hash into a file under the .git directory. This file containing the hash is then returned as the file for the task to depend on. Hash is changed if any changes are made in the source tree causing the task to be re-run. A trick is used to parse the recipe every time so that the hash file gets updated. If the source tree is not a git repository behaviour remains the same. In this case srctree_hash_files() currently sets the 'nostamp' flag for do_compile causing it to be re-run every time. This method of tracking changes source tree changes to determine if re-build is needed does not work perofectly, though. Many packages are built under ${S} which effectively changes the source tree causing some unwanted re-compilations. However, if do_compile of the recipe does not produce new/different artefacts on every run (as commonly is and should be the case) the re-compilation loop stops. Thus, you should usually see only one re-compilation (if any) after which the source tree is "stabilized" and no more re-compilations happen. [YOCTO #8853] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-20externalsrc: use shared stamp directory if B=SMarkus Lehtonen
We have a common build directory for all target architectures if externalsrc is used and ${B}=${S}. In this case we also need to have a common stamp directory. The reason is that e.g. changing MACHINE will basically "invalidate" the artefacts in ${B} (wrt. to the new MACHINE) but old stamp files with matching hashes from an earlier build might be available in the machine-specific stamps directory and tasks would not be correctly re-run. Previous attempt in f44f12af346888bdeb3ae01a275cb5dd4396b505 to handle this correctly was faulty as it threw some spurious warnings and caused do_configure to be re-run in every build if that would not be necessary. [YOCTO #8950] [YOCTO #9237] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-03-02classes/externalsrc: fix symlinking if symlink exists pointing to another pathPaul Eggleton
If the oe-workdir / oe-logs symlink exists and points to a different path then the symlink needs to be removed before calling os.symlink() or it'll fail. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11classes/externalsrc: create symlinks for workdir and logsPaul Eggleton
Auto-create symlinks in the source directory to the work directory (${WORKDIR}) and logs directory (${T}) so that they are easier for the user to find. This is particularly useful within the extensible SDK where the user is less likely to be familiar enough with the structure of the build system to know where to find these things, but otherwise they are a useful shortcut for anyone. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11classes/externalsrc: disable rm_work when activePaul Eggleton
If you're using externalsrc, it's very likely that you're going to want to examine the intermediate build results even if the recipe builds successfully; therefore you won't want rm_work to delete those. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-04classes/lib: Add expand parameter to getVarFlagRichard Purdie
This sets the scene for removing the default False for expansion from getVarFlag. This would later allow True to become the default. On the most part this is an automatic translation with: sed -e 's:\(\.getVarFlag([^,()]*, [^,()]*\)):\1, True):g' -i `grep -ril getVar *` In this case, the default was False, but True was used since in most cases here expansion would be expected. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-31externalsrc: use shared CONFIGURESTAMPFILE if B=SMarkus Lehtonen
External source tree is used as the builddir even for different architectures in case ${B}=${S}. This may cause problems if MACHINE is changed as do_configure is not being re-run (which would run make clean). This patches changes externalsrc to use a common (per-recipe) CONFIGURESTAMPFILE under 'work-shared' if ${B}=${S}. In addition, do_configure will depend on changes of this stamp file. As a result, do_configure is re-run and the build dir is cleaned correctly if a rebuild for different MACHINE is done. [YOCTO #8950] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22classes/externalsrc: fix setting of deps varflag as a stringPaul Eggleton
The value of the deps varflag for tasks is (unusually) expected to be a list object rather than a space-separated string, hence we cannot use appendVarFlag() here. This fixes a traceback when parsing the gcc recipe with externalsrc enabled, for example. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22classes/externalsrc: scale back warning to a plain notePaul Eggleton
It turns out that there are folks out there who use externalsrc in normal builds and don't really need to be warned; additionally within the extensible SDK or when using devtool, it shouldn't be a warning situation. Thus, scale it back to a note (we can't use bb.note() here since that wouldn't actually be piped through to the bitbake UI). Also touch up the message a little bit. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12externalsrc.bbclass: better filtering of cleandirsMarkus Lehtonen
We really do not want our (external) source tree to be removed. There might be multiple values in the 'cleandirs' varflag pointing to our source tree - causing it to be wiped out. This patch improves the filtering of 'cleandirs' by examining the expanded values inside it. Any (expanded) values pointing to our source tree get removed. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-09extrernalsrc.bbclass: treat kernel meta like local sourceMarkus Lehtonen
Kernel metadata repository needs to be fetched/unpacked into the work directory in order to build the kernel. Sources pointing to a remote location are skipped by externalsrc by default which caused kernel build to fail (because of remote kernel-meta was not made availeble). This patch will make kernel-meta always available. [YOCTO #6658] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-18classes/externalsrc: handle tasks with existing lockfilesPaul Eggleton
We need to ensure we add a leading space to the value we are prepending here in case lockfiles already has a value. Fixes [YOCTO #7813]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2015-03-20classes/externalsrc: fix for recipes that fetch local filesPaul Eggleton
If SRC_URI contains local files (file:// references) these will almost certainly be required at some point during the build process, so we need to actually fetch these to ${WORKDIR} as we would normally. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-23classes/externalsrc: show a warning on compilingPaul Eggleton
Make sure there's no chance of anyone forgetting they have a recipe set up for externalsrc; otherwise you could get confused about what is going on. (With our default logging setup we can't make it a note because the UI doesn't forward those; otherwise I would have used bb.note().) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-23classes/externalsrc: add workaround for recipes that use SRCPV in PVPaul Eggleton
Here we set SRC_URI to blank, however doing so means that the function that is called when you expand the default value of SRCPV (i.e. bb.fetch2.get_srcrev()) will fail, so any recipe that references SRCPV in PV couldn't previously be used with externalsrc. (At some point we may fix the function to work in the externalsrc case, but then we would also need to ensure that ${B} did not change as a result of PV changing any time the HEAD revision changes in the external source tree, or you'll lose any intermediate build artifacts.) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-23classes/externalsrc: fix source being wiped out on clean with kernelPaul Eggleton
kernel.bbclass adds ${S} do do_clean[cleandirs], but this means if you run bitbake -c clean <kernelrecipe> then your external source tree will be trashed, which could be a disaster. For safety, remove ${S} from cleandirs for every task. We also have to do the same for ${B} in the case where EXTERNALSRC_BUILD is set to the same value as EXTERNALSRC. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-21classes/externalsrc: set do_compile as nostampPaul Eggleton
Most of the time what you want when using this class is for do_compile to execute more than just once - every time the source changes would be ideal, but that's a little tricky to accomplish. Thus, set do_compile as nostamp to get something close. Note that in order to be effective this also requires the change to bitbake that causes nostamp task signatures to change on each execution. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-21externalsrc: Fix deltask usageRichard Purdie
An incorrect version of the patch merged which entirely removed the covered variable. This corrects the patch so the code works. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-20externalsrc: Use deltask APIRichard Purdie
Now we have deltask API, stop poking around bitbake internal variables. (From OE-Core rev: 98637df0c04fd14b506d9eec7da8ec6ae441221b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-17classes/externalsrc: enable global inherit and simplify usagePaul Eggleton
This class can now be inherited globally using INHERIT += rather than needing to inherit it in the recipe itself. Additionally, instead of setting S (and optionally B), set EXTERNALSRC (and optionally EXTERNALSRC_BUILD) to point to the external source and build locations respectively. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-01externalsrc.bbclass: Add class for handling external source treesRichard Purdie
This is loosly based upon srctree.bbclass from OE-Classic but with some changes appropriate to OE-Core. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>