summaryrefslogtreecommitdiffstats
path: root/meta/classes/sanity.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* sanity: refactor mirrors checks to be more pythonicChristopher Larson2014-08-271-38/+35
| | | | | | | | | | | | | - Use clearer variable names - Use variable unpacking to reference elements by name rather than index - Sacrifice a small amount of time (iterate over protocols twice per entry rather than once) for clarity: use readable generator expressions with any() rather than maintaining state. (From OE-Core rev: 9d31e1e6ce07991fe360e67295311e62a55603af) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity: fix support for regex schemes in mirrors checkChristopher Larson2014-08-271-2/+10
| | | | | | | (From OE-Core rev: c8afcb9cab9d610892db9c41b29685583f3b5773) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity: handle both \n and \\n in mirror varsChristopher Larson2014-08-271-1/+1
| | | | | | | (From OE-Core rev: 3e203e91afa48557eb754dd554944012f7f0c0a2) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: check the format of MIRRORSRobert Yang2014-08-231-0/+33
| | | | | | | | | | | | Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS: * Each mirror shoudl contain two memebers. * The local "file://" url must use absolute path (file:///). * The protocol must in protocols list. (From OE-Core rev: c8c213bb25b137cf70ba8ce9a45e60065d926735) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass/kernel.bbclass: minor fixesRobert Yang2014-08-231-4/+3
| | | | | | | | | | | | | Fixed: - Remove an unused line - Remove unneeded code after d.getVar(), we don't need the "or ''" after d.getVar() unless we need a string. - typo: PREMIRROS -> PREMIRRORS. (From OE-Core rev: 7849e50107a27b0ff2aaac47480ac1a0a79533dc) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: Add ability to verify toolchain flagsMark Hatle2014-08-021-6/+46
| | | | | | | | | | | | | | | | | | | | | | | | | When attempting to use a binary toolchain, such as meta-mentor, we want the ability to verify that the CCARGS, ASARGS and LDARGS contain the necessary and appropriate flags. This change specifically verifies, if set: TUNEABI_REQUIRED_CCARGS_tune-<tune> TUNEABI_REQUIRED_ASARGS_tune-<tune> TUNEABI_REQUIRED_LDARGS_tune-<tune> Each of these, will be processed by the class and verified that the selected tune's CCARGS, ASARGS, and LDARGS contains the listed item. This can be used to validate that the user has not accidently or otherwise missed an argument. Note, conflicting arguments are not verified. Without verification it's possible for a misconfiguration to go undetected, presenting runtime and debugging errors. (From OE-Core rev: 226f17bfd2ceea7dc5784fbfaa8608f26b90d7f3) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity: Check for setgid/setuid TMPDIRRichard Purdie2014-07-231-0/+6
| | | | | | | | | | | | Building in a TMPDIR which has setgid or setuid is a bad idea. We could try and reset the permissions but since these can also invade into other directories like the cache or sstate, lets tell the user to fix it instead. [YOCTO #6519] (From OE-Core rev: 8e44fc36018fda9b1f9ca8aebde3e744afc07eaa) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: Update minimum git version to 1.7.8Richard Purdie2014-07-081-3/+3
| | | | | | | | | | | | To quote "Maxin B. John" <maxin.john@enea.com>: git version 1.7.8 added the --list option to git-branch. Since we depend on this option in git.py, the minimum requiremnt for git should be updated to Git 1.7.8+ (From OE-Core rev: a5776ae532d6af1e880ab1a712dc768c900f88db) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: Add libsdl-native checkRichard Purdie2014-06-031-0/+4
| | | | | | | | | | If libsdl-native is in ASSUME_PROVIDED, check for it in the sanity tests. This warns the user if they've said its being provided but it isn't and prevents silent build issues. (From OE-Core rev: d9d7b0515fcf47c4cf7533a12915ea92298ce834) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity: testimage needs DISPLAY set only for qemu targetsStefan Stanacar2014-04-041-3/+5
| | | | | | | | | | | | There's no point in failing if DISPLAY isn't set if we don't boot a qemu image when using a controller like SimpleRemoteTarget or GummibootTarget. (From OE-Core rev: 9fcd3af8626e1b0979b0cde745fe0880ccc50de7) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image/image-prelink/image-mklibs/sanity: Drop pointless EXPORT_FUNCTIONSRichard Purdie2014-04-011-2/+0
| | | | | | | | | | | | | I'm sick of seeing people adding to EXPORT_FUNCTIONS in these classes when they clearly have no idea what it does. Worse, these uses of it are all broken, the naming is incorrect and they do nothing. Lets remove them and try and preserve any remaining part of my sanity. (From OE-Core rev: 05a2fb19f722652c5d13be911b8ed45a264bbb40) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/sanity: check if SDKMACHINE setting has taken effectPaul Eggleton2014-03-311-0/+2
| | | | | | | | | | | | | | | If you try to set SDKMACHINE in a distro configuration file, it won't take effect because by the time that is parsed the line in bitbake.conf which includes the appropriate conf file for SDKMACHINE has already been parsed. Check that SDK_ARCH has changed from its default value and show an error if it hasn't in order to catch this misconfiguration. Fixes [YOCTO #5861]. (From OE-Core rev: 25ba4042ae782016aaf1cb5d3dac09b2a1030a1e) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: Update against bitbake sanity event changesRichard Purdie2014-03-271-7/+6
| | | | | | | | | | Bitbake will now trigger sanity events when it needs the checks to run in all cases so we can drop the ConfigParsed hook. We now control whether events are generated or errors are raised from the event itself. (From OE-Core rev: 97108a5647f9278280c923ef69d2b0b945a26eef) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: support wildcards in SANITY_TESTED_DISTROSOlof Johansson2014-03-051-4/+9
| | | | | | | | | | | | | | With this change, you can use shell like globbing expressions (as supported by Python's fnmatch) for entries in SANITY_TESTED_DISTROS. This makes it possible to say that, e.g. "all Debian 7 Wheezy releases are supported" with the entry "Debian-7.*". [YOCTO #5265] (From OE-Core rev: 1e527136e2ac274735a25b957e0391f48b18beba) Signed-off-by: Olof Johansson <olof.johansson@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: check that TMPDIR is not located on nfsRobert Yang2014-02-021-1/+19
| | | | | | | | | | | | | | | | | | | | | There would be some unexpected errors when the whole TMPDIR is located on nfs, so add a test for it in sanity.bbclass. Note: The better way to get the filesystem id should be get f_fsid from struct statvfs, but there is no f_fsid in os.stat() or os.statvfs(), so we use 'stat -f -c "%t"' here. BTW., s/tmpdir/TMPDIR/ in the previous comment message to make them have a uniform. [YOCTO #5442] (From OE-Core rev: ee4061b43522c4893b41c3be63d06be1ee7e3c70) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: check required perl modulesRobert Yang2014-01-281-1/+14
| | | | | | | | | | | | | | | | | Several required perl modules may missing on the host, for example the Text::ParseWords, Thread::Queue and Data::Dumper are not installed by default on recent Fedora releases (19 and 20 AFAIK). There would be wild errors if they don't exist, so check them in sanity.bbclass. And add perl to SANITY_REQUIRED_UTILITIES. [YOCTO #5744] (From OE-Core rev: b46d82bea23208733b71642bb262c9a05c08efec) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity: Use random filename for maximum path length testMike Crowe2013-11-251-1/+2
| | | | | | | | | | | | | | | | check_create_long_filename used a fixed filename for its test files. This meant that os.remove(testfile) could fail with ENOENT if two instances were running at the same time against the same sstate directory. Using a randomly generated filename stops this from happening. (Although it might seem unlikely, this race did appear to occur multiple times with Jenkins - presumably because the matrix jobs were all kicked off at the same time.) (From OE-Core rev: bc28e3f26e7f85af82f403924c0ae29e1ad34a87) Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity: Don't hard code value of ENAMETOOLONGMike Crowe2013-11-251-2/+3
| | | | | | | | | | Although ENAMETOOLONG is 36 on Linux x86 and x86_64 it does isn't on other architectures so the value shouldn't be hard coded. (From OE-Core rev: 11a9cf5ee0daf82097fb2f36b58016f20a5968f3) Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/sanity: validate SDKMACHINE valuePaul Eggleton2013-11-141-0/+5
| | | | | | | | | | | If SDKMACHINE is set then check that a configuration file matching it actually exists, otherwise the user won't know that they've set it incorrectly. (From OE-Core rev: 8c984f92af821a4048c93f8e308c5f4a3fa39ca4) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake.conf: Default DISTRO to nodistroRichard Purdie2013-11-121-1/+1
| | | | | | | | | | | | | | | | | An empty distro value leads to OVERRIDES and FILESOVERRIDES containing "::" entries which causes odd issues such as files being included when they shouldn't be. We could put in anonymous python to guard against empty entries but its messy and setting a default value for DISTRO to something harmless is much easier. This patch adds a weak default and ensures the sanity test doesn't complain about it. DISTRO_VERSION and SDK_VERSION are also updated to match. (From OE-Core rev: b7279f99639774674da806d37d252f388f33055f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/sanity: test for DISPLAY being set with testimage classPaul Eggleton2013-09-221-3/+3
| | | | | | | | | | Update the sanity test for DISPLAY being set to handle the new testimage class rather than the old imagetest-qemu class. (From OE-Core rev: d1297c2c3ae71de0e9e5cab36e582f5df8666391) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity: Don't make assumptions about cwdRichard Purdie2013-09-011-2/+3
| | | | | | | | | | | When using the recently fixed out of build directory bitbake invocations, I was puzzled why bitbake seemed to be pausing. The reason was due to running the sanity tests each and every time. This was due to current working directory assumptions within the sanity test code. Fix this to use TOPDIR. (From OE-Core rev: 1cdc1b37b840bda961258cf2bfb2f75331bdb310) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/sanity: fix some grammatical errors in messagesPaul Eggleton2013-08-031-3/+3
| | | | | | | | (From OE-Core rev: e2cccd73e480318461641d8bc26d538178ff628a) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/sanity: check for suid root command evilityPaul Eggleton2013-08-031-0/+10
| | | | | | | | | | | | | | | | | Some users have been found to have an unnamed third-party piece of software installed which sets chmod, chown and mknod as suid root as part of its installation process. This interferes with the operation of pseudo and can result in files really being owned by root within the build output, and therefore breaks the build, apart from being a security issue. Check for this and bail out if it is found. Reported-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> (From OE-Core rev: 08d61529f3c7a48ec82e1f8c9c28c7b2e5238934) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: mention version when erroring on LCONF_VERSION mismatchRoss Burton2013-07-291-1/+1
| | | | | | | | | | | | | | | | | | If someone is using a Poky release but not the Poky distribution they'll get a bblayers.conf generated from meta-yocto's template with a LCONF_VERSION that doesn't necessarily match LAYER_CONF_VERSION (default in sanity.conf), as Poky overrides LAYER_CONF_VERSION to cater for the meta-yocto split. The resulting error message will tell them to compare bblayers.conf with bblayers.conf.sample, but they're identical. By explicitly refering to the required and actual versions this situation is hopefully clearer. (From OE-Core rev: da58843fd07dec43700a4c54ac469d1fda71aa50) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: Update gcc sanity checkMark Hatle2013-07-181-13/+29
| | | | | | | | | | | | | | | | | | | The gcc sanity check should be checking for the atomic function directly instead of using the gcc macro. Older versions of gcc do not have the macro defined, but do support the atomic operations. (glib-2.0 checks for both the macro and the function, as long as one is available it will successfully compile.) Update the check to try both -mcpu=native and -mcpu=BUILD_ARCH. Tell the user which version worked properly. [YOCTO #4845] (From OE-Core rev: c126729b29822d3602c9c4fd9016cc79b6057fc5) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: Check for the known broken version of makeMark Hatle2013-06-281-0/+37
| | | | | | | | | | | | | | | See GNU Savannah bug 30612 -- make 3.82 is known to be broken. A number of vendors are providing a modified version, so checking for just the version string is not enough. We also need to check if the patch for the issue has been applied. We use a modified version of the reproduced to check for the issue. (From OE-Core rev: dede532a980b0fabf0beae4519b89ec74a1c2474) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: Fix COREBASE sanity testsRichard Purdie2013-06-271-1/+1
| | | | | | | | | We need to expand the COREBASE variable, no idea how these tests were previously working at all... (From OE-Core rev: 099063f353a7a18720c92d87400726a49eed432f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: Add check for @ character in build directory nameRichard Purdie2013-06-271-4/+6
| | | | | | | | | | | | | | The @ character is not escaped properly in too many places within the system to easily support it so add the character to the list of blacklisted characters. Also tweak the other messages and ensure that all appropriate error messages are disabled in one go. [YOCTO #4772] (From OE-Core rev: 008cb3c501c8313a0a1a0ebce2b0aa61239b548d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: Various improvementsRichard Purdie2013-06-241-254/+257
| | | | | | | | | | | | | | | | | | | | I started trying to make some changes in sanity.bbclass and couldn't stand the current code. This patch splits out the one big function into a number of smaller units and adds a status class which handles queuing of messages and issues like network errors and whether a reparse is required. It also cleans up some syntax and obsolete code. The other fundamental change is the tests are split into ones which run once and those which run at every build. This was always the way the class was intended to work but that got lost somewhere along the way. This patch fixes that. Its still far from perfect but it is hopefully an improvement and sets the scene for other improvements to be built on top of this. (From OE-Core rev: 4e6de6d5f0454024eec2ec775a938c5dab70610c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: Drop horrible obsolete minversion hackRichard Purdie2013-06-241-7/+2
| | | | | | | | | We once needed to do this, things seem to work fine without this now, thankfully. (From OE-Core rev: ac090ace11d654dafd642fd93c94091a164476fa) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/conf: Add eventmasks for event handlersRichard Purdie2013-06-141-0/+1
| | | | | | | | | | | Now that bitbake supports masking events for event handlers, lets use this so event handlers are only called for events they care about. This lets us simplify the code indentation a bit at least as well as mildly improving the event handling performance. (From OE-Core rev: bff73743280f9eafebe4591f7368ead91a4eb74d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/buildenv-internal/sanity: Update to python 2.7.3 as a minimumRichard Purdie2013-06-141-4/+3
| | | | | | | | | | | | We're finding bugs in python 2.6 and starting to require unittest functionality in python 2.7.x. Its time to bump the minimum version requirement. Anyone without python 2.7.x can use the buildtools-tarball out to install a standalone python/git/tar setup which will work with the system. (From OE-Core rev: 8b90f1becd40a7f857d2fbe30eaffe218a976419) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity: Drop pseudo test, now unneededRichard Purdie2013-06-141-27/+0
| | | | | | (From OE-Core rev: 075278db6f7a4783c952c72eebddf51a12f76075) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/bitbake sanity.bbclass: Migrate tests for git and tar versionsRichard Purdie2013-06-141-0/+31
| | | | | | | | | | | Migrate tests for correct git and tar versions from the wrapper script to the sanity class. This sets the scene to allow us to remove the bitbake wrapper script. (From OE-Core rev: 7b370e23594da5dcb53cd5507ec289c3ef2d9fb5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: non-zero status means that we need -march.Randy MacLeod2013-06-111-1/+1
| | | | | | | | | | A non-zero status from the march test for gcc means that the "march" flag is needed. Correct the logic to return True in this case. (From OE-Core rev: 217fd857df78c66eae853f935e9cdafcbeb3bc31) Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: make sure python is a full installJesse Zhang2013-06-041-0/+6
| | | | | | | | | | | | | Components of the Standard Library should be available. Add a sanity check for xml.parsers.expat; we might add more in the future. [YOCTO #4424] (From OE-Core rev: bb027a332f2f2927a6bcbc4c035b42a012d0579e) Signed-off-by: Jesse Zhang <sen.zhang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: Drop dubious printRichard Purdie2013-05-241-1/+0
| | | | | | (From OE-Core rev: be4cd4614a2a702130d18e9d082fd83a15faa013) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: Attach the missing value to a format string.Peter Seebach2013-05-131-1/+1
| | | | | | | | | | The tuning changes to sanity.bbclass were almost right, but one of the messages had a %s with no % operator. (From OE-Core rev: cf5e40598ae9a83f22cabedc7b72000beb62703c) Signed-off-by: Peter Seebach <peter.seebach@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* class/lib: Fix up various file access methodsRichard Purdie2013-05-091-33/+30
| | | | | | | | | | | | | | There are various bits of cruft that have built up around our file accesses. This patch cleans some of them up, specifically: * Remove pointless "from __builtin__ import file" * Use open(), not file() * Wrap file usage in a with container to ensure files are closed * Add missing .close() calls in some cases (From OE-Core rev: a43e0a8ecd0441131e929daf998c3cd454d9c8f3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/lib: Fix getcmdstatus breakageRichard Purdie2013-05-091-3/+2
| | | | | | | | | I mistakenly thought subprocess had getcmdstatus in python 2. It doesn't so lets add a wrapper and have this work in both worlds. (From OE-Core rev: 2253e9f12734c6e6aa489942b5e4628eca1fa29d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity/patch.py: Remove commands module usageRichard Purdie2013-05-091-4/+3
| | | | | | | | | The commands module is removed in python3. Use the subprocess module instead and the pipes module to replace the mkargs usage. (From OE-Core rev: e2e1dcd74bc45381baccf507c0309dd792229afe) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/lib: Update to use print as a function callRichard Purdie2013-05-091-2/+4
| | | | | | | | | In python 3 print is a function call. In some cases bb.note is a more appropriate call to make. (From OE-Core rev: 754874e68d1037c76fc4cc7d35d3fa12946d00f8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: Use open(), not file()Richard Purdie2013-05-091-12/+12
| | | | | | | | file() syntax is removed in python 3, use open() instead. (From OE-Core rev: b2d10f15db23246e3957b69d77433f87674928bb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* clases/lib: Use modern exception syntaxRichard Purdie2013-05-091-2/+4
| | | | | | | | | Update older code to use modern exception handling syntax which is the form accepted by python 3. (From OE-Core rev: b010501cd089e649a68f683be0cf4d0aac90fbe3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/sanity: fix handling of bblayers.conf updatingPaul Eggleton2013-04-131-25/+52
| | | | | | | | | | | | | | | | | | | | | | Fix the fairly long-standing problem of treating a newer bblayers.conf in the same manner as an older one (reporting that it had been updated even if nothing was done). The recent work to do a reparse without having to manually re-run bitbake turned this from an annoyance into an endless loop, so it had to be fixed. As part of fixing this the following changes have been made: * Extensions are now implemented using a function list, so distro layers can add their own functions which should either succeed (indicating they have successfully updated the file) or raise an exception (indicating nothing could be done). The functions are called in succession until one succeeds, at which point we reparse. * If we can't do the update, the error message now says "older/newer" instead of just "older" since we only know the version is different. (From OE-Core rev: 46b00fdfc9d1e3dc180de087bae2682a1baa2954) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* fix march sanity check issueZhenhua Luo2013-03-221-3/+6
| | | | | | | | | | | | | | | | | | | | | 1. check if gcc_test is really generate before os.remove("gcc_test") to avoid following error: ERROR: Execution of event handler 'check_sanity_eventhandler' failed Traceback (most recent call last): File "check_sanity_eventhandler(e)", line 4, in check_sanity_eventhandler(e=<bb.event.ConfigParsed object at 0x3151450>) File "sanity.bbclass", line 107, in check_sanity(sanity_data=<bb.data_smart.DataSmart object at 0x11ba110>) File "sanity.bbclass", line 22, in check_gcc_march(sanity_data=<bb.data_smart.DataSmart object at 0x11ba110>) OSError: [Errno 2] No such file or directory: 'gcc_test' 2. set result to False when build failed with -march=native to ensure -march=native is appended to BUILD_CFLAGS when host gcc really supports this flag, otherwise following error appears when build native packages. | cap_text.c:1: error: bad value (native) for -march= switch | cap_text.c:1: error: bad value (native) for -mtune= switch (From OE-Core rev: 4a4228fe250c8b23a5deeb25825d61c6e84a47a2) Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass:check if necessary to add march to BUILD_CFLAGSHongxu Jia2013-03-071-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1, There are a set of GCC built-in functions for atomic memory access. The definition given in the Intel documentation allows only for the use of the types int, long, long long as well as their unsigned counterparts. GCC will allow any integral scalar or pointer type that is 1, 2, 4, 8 or 16 bytes in length, suffix `_n' where n is the size of the data type.Such as: __sync_fetch_and_add_n __sync_fetch_and_sub_n __sync_fetch_and_or_n __sync_fetch_and_and_n __sync_fetch_and_xor_n __sync_fetch_and_nand_n The above builtins are intended to be compatible with those described in the Intel Itanium Processor-specific Application Binary Interface, section 7.4. 2, The glib-2.0-native and qemu-native invoke the above builtin function with suffix `_4', and glib-2.0-native uses __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 to test the existance. 3, Not all above builtin functions are supported by all target processors.Such as i386 does not support the functions with suffix `_4', but i486 or later support. 4, Prior to GCC 4.5, on the Intel's processor, the default arch is i386 unless GCC is built with the --with-arch switch. Since GCC 4.5 the default arch is implied by the target. 5, If your host GCC is older than 4.5 and it is built without the --with-arch switch, when you use the GCC to compile target, you should specify -march to tell GCC what the target's arch is, otherwise i386 is used as default. Above all, when use older GCC to compile glib-2.0-native or glib-2.0-native, and the GCC incorrectly uses i386 as default, the above builtin function with suffix `_4' is not referenced. We should have a check in sanity.bbclass to tell the user if necessary to add march to BUILD_CFLAGS in this situation. http://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/_005f_005fsync-Builtins.html#_005f_005fsync-Builtins http://gcc.gnu.org/ml/gcc-help/2009-06/msg00037.html http://gcc.gnu.org/gcc-4.5/changes.html http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47460 http://llvm.org/bugs/show_bug.cgi?id=11174 http://download.intel.com/design/itanium/downloads/245370.pdf [YOCTO #3563] (From OE-Core rev: 38042ed8586b3abe427af33debc2402caeca52cb) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: always use oe.lsb.distro_identifier methodMartin Jansa2013-03-021-32/+4
| | | | | | | | | | | * even when /etc/redhat-release or /etc/SuSE-release exists * don't read /etc/lsb-release manually, NATIVELSBSTRING is not reading it too (From OE-Core rev: 3dba05d74821f08cd96a18351805c8812ddd626c) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity: use lsb distro_identifierMartin Jansa2013-03-011-4/+1
| | | | | | | | | | | | | | | | | | | | | * distro_identifier returns lsb_data['Distributor ID']-lsb_data['Release'] which in some cases is different then lsb_release -d -s, e.g. Distributor ID: Ubuntu Description: Ubuntu 12.04 LTS Release: 12.04 Codename: precise But we probably don't need to sanity list each point release in LTS and sstate is already using distro_identifier as prefix for native sstate archives * This will need update to SANITY_TESTED_DISTROS (at least s/Ubuntu 12.04 LTS/Ubuntu-12.04/g etc), that's why sending as RFC first. (From OE-Core rev: a32ea459ca168792161af2d521a14fe00cffb4b3) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>