summaryrefslogtreecommitdiffstats
path: root/meta/classes/sanity.bbclass
AgeCommit message (Collapse)Author
2020-04-19sanity: Require gcc 5.0 minimum versionRichard Purdie
After polling various develoeprs, its clear that many layers are struggling with gcc 4.8 and its better for the project to adopt 5.0 as a minimum version at this point in time. We should have technology like buildtools-extended-tarball available to ensure things still work on Centos 7 and Debian 8. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit abc741af16311cb473b7e3185ae34265b243d804) Signed-off-by: Armin Kuster <akuster808@gmail.com>
2020-04-19sanity.bbclass: add test for gcc < 4.8Tim Orling
It is known that old versions of gcc prior to 4.8 causes builds to fail. Add a test for BUILD_CC == 'gcc' and gcc < 4.8 and recommend using scripts/install-buildtools or user built buildtools-extended-tarball. Use the new get_host_compiler_version function from lib/oe/utils.py NOTE: another solution is to install devtoolset-6+ from scl [1], but this is a rather large install (> 1 Gb) and fairly invasive. [1] https://www.softwarecollections.org/en/scls/rhscl/devtoolset-6/ Adding this code means we can increase the minimum version easily in the future too (which will soon be needed). RP: Change minimum version from 5.0 to 4.8 for initial patch Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3bb3b9cbad82b2f09386153226d1d4e769b7347b) [Fixup for zeus context] Signed-off-by: Armin Kuster <akuster808@gmail.com>
2020-03-20sanity: check for more bits of PythonRoss Burton
MJ: icu in master doesn't need distutils anymore, because icu 65.1 currently in dunfell/master doesn't depend on python3-distutils anymore since: https://github.com/unicode-org/icu/commit/b4d41b0561b6e8de38b99850ce0e4be8ef536bb1 but the icu-64.2 in zeus and openembedded-core/meta/recipes-core/ovmf/ovmf_git.bb still need python3-distutils as described in: http://lists.openembedded.org/pipermail/openembedded-core/2020-March/293984.html Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2020-01-15sanity.bbclass: Move sanity_info from conf to cachePeter Kjellerstedt
Since this file is written during recipe parsing, having it in the ${BUILDDIR}/conf directory, which is covered by an inotify watcher, will trigger a re-parse the next time bitbake is run and the resident bitbake server is enabled. This causes the sanity_info file to be updated again, which triggers a new parse the next time bitbake is run ad infinitum. Moving it to ${BUILDDIR}/cache should avoid this. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit f98103b548aa7dba6b1be6c8e02ef41858a8e85c) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2019-11-25sanity: Add check for tar older than 1.28Richard Purdie
Older versions break opkg-build when reproducible builds are enabled. Rather than trying to be selective based on which features are enabled, lets just make this a minimum version. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-10-25sanity: check the format of SDK_VENDORRoss Burton
If SDK_VENDOR isn't formatted as -foosdk and is instead for example -foo-sdk then the triple that are constructed are not in fact triples, which results in mysterious compile errors. Check in sanity.bbclass so this failure is detected early. [ YOCTO #13573 ] Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit b0efd8d4d0dbc30e6505b42f5603f18fa764d732) Signed-off-by: Armin Kuster <akuster808@gmail.com>
2019-08-06sanity: update for new bb.build.exec_func() behaviourRoss Burton
The pythonexception argument is no more, and passing True is the new behavior. [ YOCTO #13468 ] Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-11sanity: check_perl_modules bug fixZheng Ruoqin
Fix Python3 TypeError error in check_perl_modules: Executing bitbake, the following error message will be throwed: File ".../poky/meta/classes/sanity.bbclass", line 979, in check_sanity_eventhandler check_sanity(sanity_data) File ".../poky/meta/classes/sanity.bbclass", line 943, in check_sanity check_sanity_version_change(status, sanity_data) File ".../poky/meta/classes/sanity.bbclass", line 637, in check_sanity_version_change status.addresult(check_perl_modules(d)) File ".../poky/meta/classes/sanity.bbclass", line 563, in check_perl_modules errresult += e.output TypeError: must be str, not bytes So here, transfer e.output from bytes to str. Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-09sanity: clarify error message if TMPDIR movesRoss Burton
If TMPDIR is moved the error message says "move it back or rebuild" but the obvious rebuild method of running 'bitbake [recipe]] -cclean' fails with the same error. Make it clear what we mean by adding "delete and". Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-18class/sanity: strip the output of get_filesystem_id()Steven Hung (洪于玉)
A previous commit 2f44b9b replace oe.utils.getstatusoutput() to subprocess.check_output(). check_output() don't remove a trailling newline. Add strip() Signed-off-by: Steven Hung (洪于玉) <Steven.Hung@mediatek.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-16sanity: Add check for WSLRichard Purdie
Users are starting to expect OE to work under WSL which it doesn't. Add a warning to tell them about this up front and manage expectations. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-08classes/sanity: Clean up getstatusoutput usageJoshua Watt
Replace usage of oe.utils.getstatusoutput() with direct subprocess calls. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-03-28sanity.bbclass: quote path passed to stat in get_filesystem_id()Andre McCurdy
Although get_filesystem_id() is a private API and never gets passed a path containing spaces or other special characters, etc, quote the path anyway for consistency. Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-02-06sanity.bbclass: modified error messageJuro Bystricky
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-12-10classes/sanity: check we don't have an ancient GNU patchRoss Burton
We depend on the host GNU patch, but patch < 2.7 can't handle git-style patches. This results in patches that fail to apply, or worse apply incorrectly. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-12-10sanity: getstatusoutput returns an int, not a stringRoss Burton
This code is an error path so nobody noticed that oe.utils.getstatusoutput() is just a wrapper around subprocess.getstatusoutput() which returns an (int, string) pair not (string, string). Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-22sanity: check that path variables don't use ~Ross Burton
The core path variables (TMPDIR, DL_DIR, SSTATE_DIR) don't use tilde expansion but if the user does then the errors are very mysterious, so check on startup. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-22sanity: correct Python version sanity checkRoss Burton
We now require Python 3.4, not 2.7. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-07-17classes/sanity: check for case-sensitive file systemsRoss Burton
Case-insensitive file systems fail during builds in very mysterious ways, such as mpfr: ERROR: patch_do_patch: Not a directory The problem here being that mpfr has a PATCHES file, so when we try to copy the patches into ${S}/patches/ it fails. We can't and won't support case-insensitive file systems so add a sanity check to abort the build if one is found. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-07-06sanity.bbclass: fix AttributeError in mirror format checksMikko Ylinen
mirrors is a list after split() and results in: AttributeError: 'list' object has no attribute 'strip' when the 'mirror values are pairs' check fails. Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-07-06insane: remove obsolete gcc 4.5 checkRoss Burton
As gcc 4.5 is very old now (released in 2010, gcc 4.6 released in 2011) this check can be removed now. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-07-06sanity.bbclass: remove ASSUME_PROVIDED checks that can't succeedRoss Burton
qemu-arm and libsdl-native are not in HOSTTOOLS, so there's no point in checking that they're on PATH. Also qemu uses pkg-config to find SDL, so libsdl-native isn't required. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-04-05sanity: explain where TMPDIR is if we're telling the user to delete itRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-30sanity: Drop obsolete TMPDIR ABI conversionsRichard Purdie
When we get to version 12 we have a hard break as we can't convert to newer versions. There is no point in running the old conversions on an old tmpdir only to hit that block. Remove all the old conversions to avoid that and make things clearer. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-16sanity.bbclass: modify check for shellJuro Bystricky
Due to the recently implemented update-alternatives for bash binary, sanity checker may end up with a (false-positive) error such as: Error, /bin/sh links to /bin/bash.bash, must be dash or bash This patch modifies the test: presence of "/bash" or "/dash" in shell binary name results in pass. [YOCTO#11108] Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-10sanity.bbclass: allow s3 protocol when sanity checking MIRRORS, etcAndre McCurdy
Bitbake now supports an Amazon AWS S3 fetcher: http://git.openembedded.org/bitbake/commit/?id=6fe07ed25457dd7952b60f4b2153d56b15d5eea6 Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-03-03sanity: Allow whitespace only mirror entriesRichard Purdie
Forcing the use of "\n" in mirror variables is pointless, we can just require that there are pairs of values. With the bitbake restriction relaxed, we can relax the sanity check too. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15sanity.bbclass: Add which to SANITY_REQUIRED_UTILITIES.Philip Balister
Using docker with the Fedora 23 container exposed an issue with the rpm-native configure step. If which is not present the configure script fork bombs. After much pain, I tracked this to which not being present in the default container. Add a check for which so others do not have to have this experience. Signed-off-by: Philip Balister <philip@balister.org> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-02-15classes: Drop now unneeded update_data callsRichard Purdie
Now that the datastore works dynamically we don't need the update_data calls so we can just remove them. They're not actually done anything at all for a while. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23sanity/abi-version: Force a clean TMPDIR after recipe specific sysroot changesRichard Purdie
With the recipe specific sysroots, we need a clean tmpdir, else pseudo-native, openssl-native, subversion-native and serf-native need to be manually cleaned. After these there are probably more places where software doesn't rebuild correctly even if we pass in new parameters to it. The simplest solution is to force people to start from a clean TMPDIR since everything would rebuild anyway. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-17sanity.bbclass: Improved error messageJuro Bystricky
When a non-existing MACHINE is specified, sanity check issues the following message: Please set a valid MACHINE in your local.conf or environment However, MACHINE can also be set in multiconfig .conf file(s). Hence we may have several different MACHINE settings within one (multiconfig) build, so the present error message is fairly ambiguous. This patch remedies this by explicitly naming the offending MACHINE and by amending the list of places where this erroneous MACHINE definition could have originated. MACHINE=xyz is invalid. Please set a valid MACHINE in your local.conf, environment or other configuration file. [YOCTO#10810] Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-06meta/scripts: Various getVar/getVarFlag expansion parameter fixesRichard Purdie
There were a few straggling expansion parameter removals left for getVar/getVarFlag where the odd whitespace meant they were missed on previous passes. There were also some plain broken ussages such as: d.getVar('ALTERNATIVE_TARGET', old_name, True) path = d.getVar('PATH', d, True) d.getVar('IMAGE_ROOTFS', 'True') which I've corrected (they happend to work by luck). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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-11-23sanity.bbclass: fix check_connectivity() for BB_NO_NETWORK = "0"Robert Yang
The old code: network_enabled = not d.getVar('BB_NO_NETWORK', True) It is True only when BB_NO_NETWORK is not set (None), but BB_NO_NETWORK = "0" should also be True while "1" means no network, "0" means need network in a normal case. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-11-23sanity.bbclass:check_connectivity(): print more error messagesRobert Yang
This can help fix the problem when the error happens. Now the error message is: Fetcher failure for URL: 'https://www.example.com/'. URL https://www.example.com/ doesn't work. Please ensure your host's network is configured correctly, or set BB_NO_NETWORK = "1" to disable network access if all required sources are on local disk. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-11-15sanity.bbclass: fix logging of an errorMarkus Lehtonen
Fixes a crash in exception handler. All bb logging functions need an string instances as arguments. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-09-16sanity.bbclass: split out config re-parse checkMarkus Lehtonen
Split out the functionality doing configuration re-parse check into a separate event handler that is hooked into ConfigParsed event. This will make config re-parsing actually work. Re-parsing in bitbake is triggered by setting BB_INVALIDCONF whose value is checked after configuration has been parsed (after ConfigParsed event). However, previously BB_INVALIDCONF was set in SanityCheck event handler which caused re-parsing never to happen. [YOCTO #10188] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-13sanity: fix hardcoded references to gccJérémy Rosen
Signed-off-by: Jérémy Rosen <jeremy.rosen@smile.fr> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-20sanity.bbclass: Ensure we expand BUILD_PREFIXRichard Purdie
This likely used to work when we expanded python functions and broke when we stopped. Since it defaults to "", it never caused an issue but is incorrect usage so fix it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17sanity.bbclass: Only verify /bin/sh link if it's a linkOlof Johansson
If /bin/sh is a regular file (and not a symlink), we assume it's a reasonable shell and allow it. Signed-off-by: Olof Johansson <olof.johansson@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-06-02sanity: Switch urlparse to urllib.parseJeremy Puhlman
urlparse is replaced with urllib.parse functionality in python3 Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Convert to use python3 octal syntaxRichard Purdie
The syntax for octal values changed in python3, adapt to it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-01sanity: Drop setting C localeRichard Purdie
We really want the en_US locale as per the configuration and previous patches. Don't set it back to C as things will break under python3. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-30sanity: check that the en_US.UTF-8 locale existsRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-04-13sanity: allow sftp and ssh mirrorsRoss Burton
URLs in MIRRORS and PREMIRRORS are vetted against a hard-coded list of protocols which were missing sftp: and ssh:, so add them. [ YOCTO #9444 ] Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06sanity.bbclass: fix a hardcode in check_path_length()Robert Yang
* Fixed: 410 -> limit Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-05sanity: Increase minimum git version to 1.8.3.1Richard Purdie
The kernel tools assume git > 1.7.9.5, I'm unsure of the exact version but the oldest in our infrastructure is 1.8.3.1. The git fetcher also currently has nasty workarounds for git < 1.7.9.2. Moving to 1.8.3.1 as our minimum version seems sane at this point as the oldest we're testing/supporting. [YOCTO #6162] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-30sanity.bbclass: Use pythonexception to raise real exceptions without backtracesRichard Purdie
If the sanity code encounters a version change is doesn't understand, the current output is unreadable and confusing for the user, particularly due to the presence of the backtrace. Use improved functionality in bitbake to improve this and correctly pass python exceptions around. [YOCTO #9291] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-26classes/sanity: use proper multi-line string literalsPaul Eggleton
A python string literal isn't meant to be split over multiple lines unless it is explicitly multi-line. Use three quotes to indicate that. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-24sanity.bbclass: check host tool dependencies on change in NATIVELSBSTRINGBill Randle
When a user upgrades their host distro, it may no longer have all the required tools installed, but this won't be caught by bitbake resulting in possible build errors. Rather than check for installed tools on every startup, use the NATIVELSBSTRING change as indicator to rescan for host tool dependencies. Store the NATIVELSBSTRING in the sanity_info file. [YOCTO #8585] Signed-off-by: Bill Randle <william.c.randle@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>