aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
AgeCommit message (Collapse)Author
2016-09-12meta: cleanup d.getVar(var, 0)rbt/getvarRobert Yang
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
2016-09-03base, autotools: Append PACKAGECONFIG_CONFARGS to EXTRA_OECONF only in ↵Martin Jansa
autotools.bbclass * recipes which don't inherit autotools or cmake bbclass and want to use the configure options from PACKAGECONFIG need to handle PACKAGECONFIG_CONFARGS themselves. Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-25license: simple verification of LICENSE_<pkg> valuesMarkus Lehtonen
LICENSE should be a superset of all LICENSE_<pkg> values. That is, LICENSE should contain all licenses and LICENSE_<pkg> can be used to "filter" this on a per-package basis. LICENSE_<pkg> shouldn't contain anything that isn't specified in LICENSE. This patch implements simple checking of LICENSE_<pkg> values. It does do not do advanced parsing/matching of license expressions, but, checks that all licenses mentioned in LICENSE_<pkg> are also specified in LICENSE. A warning is printed if problems are found. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-04base.bbclass wipe ${S} before unpacking sourceMarkus Lehtonen
Make sure that we have a pristine source tree after do_unpack. [YOCTO #9064] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2016-06-17base.bbclass: p4 fetcher supports srcrevAndrew Bradford
Enable the perforce fetcher to call bb.fetch2.get_srcrev() as it can use 'SRCREV = "${AUTOREV}"'. Signed-off-by: Andrew Bradford <andrew.bradford@kodakalaris.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Complete transition to python3Richard Purdie
This patch contains all the other misc pieces of the transition to python3 which didn't make sense to be broken into individual patches. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-21meta: Update to modern exception syntaxRichard Purdie
Update older exception syntax to modern one required by python 3. Compatible with python 2.7. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-17classes/base: get_lic_checksum_file_list imporve validaton of url'sAníbal Limón
When specify an URL different that supported file:// the function returns an empty path causing an exception without notice the user that the URL is Malformed. [YOCTO #9211] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-19base.bbclass: Introduce PACKAGECONFIG_CONFARGS variableMartin Jansa
* add separate variable for configuration options generated from PACKAGECONFIG setting, this helps other bbclasses and recipes to take advantage of PACKAGECONFIG mechanism, without including other options from EXTRA_OECONF * e.g. meta-qt5 recipes are abusing EXTRA_OECONF to get options from PACKAGECONFIG: EXTRA_QMAKEVARS_PRE += but with conf/distro/include/no-static-libs.inc it means getting --disable-static as invalid option inside EXTRA_QMAKEVARS_PRE as reported by Alexandre Belloni who tried to use poky with meta-qt5. * once we migrate all bbclasses and recipes to PACKAGECONFIG_CONFARGS we should also restrict EXTRA_OECONF append only to autotools.bbclass like I did for cmake.bbclass Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-03base: Fixup PACKAGECONFIG incorrect mappingsRichard Purdie
PACKAGECONFIG doesn't work in cross-canadian recipes at the moment as DEPENDS are prepended with mlprefix. A recipe is either nativesdk, native or target so adjust the if statements accordingly, use inherits_class for more accurate recipe classification and add cross-canadian support. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-31base.bbclass: avoid duplicate call to d.getVar('LICENSE', True)Andre McCurdy
Reuse the 'license' variable, instead of calling d.getVar('LICENSE', True) again. Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-31base.bbclass: drop obsolete HOSTTOOLS_WHITELIST_GPL-3.0Andre McCurdy
base.bbclass sets 'check_license' to False (and therefore skips license checking completely) for native, nativesdk, etc recipes (ie anything which could potentially be classed as "host tools"), so supporting a dedicated whitelist of GPLv3 host tools is not necessary. Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28base: Add nodejs-native dependency for npm:// urlsRichard Purdie
With the addition of the npm fetcher, we add the native dependency handling too. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-12base.bbclass: fix support for gitsm://Patrick Ohly
Before the "Improve handling of SRCPV" change, gitsm SRC_URI entries were merely missing a dependency on git for do_fetch. But after that change, the special handling for "needsrcrev" was not applied, leading to a fetcher error (older bitbake) or even a parse error (recent bitbake). Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10base: Make do_cleansstate nostampRichard Purdie
We always want the cleansstate task to run so it should be 'nostamp' like the other clean tasks. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10bitbake.conf/base: Improve handling of SRCPVRichard Purdie
If SRCPV is set, it can be expanded when SRC_URI doesn't support it leading to errors. Avoid doing this by setting it only when it makes sense. This patch depends on the bitbake python expansion patch series. [YCOTO #7772] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-04meta: add ASSUME_PROVIDED dependency on wget-native for http fetchesRoss Burton
For clarity and consistency, add a dependency on wget-native for any URIs that will be fetched using the wget fetcher, and add wget-native to ASSUME_PROVIDED. Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-31Make sure that the directory for CONFIGURESTAMPFILE existsMarkus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-29base: Move COMPATIBLE_MACHINE out the scope of SOURCE_MIRROR_FETCHRichard Purdie
Recipes setting COMPATIBLE_MACHINE are likely to have SRC_URI entries which can heavily depend on the configured machine. Skipping them for SOURCE_MIRROR_FETCH is therefore not advised and leads to build errors whilst not particularly improving source mirrors. [YOCTO #8802] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-12-22classes/base: don't print header if BUILDCFG_HEADER not setPaul Eggleton
If we don't want a header printed at the start of task execution (which we'd prefer not to within the extensible SDK) we can accomplish that by clearing BUILDCFG_VARS and BUILDCFG_HEADER, but that was still printing a load of blank lines. To keep things simple, check if BUILDCFG_HEADER is set to something before printing a header. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-09base: check for existing prefix when expanding names in PACKAGECONFIGRoss Burton
When the DEPENDS are added as part of the PACKAGECONFIG logic the list of packages are expanded so that any required nativesdk-/-native/multilib prefixes and suffixes are added. However the special handling of virtual/foo names doesn't check that the prefix already exists, which breaks under nativesdk as in that situation there's an explicit nativesdk- prefix *and* MLPREFIX is set to nativesdk-. This results in the same prefix being applied twice, and virtual packages such as virtual/libx11 ending up as virtual/nativesdk-nativesdk-libx11. Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-12-07base: Improve handling of switching virtual/x providersRichard Purdie
If you build virtual/kernel, then change PREFERRED_PROVIDER_virtual/kernel from say "linux-yocto" to "linux-yocto-dev", you see errors from the sysroot about overlapping files. The automatic uninstall logic doesn't trigger since the other recipes is still technically parsed/buildable. What we can do is look at the value of PREFERRED_PROVIDER_virtual/X and raise SkipRecipe (skip parsing) if it provides this thing and its not selected. We skip cases no preferred provider is set, or the value is in MULTI_PROVIDER_WHITELIST.We also inform the user if they try to build something which conflicts with the configuration: $ bitbake linux-yocto-tiny ERROR: Nothing PROVIDES 'linux-yocto-tiny' ERROR: linux-yocto-tiny was skipped: PREFERRED_PROVIDER_virtual/kernel set to linux-yocto, not linux-yocto-tiny [YOCTO #4102] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01base: add automatic dependency on lzip-native for .lz SRC_URIRoss Burton
Now that the SRC_URI is parsed this can be done without false-positives. Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-12-01base: decode SRC_URI before adding implicit fetch dependenciesRoss Burton
To avoid false positives such as a SRC_URI for http://foo.xz/foo.zip gaining a dependnecy on xz-native decode the URI so that precise tests can be done. Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-11-24classes: Ensure pass setVar/setVarFlag strings, not integersRichard Purdie
This doesn't cause any issues right now but it make sense to standardise on consistently using strings in the data store. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-10-24base.bbclass: considering multilib when setting LICENSE_EXCLUSIONJian Liu
The PACKAGES is not mapped with MLPREFIX when setting LICENSE_EXCLUSION in base.bbclass. For example, For libgcc-dev, LICENSE_EXCLUSION-libgcc-dev=1 but for lib32-libgcc-dev, LICENSE_EXCLUSION-libgcc-dev=1 Obviously it is wrong for lib32-libgcc-dev. Add MLPREFIX before the package name during setting LICENSE_EXCLUSION Signed-off-by: Jian Liu <jian.liu@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-10-19classes/base: provide hints on PACKAGECONFIG errorJoe MacDonald
Commit 771f89498c introduces an error message that is very rarely hit and when it is, it is usually easy to trace the root cause very quickly. The information provided in the error message isn't enough to lead you back to the actual failure, however, so expand upon it a bit, pinpointing the specific package and flag that fails. Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-11Revert "base.bbclass/blacklist.bbclass: remove doc item when d.getVarFlags()"Ross Burton
This deletes and therefore breaks PACKAGECONFIG[doc], so revert. This reverts commit b741780d43ad412f6a1ae91d8489ec3522447ea2. Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-01base.bbclass/blacklist.bbclass: remove doc item when d.getVarFlags()Robert Yang
The FOO[doc] is set in meta/conf/documentation.conf, we need remove it from d.getVarFlags()'s return dict when it causes many loops. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01base.bbclass: move invalid PACKAGECONFIG checking to insane.bbclassRobert Yang
There was a problem when check invalid PACKAGECONFIG in the anonymous function (when parsing), for example, there are two versions of a recipe: foo_1.0.bb foo_2.0.bb While foo_2.0.bb has a "PACKAGECONFIG[item] = 'x,y,z'", but foo_1.0.bb doesn't, if we set PACKAGECONFIG_pn-foo = "item" in a conf file, we would get the warning about invalid PACKAGECONFIG for foo_1.0.bb. Delay the checking to build time will fix the problem. [YOCTO #8065] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01base.bbclass: Note when including pn with INCOMPATIBLE_LICENSESBeth Flanagan
We need to be able to tell people if we WHITELIST a recipe that contains an incompatible licese. Example: If we set WHITELIST_GPL-3.0 ?= "foo", foo will end up on an image even if GPL-3.0 is incompatible. This is the correct behaviour but there is nothing telling people that it is even happening. Signed-off-by: Beth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-31pixbufcache: Use sceneQueueComplete event to simplify usageRichard Purdie
Ensuring the native pixbuf cache is correct after new loaders have been installed is tricky. This needs to be done without races and work regardless of whether the build is from sstate or freshly built for one or more modules. This adds a hook into base.bbclass which is then triggered by the code from pixbufcache. This patch is an improved version which means base.bbclass has no pixbuf knowledge and the mechanism can be reused in other cases. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16classes/base: fix die() to print the full logPaul Eggleton
The recent change to connect through the shell logging functions caused a regression - bb.error() and bb.fatal() cause a flag to be set internally such that BitBake's UI will not print the full task log on failure; unfortunately we have in a lot of places called die() or bbfatal() within shell functions with a very terse message as a means of exiting out, where we still want to see the full log (and we were previously). We do still want to have fatal errors with proper messages that don't result in the full log being printed, however we can't ignore the typical usage of die(). Having added a mechanism to BitBake to log an error and reset the flag, create a bbfatal_log() function that uses this and call it from die() to restore the previous behaviour. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2015-07-16do_unpack: move qa check of unpack into insane.bbclassBian Naimeng
Some source archive are not standard format. For example, sometimes, we still need decompress file once again after base_do_unpack, in such case, the following warning will be caught. WARNING: xxx : the directory ${WORKDIR}/xxxx (xxxxxx) pointed to by the S variable doesn't exist \ - please set S within the recipe to point to where the source has been unpacked to So, we should do this QA check after all of unpack jobs been completed. Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-12oeqa/sstatetests: Add NATIVELSB sstate signature equivalence testRichard Purdie
The sstate checksums should be independent of whichever NATIVELSBSTRING is detected. Add an automated QA test which tests this using bitbake -S. To make this possible, we need to be able to override the value of NATIVELSBSTRING so make a small change to allow this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23meta: Add explict getVar param for (non) expansionRichard Purdie
Rather than just use d.getVar(X), use the more explict d.getVar(X, False) since at some point in the future, having the default of expansion would be nice. This is the first step towards that. This patch was mostly made using the command: sed -e 's:\(getVar([^,()]*\)\s*):\1, False):g' -i `grep -ril getVar *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23base.class: warn for invalid PACKAGECONFIGRobert Yang
There may be typos or out of date values in PACKAGECONFIG, check and warn them. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-01base: Fix license checksum rebuild problemsRichard Purdie
"MACHINE=qemux86-64 bitbake init-ifupdown; MACHINE=genericx86-64 bitbake init-ifupdown" shows a rebuild when it would be expected. The reason is a LIC_FILES_CHKSUM which contains file://${WORKDIR}, an absolute path which doesn't exist in the first build but does in the second, causing a signature change and a rebuild. Fix the problem by ignoring any file:// url which resolves since TMPDIR for license file dependency purposes. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-14base: Avoid find raceRichard Purdie
In a similar way to http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=aa1438b56f30515f9c31b306decef7f562dda81f and http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=527b28c10955daf0387597020d69593ce24bcaa4 there is a find race in base.bbclass. For recipes with PACKAGES_remove = "${PN}", the find which removes .la files can race against deletion of other directories in WORKDIR e.g.: find: '/home/autobuilder/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/tmp/work/qemux86_64-poky-linux/init-ifupdown/1.0-r7/sstate-build-populate_lic': No such file or directory | WARNING: /home/autobuilder/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/tmp/work/qemux86_64-poky-linux/init-ifupdown/1.0-r7/temp/run.do_configure.6558:1 exit 1 from | find /home/autobuilder/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/tmp/work/qemux86_64-poky-linux/init-ifupdown/1.0-r7 -name \*.la -delete Fix the race in the same way. [YOCTO #7522] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-05bitbake.conf/base.bbclass: Drop PRINC supportRichard Purdie
PRINC is no longer needed since we have the PR service instead which people should be using. Drop the PRINC code. This has been deprecated with a warning and then an error for quite some time so we can remove it now. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-30gcc-shared-source: Add PV to PNRichard Purdie
This means you can have one gcc version for some gcc recipes (e.g. crosssdk/nativesdk) and another gcc version for target code. Also remove the preferred version entry from the default toolchains list since the version issue is now handled automatically. We also need to specifically handle gcc-source in the license handling code since expanding ${PV} in the base class isn't possible. Since gcc-source doesn't generate any packages directly this shouldn't be an issue and whitelisting in this way is easiest (and matches the rest of the toolchain handling). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-19classes/base: clarify S not set correctly warningPaul Eggleton
Hopefully make it a bit clearer to the user which recipe needs fixing and what needs to be done to fix it. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-20base.bbclass: clean up warning message for 'S'Jonathan Liu
Signed-off-by: Jonathan Liu <net147@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-03-09base.bbclass: Add LIC_FILES_CHKSUM files to checksum files.Randy Witt
Previously, files with absolute paths in LIC_FILES_CHKSUM such as "file://${COMMON_LICENSE_DIR}/foo" would not result in a qa failure when the license file changed. To fix this problem, add any files with absolute paths from LIC_FILES_CHKSUM to the file-checksums varflag, so that changes in the license file are detected and cause the qa task for licenses to run. [Yocto #6450] Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-01-23base.bbclass: detect when S has been set incorrectlyPetter Mabäcker
Currently base.bbclass is creating S if it's not created by unpacking an archive or fetching a repository. If we avoid creating S we can detect when S hasn't been set correctly, since it will not exist. Then we can tell the user that they should set S to a proper value, instead of just failing with odd errors in later tasks. Besides removing the auto-creation of S this change will introduce a warning if S is set incorrectly. The reason for not display an error and return is due to all external layers that might have recipes that will fail otherwise and that might be a bit to hard to start with. So use a warning until people have had a chance to cleanup affected recipes. [YOCTO #5627] Signed-off-by: Petter Mabäcker <petter@technux.se>
2015-01-07base.bbclass: Avoid explicit ${MAKE} in do_configureOtavio Salvador
The do_configure may eventually call 'make clean' when the sstate signature does not match. We should respect EXTRA_OEMAKE when doing so, so use 'oe_runmake' for it. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-24license: Validate if LICENSE is well defined.Aníbal Limón
Add check_license_format function that shows warning if LICENSE don't have valid operators and also if have space separated entries without operator, add check_license_format validation into base class. [YOCTO #6758] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-19base/license.bbclass: expand wildcards in INCOMPATIBLE_LICENSEHongxu Jia
The whitelist processing in code in base.bbclass does not play well with wildcards in INCOMPATIBLE_LICENSES. The code expects bad_licenses to contain actual license names, not wildcards. Add incompatible_license_contains to replace bb.utils.contains( "INCOMPATIBLE_LICENSE", **, **, **, d) [YOCTO #5592] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
2014-12-05base.bbclass: fix CLEANBROKEN logicRoss Burton
The evalation order was incorrect in some situations (CLEANBROKEN=1 and GNUmakefile exists) the clean would be executed incorrectly. Add brackets to correct the logic. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-03base.bbclass: don't skip defaultvalRoss Burton
This field is now internal and won't be seen. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>