summaryrefslogtreecommitdiffstats
path: root/meta/classes/sanity.bbclass
AgeCommit message (Collapse)Author
2022-08-12classes: Update classes to match new bitbake class scope functionalityRichard Purdie
Move classes to classes-global or classes-recipe as appropriate to take advantage of new bitbake functionality to check class scope/usage. 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-06-25sanity.bbclass: Add ftps to accepted URI protocols for mirrors sanityDavid Bagonyi
Signed-off-by: David Bagonyi <david.bagonyi@gmail.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
2022-06-06sanity: Switch to make 4.0 as a minimum versionRichard Purdie
We can't build glibc without make 4.0 and we don't work on older distros with older versions of make without buildtools tarball so increase the minimum version to 4.0. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-11sanity: Don't warn about make 4.2.1 for mintRichard Purdie
Whilst not a supported distro, we can exclude this from the warning as it is debian derived and doesn't have the issue. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-27sanity: skip make 4.2.1 warning for debianNicolas Dechesne
This is a follow up patch of: ad5829aa1f8a (sanity: Show a warning that make 4.2.1 is buggy on non-ubuntu systems) Debian10 has the exact same version/sources for make as Ubuntu (focal), e.g. https://packages.debian.org/source/buster/make-dfsg and https://packages.ubuntu.com/source/focal/make-dfsg. As per the corresponding changelog, the patch mentioned in ad5829aa1f8a, is included in both Debian and Ubuntu in make 4.2.1-1.1. So it's safe to use make 4.2.1 in Debian10. Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-14sanity: Show a warning that make 4.2.1 is buggy on non-ubuntu systemsRichard Purdie
We keep seeing hangs on the autobuilder with make 4.2.1 on Centos8, Alma8 and OpenSuse workers. The hang occurs in perl and kernel builds in particular. The issue is fixed in 4.3 and has been patched on Ubuntu systems: https://git.savannah.gnu.org/cgit/make.git/commit/?id=78b5fec6898c26956d00548427cda1101cb80f8a https://savannah.gnu.org/bugs/?51400 Add a sanity test for make 4.2.1 and error for non-ubuntu systems. We're making a buildtools-make-tarball available which can be used to allow systems with the broken version to use the project. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-24sanity: Add warning for local hasheqiv server with remote sstate mirrorsRichard Purdie
We're seeing a lot of users configuring an sstate mirror but not realising that the default hash equivalenve setting will make this ineffective. Add a warning to highlight this to the user for the common case. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2022-03-02OELAYOUT_ABI: bump, avoid tmp/ breakage by removing old cross manifestsAlexander Kanavin
Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-12default-distrovars.inc: Switch connectivity check to a yoctoproject.org pageRichard Purdie
example.com is proving unreliable at present so switch to our own connectivity page instead. That page is very simple avoiding app overhead on our web server which was an original reason for switching to example.com. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-01-14sanity: Drop TUNEABI, TUNEABI_WHITELIST, TUNEABI_OVERRIDERichard Purdie
These were added nearly a decade ago but there are no users in OE-Core. I checked with the likely users and they seem to have no current usage either. Therefore remove them. If needed for some prebuilt library somewhere, they could be implemented in the layer using them instead but I doubt these are in use any longer. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-29sanity/lib: Replace usage of LooseVersion() with bb.utils.vercmp_string_op()Richard Purdie
distutils is going away and we have functionality in bitbake which can handle these comparisions so switch to the bb.utils function. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03sanity.bbclass: Update required gcc version to v7.5Robert Yang
qemu-native 6.1.0 requires at least gcc v7.5: ERROR: You need at least GCC v7.5 or Clang v6.0 (or XCode Clang v10.0) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-30meta: Manual override fixesRichard Purdie
The automated conversion of OE-Core to use the new override sytax isn't perfect. This patches some mis-converted lines and some lines which were missed by the automation. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-30Convert to new override syntaxRichard Purdie
This is the result of automated script conversion: scripts/contrib/convert-overrides.py <oe-core directory> converting the metadata to use ":" as the override character instead of "_". Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-06sanity.bbclass: mention CONNECTIVITY_CHECK_URIS in network failure messageMichael Opdenacker
This expands the error message when a network failure is detected. It happens that some ISPs or networks block the default example.com domain. Therefore, instead of disabling network access, it lets the user know how to modify the test URL. Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-20sanity: Further improve directory sanity testsRichard Purdie
Add tests to ensure COREBASE/TMPDIR doon't contain ".." as this causes hard to understand build failures. Also rework the code to test TMPDIR and COREBASE for all the patterns since they may be set differently and one may contain problematic characters. [YOCTO #14111] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-18sanity: Add error check for '%' in build pathRichard Purdie
It has been reported that '%' characters in build paths break with python exceptions, probably due to confusion with python string escaping. Whilst it is probably fixable, showing the user a human readable error is better given it doesn't work. [YOCTO #14282] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-11sanity.bbclass: Add az fetcher to accepted URI protocols for mirrors sanityAlejandro Hernandez Samaniego
Signed-off-by: Alejandro Enedino Hernandez Samaniego <alhe@linux.microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-03sanity.bbclass: Check if PSEUDO_IGNORE_PATHS and paths under pseudo control ↵Dorinda
overlap Added a sanity check for when PSEUDO_IGNORE_PATHS and paths under pseudo control overlap to avoid random failures generated. [YOCTO #14193] Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-30Revert "sanity.bbclass: check if PSEUDO_IGNORE_PATHS and ${S} overlap"Richard Purdie
This reverts commit c5a6cc4146402620851e2a1f2b01d69989150ba2. This was accientally added and shouldn't have been, it has a v2 and was then determined not to be required.
2021-01-30sanity.bbclass: check if PSEUDO_IGNORE_PATHS and ${S} overlapDorinda
added a sanity check for when PSEUDO_IGNORE_PATHS and ${S} overlap to avoid random failures generated. [YOCTO #14193] Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-27sanity.bbclass: sanity check for if bitbake is present in PATHDorinda
If a user executes the environment script instead of sourcing it, there's an error about an empty element in PATH. This is because bitbake isn't present in environment variable PATH. Hence, this patch adds a sanity check to verify if bitbake is present in PATH and if bitbake isn't present issue a warning message. [YOCTO #13822] Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-27sanity: Verify that user isn't building in PSEUDO_IGNORE_PATHSDorinda
If a user builds in a path in PSEUDO_IGNORE_PATHS, random failures are generated. Hence this patch adds a sanity check in sanity.bbclass to ensure that a user isn't building in PSEUDO_IGNORE_PATHS. [YOCTO #14179] Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-08sanity: Bump min python version to 3.6Richard Purdie
There are a number of reasons 3.6 is a good minimum version. Of our supported/tested distros, only debian 9 still had python 3.5, the others have 3.6+ or already required buildtools-tarball. New versions of qemu need python 3.6 as a minimum. We could work around that but it seems simper to require 3.6 which will allow other improvements. As such, bump the minimum python version requirement to 3.6. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-09abi_version,sanity: Tell users TMPDIR must be clean after pseudo changesRichard Purdie
After the recent path ignore changes, there are invalid entries in exiting pseudo databases which will trip up users with the new abort() (proving how common the pseudo potential corrpution is!). Inform them a clean TMPDIR is needed. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-07classes/sanity: Bump minimum python version to 3.5Joshua Watt
Bumps the minimum python version to 3.5 to match bitbake and the test matrix Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-24sanity.bbclass: Detect and fail if 'inherit' is used in conf fileGregor Zatko
'inherit' directive may not be used in conf files as it's supposed to be used for the inheritance of classes. Correct form in conf file is INHERIT. This commit adds: - a sanity check to find whether the wrong case exists - fail the build if so - tell user about the difference in directives [YOCTO #5426] Signed-off-by: Gregor Zatko <gzatko@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-02sanity: Require gcc 6 or laterRichard Purdie
New versions of rpm have issues with the libgomp support in gcc 5.x so raise the minimum to 6 or later. This mainly affects Ubuntu 16.04. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-06Windows: Enable Windows builds under WSLv2 and warn accordinglyAlejandro Hernandez Samaniego
Due to the architectural changes between Windows Subsystem for Linux v2, and WSL v1 it should now be possible to run bitbake on the several distros offered through the Microsoft Store. WSLv2 is available on Windows 10 build number > 18917 The current build number may be checked by opening a cmd prompt on Windows and running: C:\Users\myuser>ver Microsoft Windows [Version 10.0.19041.113] If a distro has already been installed via the Microsoft Store, then we can check which WSL version its using by opening a Windows Powershell (notice this is a powershell and not a cmd prompt): C:\WINDOWS\system32> wsl -l -v NAME STATE VERSION * Ubuntu Running 2 Debian Stopped 1 In this case it shows two distros installed, Ubuntu running WSLv2 and Debian running WSLv1 To change the version of WSL being used by a certain distro run: C:\WINDOWS\system32> wsl --set-version <Distro> 2 e.g C:\WINDOWS\system32> wsl --set-version Debian 2 For more information on installing WSLv2 please look at: https://docs.microsoft.com/en-us/windows/wsl/wsl2-install There are some caveats related to the way storage is handled by WSLv2 though, and at this point these have to be managed by the user manually, the storage space used by WSL is not reflected immediately and since bitbake heavily uses storage, after several builds this can prove to be a bit of an issue. WSLv2 uses a VHDX file for storage, this issue can be easily avoided by optimizing this file every now and then, this can be done via the following: 1.- Find the location of your VHDX file: - Get the distro app package directory. - Open Windows Powershell as Administrator and run: Get-AppxPackage -Name "*<DISTRO>*" | Select PackageFamilyName e.g.: PS C:\WINDOWS\system32> Get-AppxPackage -Name "*Ubuntu*" | Select PackageFamilyName PackageFamilyName ----------------- CanonicalGroupLimited.UbuntuonWindows_79abcdefgh Replace the PackageFamilyName (and your user) on the following path: C:\Users\<user>\AppData\Local\Packages\<PackageFamilyName>\LocalState\ e.g. ls C:\Users\<user>\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\ Mode LastWriteTime Length Name -a---- 3/14/2020 9:52 PM 57418973184 ext4.vhdx The VHDX file path is: C:\Users\<user>\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\ext4.vhdx 2.- Optimize your VHDX file (Also on Powershell): - Make sure WSL is shutdown wsl --shutdown - Optimize it optimize-vhd -Path C:\Users\<user>\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\ext4.vhdx -Mode full A progress bar should be shown while optimizing the VHDX file. As an example, after building core-image-sato, removing the TMPDIR did not reflect any changes on Windows Explorer for storage space being used, after optimizing the VHDX file, 14 extra GB were shown as free. So, as long as the the user optimizes its storage, the builds should run smoothly. This patch warns the user that is running bitbake under WSLv2, that they should optimize the VHDX file eventually to avoid storage issues. The same check previoulsy used for WSLv1 works for WSLv2, checking for the kernel version: WSLv1: Linux version 4.4.0-19041-Microsoft (Microsoft@Microsoft.com) WSLv2: Linux version 4.19.84-microsoft-standard (oe-user@oe-host) Builds have been tested under Ubuntu and Debian distros offered and installed through the Microsoft Store, and other distros should be able to run builds just as fine. Performance wise, using the same hardware, and same configuration a comparison between builds using native Linux vs WSLv2 for the following targets has been performed: - core-image-minimal - core-image-sato - core-image-sato-sdk - meta-toolchain No real evidence of any performance changes could be found, with WSLv2 builds running even faster in some cases. Running a recently built image can be done just as smoothly, if using "nographic" as argument for runqemu, or if its a graphical image, installing an X server and running runqemu runs just as fine. Happy bitbaking. Signed-off-by: Alejandro Hernandez Samaniego <alejandro@enedino.org> Signed-off-by: Alejandro Hernandez Samaniego <alhe@linux.microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-03sanity.bbclass: echo current SDK_VENDOR if it is invalidPaul Gortmaker
It can be frustrating if this sanity check triggers, but you don't know why; you haven't explicitly set any SDK vars, or similar. At least echo out the offending value, so the end user has a bit more information to go on. Before: SDK_VENDOR should be of the form '-foosdk' with a single dash After: SDK_VENDOR should be of the form '-foosdk' with a single dash; found '-overc-sdk' Cc: Ross Burton <ross.burton@intel.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-02sanity: 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>
2020-04-01sanity.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>
2020-04-01sanity.bbclass: recommend using install-buildtoolsTim Orling
For old tar version (< 1.28), recommend using scripts/install-buildtools Drop check for tar version 1.24. Dubious extra value. Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-03bitbake.conf/sanity: Drop makeinfo as being required on buildhostRichard Purdie
This is a long standing 'odd' dependency which we've meant to resolve. We shouldn't need it and it introduces reproducability issues. We already have texinfo-dummy-native and texinfo-native which can provide it but the work to remove the hosttool was never completed. After cleaning up texinfo.bbclass, this can now be removed with minimal impact on build time. [YOCTO #13753] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-10sanity.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>
2019-11-22sanity: 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>
2019-11-04sanity: check for more bits of PythonRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com>
2019-10-19sanity: 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>
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>