Commit Graph

172 Commits

Author SHA1 Message Date
Paul Eggleton 595321a626 classes/sanity: test for DISPLAY being set with testimage class
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>
2013-09-22 12:19:34 +01:00
Richard Purdie 5894ac1f38 sanity: Don't make assumptions about cwd
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>
2013-09-01 16:25:15 +01:00
Paul Eggleton ac60aa8cf7 classes/sanity: fix some grammatical errors in messages
(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>
2013-08-03 10:33:13 +01:00
Paul Eggleton 9aba9225d3 classes/sanity: check for suid root command evility
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>
2013-08-03 10:33:12 +01:00
Ross Burton 8b7c6efe36 sanity.bbclass: mention version when erroring on LCONF_VERSION mismatch
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>
2013-07-29 13:09:03 +01:00
Mark Hatle 4a6f939b4d sanity.bbclass: Update gcc sanity check
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>
2013-07-18 21:23:41 +01:00
Mark Hatle 9b007f61b2 sanity.bbclass: Check for the known broken version of make
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>
2013-06-28 09:14:07 +01:00
Richard Purdie 042203531b sanity.bbclass: Fix COREBASE sanity tests
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>
2013-06-27 12:48:56 +01:00
Richard Purdie 4707a74db3 sanity.bbclass: Add check for @ character in build directory name
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>
2013-06-27 10:04:50 +01:00
Richard Purdie 87da290804 sanity.bbclass: Various improvements
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>
2013-06-24 15:41:33 +01:00
Richard Purdie a355f13f73 sanity.bbclass: Drop horrible obsolete minversion hack
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>
2013-06-24 15:41:33 +01:00
Richard Purdie 53841ce521 classes/conf: Add eventmasks for event handlers
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>
2013-06-14 12:55:47 +01:00
Richard Purdie 98abb113a0 scripts/buildenv-internal/sanity: Update to python 2.7.3 as a minimum
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>
2013-06-14 12:53:52 +01:00
Richard Purdie 2cc601cd26 sanity: Drop pseudo test, now unneeded
(From OE-Core rev: 075278db6f7a4783c952c72eebddf51a12f76075)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-14 12:53:52 +01:00
Richard Purdie cfbd13ff22 scripts/bitbake sanity.bbclass: Migrate tests for git and tar versions
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>
2013-06-14 12:53:51 +01:00
Randy MacLeod ad276d7d89 sanity.bbclass: non-zero status means that we need -march.
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>
2013-06-11 21:46:07 +01:00
Jesse Zhang c81ecf96ed sanity.bbclass: make sure python is a full install
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>
2013-06-04 11:43:35 +01:00
Richard Purdie 56a2b28724 sanity.bbclass: Drop dubious print
(From OE-Core rev: be4cd4614a2a702130d18e9d082fd83a15faa013)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-24 10:34:51 +01:00
Peter Seebach a9f5bf0ed3 sanity.bbclass: Attach the missing value to a format string.
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>
2013-05-13 21:54:40 +03:00
Richard Purdie 566628d8cd class/lib: Fix up various file access methods
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>
2013-05-09 22:28:04 +01:00
Richard Purdie b54339d633 classes/lib: Fix getcmdstatus breakage
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>
2013-05-09 16:05:08 +01:00
Richard Purdie e16faa55da sanity/patch.py: Remove commands module usage
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>
2013-05-09 14:06:51 +01:00
Richard Purdie 3512f797f9 classes/lib: Update to use print as a function call
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>
2013-05-09 14:06:51 +01:00
Richard Purdie 9ebcb98121 sanity.bbclass: Use open(), not file()
file() syntax is removed in python 3, use open() instead.

(From OE-Core rev: b2d10f15db23246e3957b69d77433f87674928bb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09 14:06:51 +01:00
Richard Purdie 2ac4f8b397 clases/lib: Use modern exception syntax
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>
2013-05-09 14:06:50 +01:00
Paul Eggleton db61a66dba classes/sanity: fix handling of bblayers.conf updating
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>
2013-04-13 23:49:28 +01:00
Zhenhua Luo 5b5e03838d fix march sanity check issue
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>
2013-03-22 17:01:30 +00:00
Hongxu Jia 3be1c1251b sanity.bbclass:check if necessary to add march to BUILD_CFLAGS
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>
2013-03-07 11:14:36 +00:00
Martin Jansa b892099902 sanity.bbclass: always use oe.lsb.distro_identifier method
* 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>
2013-03-02 13:00:56 +00:00
Martin Jansa e5f3b992d7 sanity: use lsb distro_identifier
* 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>
2013-03-01 13:03:30 +00:00
Martin Jansa d10a2f9199 sanity: check_path_length: replace tab with 8 spaces
(From OE-Core rev: de3f2367c46a213d07d834c7e874d2a4a0697026)

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>
2013-02-19 08:47:35 -08:00
Cristiana Voicu 2cbefb8387 sanity.bbclass: when bblayers.conf is updated, it invokes a reparse
When bblayers.conf is updated(when sanity check is running), it should
tell to bitbake to reparse configuration files. I will send a patch to
bitbake-devel, with the actions needed in bitbake and hob.

[YOCTO #3213]
(From OE-Core rev: 5db1ff93f7204b43b7242fc7ef415216eb632ed8)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-15 12:17:35 +00:00
Richard Purdie 5db5904614 sanity.bbclass: Check for DISPLAY for qemutests in BB_ORIGENV now
(From OE-Core rev: e43f8f917e4069d74b467dfd6aa29ff762e83a5e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-07 09:17:44 +00:00
Richard Purdie 932a4cdf4b sanity.bbclass: Ensure tmpdir exists when running the check
This avoids tracebacks from bitbake if the directory doesn't already
exist.

[YOCTO #3640]

(From OE-Core rev: 1a60e96b21d328fe936e594f3061459e8f2f1b5e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-24 20:09:00 +00:00
Constantin Musca 1674541ed8 multilib: fix allarch/kernel/module-base multilib issues
- skip the non-packagegroup allarch recipes in multilib_virtclass_handler
- extend PROVIDES/RPROVIDES for allarch recipes which are not packagegroups
- use variants from MULTILIB_GLOBAL_VARIANTS (lib32 lib64 libx32) to create
additional pkgdata files for multilib allarch: ${pkgdatadir}/${variant}-${PN}
and ${pkgdatadir}/runtime/${variant}-${pkg}
- use variants from MULTILIB_VARIANTS to create additional pkgdata files
for multilib kernel/module-base recipes
- add a sanity check to determine if the current multilib is in
MULTILIB_GLOBAL_VARIANTS

[YOCTO #2918]
[YOCTO #3440]
[YOCTO #3565]
[YOCTO #3568]

(From OE-Core rev: bc4da2573dfb59ea2fc4af359701818df20f7663)

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-31 09:43:25 +00:00
Richard Purdie f93f43cbb3 bitbake.conf/sanity: Separate versions and PN stamp components into separate directories for WORKDIR and STAMP
This means some of the hacks we have to tell where the package name ends and
the version starts in the directory layout becomes obsolete, simplifying the
work of some of the cleanup scripts. It also makes the layout slightly more
intuitive to the user.

It does force a rebuild onto the user but it will reuse sstate successfully.

(From OE-Core rev: 05075cf3138d1c61f5cf4fe0e1a4587acc00c692)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-20 15:31:49 +00:00
Bogdan Marinescu a3720a51c9 sanity.bbclass: trigger network tests explicitly
The network tests in sanity.bbclass can now be trigerred explicitly
by firing the NetworkTest event. This is part of the fix for bug #3026.

[YOCTO #3026]

(From OE-Core rev: f1f43d55dbb020a0145c58731d4259fd906d9d1e)

Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-18 12:13:43 +01:00
Bogdan Marinescu 2984c87f27 sanity.bbclass: Fix invalid test for network error
The test for network error in sanity.bbclass was negated.

(From OE-Core rev: 9fcd0866f0e30a50182434f6bcae13bf9575807f)

Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-02 12:00:03 +01:00
Bogdan Marinescu 7d95141c5a sanity: Added explicit network error status in SanityCheckFailed event
If we fail a network test, a special flag is set in the SanityChekFailed
event. This helps Hob identify the network error properly and display
a special message to the user.

[YOCTO #3025]

(From OE-Core rev: 7877c4344db89237bba5f9a03342bfd9a03aebbf)

Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-28 11:07:41 +01:00
Constantin Musca 6d3d4baeeb sanity.bbclass: bblayers.conf should be updated automatically
- add check_bblayers_conf bitbake function which does the bblayers.conf
v4 -> v5 update if necessary (every layer should make its specific
bblayers.conf upgrades appending to the check_bblayers_conf function)
- we ask the user to re-run bitbake because we can't trigger reparsing
without being invasive

[YOCTO #3082]

(From OE-Core rev: 03ad4edace5db9c6e15ca776d06d20b7d4e42afc)

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-28 11:07:40 +01:00
Paul Eggleton de69c6c94e classes/sanity: remove obsolete code
We can now rely upon the minimum BitBake version having the
SanityCheckFailed event, so remove the code to handle if this is not
there.

(From OE-Core rev: ba17572c9c11efb45a92ba97914ce1f6d84002c8)

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>
2012-09-12 15:13:39 +01:00
Paul Eggleton fd572e8c6b classes/sanity: skip tune checks if machine is invalid
If there is no valid machine configuration it's almost guaranteed that
the tune checks will fail, so just suppress them in that case.

(From OE-Core rev: 629c585e687cda9290efcffd18dd92fdf16009ab)

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>
2012-09-12 15:13:39 +01:00
Richard Purdie 8d6ecfbe84 sanity.bbclass: Move back to running at ConfigParsed time
If we don't do this, users can get extremely confused errors since the sanity tests
happen too late (after parsing) and don't see the warnings.

Also cleanup messages about merging configuration file changes to give better
hints at where the updated files may be.

(From OE-Core rev: 7b8a68cda7ef8186e834b39e73ee12a55b33f85b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-05 17:32:14 +01:00
Richard Purdie 48619958d5 meta/classes: Various python whitespace fixes
It was pointed out we have a number of weird indentations in the python functions.
This patch cleans up 3, 7 and other weird indentations for the core bbclass files.

It also fixes some wierd (odd) shell function indentation which my searches picked up.

(From OE-Core rev: 8385d6d74624000d68814f4e3266d47bc8885942)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-21 12:15:30 +01:00
Paul Eggleton ba8ba42b9f classes/sanity: remove texi2html from required host utilities
texi2html is not actually required to build world of OE-Core anymore,
so we don't need to mandate it. The only difference without it (verified
with buildhistory) is that groff doesn't produce HTML documentation; the
rest of its docs are still produced and packaged and no other packages
are affected.

Part of the work towards [YOCTO #2423].

(From OE-Core rev: aa1c4519f8e549b43a7d8bc51c5342d3409b464b)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-20 16:53:17 +01:00
Ross Burton d85216e156 sanity: display the parsed BBPATH when complaining about CWD elements
Many people don't understand the nuances of PATH/BBPATH, so help them by clarifying
the warning and displaying the parsed list element-by-element.

(From OE-Core rev: 6f7be2498134402b5e0f766df5c57e1f496d0d06)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-20 12:32:53 +01:00
Richard Purdie 73cf0335c4 Remove a number of unneeded import os/bb calls
The bb and os modules are always imported so having these extra import calls
are a waste of space/execution time. They also set a bad example for people
copy and pasting code so clean them up.

(From OE-Core rev: 7d674820958be3a7051ea619effe1a6061d9cbe2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 12:24:50 +01:00
Ross Burton 856019774b sanity: display the parsed PATH when complaining about CWD elements
Many people don't understand the nuances of PATH, so help them by clarifying
the warning and displaying the parsed PATH element-by-element.

(From OE-Core rev: 47e6ab41f0f84e6bed7d337ebf96c954ec6909e8)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-18 14:57:28 +01:00
Richard Purdie 617835990e bitbake.conf: Add git-native to ASSUME_PROVIDED
Originally, git was something new, not installed everywhere and had commandline
stability problems. This has changed and git it no longer makes sense to
continually build this when the system installed version is likely sufficient.

This speeds up build since recipes no longer have to wait for git-native to build
if they're fetched from a git:// SRC_URI.

Also add git to the sanity checks and drop the no unneeded svn reference.

(From OE-Core rev: 79e24186481770181565a18d177584d0d72399fe)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-18 14:33:01 +01:00
Robert Yang 2dee999ab2 sanity.bbclass: the tmpdir can't be longer than 410
There will be errors when the length of the tmpdir is longer than 410:

1) Longer than 420:
Can't exec "/bin/sh": Argument list too long at /usr/lib/perl/5.10/IO/File.pm line 66.

This error happens on both Ubuntu 10.04 and 10.10 when the pkg needs run
"autoreconf", this is because it passes many files with absolute path to
aclocal, aclocal passes them to perl, this is a limitation of the perl
on Ubuntu 10.04 and 10.10, and the perl-native is not ready at this very
early stage.

2) Longer than 490:
bitbake/lib/bb/persist_data.py", line 197, in connect(database=...)
    >    return sqlite3.connect(database, timeout=5, isolation_level=None)
OperationalError: unable to open database file

This error happens on Ubuntu 10.04, 10.10 and Fedora 17. This is because
the length of the database in sqlite3 module (host's) can't be longer
than 490 (or little smaller). The python-native is not ready at this
very early stage.

The 2 errors are host related, I think that limit the length of the
TMPDIR to 410 is OK for most of the build, rarely build sets TMPDIR's
longer than 410.

[YOCTO #2434]

(From OE-Core rev: ebcf949853ff667478a1ea1d3f1f8f41d643e708)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-09 16:58:57 +01:00