Commit Graph

253 Commits

Author SHA1 Message Date
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
Laurentiu Palcu d8d95d10bd sanity.bbclass: warn the user if BBPATH contains wrong entries
If BBPATH references the working directory, the user is warned and asked
to fix the problem.

[Yocto #1465]

(From OE-Core rev: 73f10ae955ba217078fa2c5288b736ae8a30b184)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-13 13:11:22 +01:00
Paul Eggleton bc386b8934 classes/sanity: fix a couple of grammatical errors in messages
(From OE-Core rev: 004ba67298e3e6e618df29597e9166c971a1941c)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-30 14:21:29 +01:00
Paul Eggleton 7a619c235f classes/sanity: send sanity check failure as a separate event for Hob
In order to show a friendlier error message within Hob that does not
bury the actual sanity error in our typical preamble about disabling
sanity checks, use a separate event to indicate that sanity checks
failed.

This change is intended to work together with the related change to
BitBake, however it has a check to ensure that it does not fail with
older versions that do not include that change.

Fixes [YOCTO #2336].

(From OE-Core rev: 49d8b7b8c3b18da64583637db207f1f064a5bdb2)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-30 12:04:48 +01:00
Paul Eggleton a8010cd5d7 classes/sanity: remove broken TARGET_ARCH check
The variable name has been typo'd as TARGE_ARCH since it was introduced
some time ago, so the check has never worked. Fixing the typo shows that
the test is not quite functional, so let's just remove it:

http://lists.linuxtogo.org/pipermail/openembedded-core/2011-October/010613.html

(From OE-Core rev: 897a9b1dddef385253b16ea7c193483e0ea679b6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-30 12:04:47 +01:00
Robert Yang e40995e569 meta: replace os.system with subprocess.call
Replace os.system with subprocess.call since the older function would
fail (more or less) silently if the executed program cannot be found

More info:
http://docs.python.org/library/subprocess.html#subprocess-replacements

[YOCTO #2454]

(From OE-Core rev: a07d03cc6f67c88feb9813ae7deb6e4a93552dfe)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-30 12:04:45 +01:00
Joshua Lock 9ab9c52cfc sanity.bbclass: check sanity at BuildStarted rather than ConfigParsed
This enables a user to use bitbake -e even when the sanity checks are
failing.

(From OE-Core rev: be317df78535120137ecaadf797e3f4dfe04119e)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-24 08:51:42 +01:00
Joshua Lock 9509ed472a sanity.bbclass: catch an extra exception in check_create_long_filename
The call to bb.mkdirhier() in check_create_long_filename() can fail with an
OSError, explicitly catch this and report something useful to the user.

(From OE-Core rev: b066906477eb0496a2babb3d8e87682a1b7df0de)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-24 08:51:41 +01:00
Joshua Lock 3898d081ab sanity.bbclass: add extra information when SSTATE_CACHE unusable
If the user does not have write permissions to SSTATE_CACHE, detected by
the check_create_long_filename() test failing with a "Permission denied"
value in strerror, then suggest they might want to use the location as
an entry in SSTATE_MIRRORS.

(From OE-Core rev: 719d44305508c75a9f2decacdff6558ca14277bb)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-24 08:51:41 +01:00
Joshua Lock 13a86cb33d sanity.bbclass: add newline to check_create_long_filename failure message
Each failure in the sanity message should be reported on a new line.

(From OE-Core rev: 9362702aa9dd82fed7e6d6e3cb1289521b802075)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-24 08:51:41 +01:00
Joshua Lock 2e12fcf3a1 sanity.bbclass: data.getVar(VAR, obj, exp) -> obj.getVar(VAR, exp)
Replace calls to data.getVar(VARIABLE, data_object, expand) to
direct calls to the getVar method the the data_object.

(From OE-Core rev: 41ee978b62a9c40f36f8ad0acef147e36edffa17)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-24 08:51:41 +01:00
Joshua Lock 1983045391 sanity.bbclass: copy the data store and finalise before running checks
At the ConfigParsed event the datastore has yet to be finalised and thus
appends and overrides have not been set.
To ensure the sanity check is being run against the configuration values
the user has set call finalize() on a copy of the datastore and pass that
for all sanity checks.

(From OE-Core rev: 71142172efc0f44a50216550c2b6cc3094fdc21d)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-24 08:51:40 +01:00
Joshua Lock 6a4c55df3c Revert "sanity.bbclass: check user can read and write to SSTATE_DIR"
This has caused problems for several users, including the Yocto Project
autobuilder. Since the message was added in order to be more user friendly
revert the change.

This reverts commit 0c0c4efbf92bcf0f8942f17c18525a4b4ed1798c.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-24 08:51:40 +01:00
Joshua Lock c2df43b5db sanity.bbclass: check user can read and write to SSTATE_DIR
The user needs read and write permissions to SSTATE_DIR, check
whether they have sufficient permissions and if not recommend
use of SSTATE_MIRRORS.

(From OE-Core rev: 0c0c4efbf92bcf0f8942f17c18525a4b4ed1798c)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-17 21:13:10 +01:00
Peter Seebach b88a0e5876 sanity.bbclass: Detect empty $PATH components too
Empty components in $PATH have the same effect as a . in $PATH,
and are a common side-effect of inserting a misspelled or unset
shell variable in $PATH.

(From OE-Core rev: ac4201b714c83c614113bfa735d0a2fc6f64db99)

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-11 17:50:49 +01:00
Peter Seebach 36784da878 sanity.bbclass: Implement initial toolchain sanity checks
This introduces a sanity check for the toolchain, which verifies
each tuning (including any multilibs), producing meaningful diagnostics
for problems, and also provides some higher-level tuning features.

The TUNEVALID and TUNECONFLICT/TUNECONFLICTS settings were not
implemented.  Listed one or two missing features in TUNEVALID,
also (in a previous patch) fixed the references to
features which didn't exist.

This patch also provides a whitelisting mechanism (which is completely
unused) to allow vendors providing prebuilt toolchain components to
restrict tunings to those based on or compatible with a particular ABI.

(From OE-Core rev: 2a91ff0ba0d587c516a5a972553280364853faa4)

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-09 21:42:51 +01:00
Dongxiao Xu f6864c1eed sanity.bbclass: Add a new case to issue sanity_check()
Judge if "SanityCheck" event is received, it will issue the
sanity_check() and send "SanityCheckPassed" back if succeeded.

(From OE-Core rev: 19704f9e69ecf09531687385b478b47f49fe372d)

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-24 10:14:49 +01:00
Joshua Lock 4a224311ac sanity.bbclass: add variable to disable the sanity checks
It's useful for Hob to be able to disable the sanity checks completely
without marking them as passed so that the user can get into the GUI to
configure their settings, etc.

Add a variable, DISABLE_SANITY_CHECKS, to do so.

(From OE-Core rev: b022641f939bcfcdaddddc4db3af4d2dc70de832)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-23 23:04:43 +01:00
Paul Eggleton d220e071ab classes/sanity: import regular expression module in SuSE distro check
We call re.sub here, so we need to "import re" or an error occurs
(tested on OpenSuSE 12.1).

(From OE-Core rev: cb1f7cffc171e6b182f33a69ff688d76b7f1baed)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-18 11:57:30 +01:00
Paul Eggleton f4eed2b8b8 classes/sanity: trim trailing newline when reading /etc/redhat-release
Any trailing whitespace needs to be stripped before comparing it to the
SANITY_TESTED_DISTROS list.

(From OE-Core rev: bea0311a6478febe8ab4884fb1c479f610856534)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-18 11:57:30 +01:00
Richard Purdie 1e190eef71 sanity.bbclass: If the sanity tests fail, don't mark them as complete
If the sanity tests fail, we still were writing out the stamp which means
they'd get skipped the next time we run bitbake. This is clearly wrong
and we should only write out the stamp file if the sanity tests complete
successfully.

(From OE-Core rev: b99acaa8aa06dcbca46c3f7048124d6f8d643a8b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-17 12:26:12 +01:00
Richard Purdie b1aeaa8b0d meta: Replace bb.data.expand(xxx, d) -> d.expand(xxx)
sed \
 -e 's:bb.data.\(expand([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
 -i `grep -ril bb.data.expand *`

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05 10:23:53 -08:00
Richard Purdie 83007574cc sanity.bbclass: Add ABI version 8, used for transition from the OEBasic to OEBasicHash stamp layout
(From OE-Core rev: bf440fd971dd549ae4e92c54046ea062ef51cd85)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-22 22:06:19 +00:00
Koen Kooi ae3184c96e classes: replace 'Poky' with 'OE-core'
(From OE-Core rev: 1fdcd32520a05465b0d54c062f28bac9cdf74a20)

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-01 15:07:42 +00:00
Richard Purdie 217a90f2ab sanity.bbclass: No need to check for cvs any more
(From OE-Core rev: dbe154965aa19ba30504895f0abc0575dd67d890)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-16 17:32:46 +00:00
Richard Purdie c8dee9b92d Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:

sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`

(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10 11:51:19 +00:00
Richard Purdie 5d3860f4a8 Allow use of dash as /bin/sh
We've had the check for dash as /bin/sh for a long time. Dash has been
around long enough now that most major issues have been identified and
fixed from  build perspective.

This patch fixes a bashism in the openjade-native recipe. It also
adjusts libtool so that the header at the script is used and not the
value of $SHELL. This is because many Makefiles change $SHELL so dash
can get used to execute what is otherwise configured as a bash shell
script. Since we don't need to execute scripts this way on any system I'm
aware of us building upon, the simplest fix is just to remove $SHELL.

With these two changes the dash check can be removed and we can allow
builds with dash as /bin/sh

(From OE-Core rev: 07ded02ffd37b4fe60a6210dbf56490ea306f0b6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

[Note: I know I need to add the description of the libtool change above
into the prefix.patch]
2011-11-10 11:51:18 +00:00
Richard Purdie 426ad82106 bitbake.conf: Drop remaining TERMCMD pieces and document OE_TERMINAL usage instead
(From OE-Core rev: ddb825c87dd3e59d50841a993080a00d1459b1e7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

[Yes, this one is against meta-yocto, I'll fix it to apply the same
change to OE-Core's local.conf.sample in the final version]
2011-11-04 17:05:53 +00:00
Paul Eggleton 3a6a38e3c6 sanity.bbclass: add a sanity check for KDE 4.x konsole in TERMCMD
If the user has specified konsole in TERMCMD and it is version 2.x from
KDE 4.x, raise an error as this version will not work for patch
resolution purposes (it forks into the background and returns
immediately).

Addresses [YOCTO #1294]

(From OE-Core rev: 843f9af47ffccb7ffdf3039c560bc3e4c88175a2)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-19 04:52:49 +01:00
Joshua Lock dfc13c9ae7 sanity: disable mirrors for connectivity check
It's difficult to test a range of fetchers when using mirrors, therefore create a throwaway
copy of the datastore and delete the MIRROR and PREMIRROR variables to ensure they aren't
used in the connectivity check.

(From OE-Core rev: 31cb3974eeaf2a808e8da3864e70986578c58cb9)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-16 18:07:27 +01:00
Paul Eggleton ac0b2cbe45 sanity.bbclass: re-enable DISTRO check
If DISTRO has been specified, ensure it is valid. (Unset or empty string
is valid for DISTRO in OE-core by the use of defaultsetup.conf.)

(From OE-Core rev: 895aa6b8ee9636a9f9d716c62c0adf951e1ff138)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-07 22:54:17 +01:00
Paul Eggleton de5d52711b sanity.bbclass: fix splitting on newlines of SANITY_TESTED_DISTROS
This variable should be split with \n sequences and these need to be
specified literally in the string. A corrected version of the example
given in the original commit (OE-core rev
75e3875341ddc8940e9ee2ccbbb2ec18194a68e6):

SANITY_TESTED_DISTROS = " \
        Ubuntu 11.04 \n \
        Fedora release 14 (Laughlin) \n \
        "

(From OE-Core rev: cfc72d5796b6f83a01e06f3a1f044869db2d5d18)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-02 18:36:20 +01:00
Richard Purdie a8d5225c3c sanity.bbclass: Clean up various MACHINE checks
[YOCTO #1398]

Firstly we should start checking if MACHINE is set. It if isn't lets
make this a sanity warning since its very hard to successfully build
without setting one (and anyone wanting to do that can disable the
sanity checks easily enough anyway).

Some of the checks depend on a MACHINE being specified. This change
moves those checks to a separate function so they only run if MACHINE
has been set correctly.

Both these issues combine to ensure the user sees a sane message
and avoids the nasty tracebacks in the bug report referenced above.

(From OE-Core rev: 02aceca132f9e259cdc5283c4bfe84e6a55df54d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-31 19:38:31 +01:00
Richard Purdie 0c78dbc607 sanity.bbclass: Fix broken whitespace
(From OE-Core rev: ab44ec9618109b0852d9441b6dd065c72c86acb2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-31 19:38:31 +01:00
Richard Purdie 8c1c37a149 sanity.bbclass: Fix broken indentation leading to code being skipped unintentionally
(From OE-Core rev: 5200d38222c3188e695080b45b975daa20c8a9fa)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-31 19:38:30 +01:00
Joshua Lock 6c2b7beac3 classes/sanity: enhance the network connectivity test
Switch to use the checkstatus fetcher API for the network connectivity test,
this has several advantages:
* we no longer print any messages to the console whilst the check is
being run
* we don't actually download anything, removing the need for tidy up and
making the code more concise

(From OE-Core rev: 81aa4bfbde871af1d569b64499c34a315bf6218e)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-25 08:51:30 -07:00
Paul Eggleton e043c9d1ce sanity.bbclass: add optional untested host distro warning
SANITY_TESTED_DISTROS, if specified, is expected to be a
newline-delimited list of distro identifier strings, e.g.

SANITY_TESTED_DISTROS = " \
        Ubuntu 11.04 \
        Fedora release 14 (Laughlin) \
        "

(spaces, tabs etc. are trimmed)

If SANITY_TESTED_DISTROS is defined, we will attempt to detect the host
distribution. If the distribution is not in SANITY_TESTED_DISTROS or we
could not detect the distribution then we show a warning during sanity
checking.

Provides the mechanism for fixing [YOCTO #1096].

(From OE-Core rev: 75e3875341ddc8940e9ee2ccbbb2ec18194a68e6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-19 09:29:18 -07:00
Chris Larson 5ddbfab109 sanity: shift the required utils into a variable
(From OE-Core rev: 4b766d82b15f9821a8c7299826799fad9bb88666)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-12 17:21:53 +01:00
Kumar Gala 79e7c68542 sanity.bbclass: Add sanity check that TUNE_PKGARCH appears in PACKAGE_ARCHS
Its possible we get duplications if we explicity add TUNE_PKGARCH to
PACKAGE_ARCHS so instead just add a sanity check to verify it.

(From OE-Core rev: b2ae0444eb1984b86c02e571bb1efeaacdeafcf1)

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-01 14:16:56 +01:00
Richard Purdie 039a2d006b conf/machine/tune: Overhaul tune include file variables
There is currently consideradble confusion over how the tune files operate
and how these interact with the rest of the build system. This update/overhaul
changes things so the tune files are primarily resonsible for setting:

TUNE_ARCH - What was formerly set as TARGET_ARCH and is the value that
represents the architecture we're targetting.

TUNE_PKGARCH - The value that represents the tune confuration that this set
of tune parameters results in.

This allows the significant improvement that the core can now always determine
the target architecture value, even when TARGET_ARCH needs to be reset to
something different and likewise, there is one package architecture variable
the core can reference allowing simplification of the BASE_PACKAGE_ARCH, PACKAGE_ARCH
and FEED_ARCH variables.

(From OE-Core rev: a10de4cf8b424ee95c8e283e75d486be5b3b8eac)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-25 12:06:30 +01:00
Tom Rini 627a2f5cbf help2man-native: Add 1.38.2
This is a 'side port' of current oe.dev versions.  PR is kept in sync
but we drop out the target recipes in order to punt on potential perl
problems.  Here we do re-configure as we don't have a dance with
perl-native to deal with.  Now that we can build it, don't require it.

(From OE-Core rev: 9673d7aa1f9e1c88ba69047b2e22636c755edaaa)

Signed-off-by: Tom Rini <tom_rini@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-20 15:27:36 +01:00
Tom Rini 4e774836a4 bitbake.conf, sanity.bbclass: Drop mercurial-native
We have no hg URIs in the metadata, so don't require and don't
ASSUME_PROVIDED it either.  meta-oe has a mercurial-native recipe
if hg URIs are added in a recipe later.

(From OE-Core rev: 6473c9096bf4995c21147e737322d800219c89ab)

Signed-off-by: Tom Rini <tom_rini@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-20 15:27:36 +01:00
Phil Blundell a17adf1c8a sanity, base: remove gcc3 check since qemu doesn't need it any more
Recent versions of qemu seem to be happy enough building with gcc 4.x, and indeed most modern distributions aren't shipping gcc3 any more, so there is no point checking for its presence as part of sanity.

Also remove the check_gcc3 function from base since nothing else uses it.

(From OE-Core rev: ec5c68e9368111bd51c1cfd6a9a135c53b82ceca)

Signed-off-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-19 17:34:19 +01:00
Joshua Lock 9569e2b347 sanity: implement network connectivity test
Sanity test to verify files can be fetched from the network using git, http
and https fetchers point users at a page to help get set up in the case of a
failure.

Requires a variable CONNECTIVITY_CHECK_URIS to be set, using the same pattern
as SRC_URI, of URI's to test against.
The variable CONNECTIVITY_CHECK_MSG can be set to provide a custom error
message, such as a pointer to some help, when this check fails.

Addresses [YOCTO #933]

(From OE-Core rev: 8fdea2a1ac8875a42b3a57f0fd7b530f851c20e9)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-07 13:45:28 +01:00
Joshua Lock 3e6746aa1d sanity.bbclass: pass the data object to the less frequent test harnesses
By passing the data object to the less frequently run test harnesses
(check_sanity_tmpdir_change(), check_sanity_sstate_dir_change() and
check_sanity_version_change()) we can run tests against BitBake data here
too.

(From OE-Core rev: 7df8376c28d991dd07c0915d3ccade4cf51c2fee)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-30 20:56:35 +01:00
Dexuan Cui d8f4a8bd1c sanity.bbclass: only run check_pseudo_wrapper for bitbake
This patch eliminates the warning "not been run using the bitbake wrapper..."
when we run bitbake-layers.

(From OE-Core rev: 547f4ea9ac4be2e656f846e658df99b0ecff7a29)

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-28 14:00:07 +01:00
Richard Purdie 21b0a2a5ae sanity.bbclass: Disable the is DISTRO set check since we can now run distro-less
(From OE-Core rev: 1e76c3c4c4164e884b5c474fa279a1f2f7e846f5)

Signed-off-by: Richard  Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-18 12:42:27 +01:00
Richard Purdie 2fcf5a7706 sanity.bbclass: Add cpio to list of required utilities tested for
(From OE-Core rev: 4f4bac0a459fe238e105e96b2b59b6af88e639c4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-09 14:08:50 +01:00
Richard Purdie 215898b281 sanity.bbclass: Fixup Poky references
(From OE-Core rev: 0a6f77f549c095692045825f4b5c4c5a2edff73c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-21 12:56:20 +01:00
Richard Purdie 949645e577 sanity.conf: Rename POKY_CONF_VERSION -> LOCALCONF_VERSION and make sanity versions weak assignment allowing the distro to override
(From OE-Core rev: 9a5a783fb131aef98540a81ea6697031a7a429e0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-21 00:29:32 +01:00
Richard Purdie 4d609d5021 Replace POKYBASE with COREBASE
(From OE-Core rev: 607a7657715f6fcba467a4e55ba64f41f4e13a15)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-21 00:29:29 +01:00
Richard Purdie 46d0cc3dc8 Rename poky-init-build-env to oe-init-build-env
(From OE-Core rev: fa6176219b741eed346b21a3d923e9abc9b5442a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-21 00:29:29 +01:00
Khem Raj c88832587d sanity.bbclass: Use SSTATE_MANIFESTS instead of hard coding sstate-control
This helps when SSTATE_MANIFESTS is overridden by external layers

(From OE-Core rev: 246cbbb076ea91eccbc373bd277684f69a8ab4dc)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-04 14:08:09 +01:00
Joshua Lock e235357841 sanity.bbclass: check for duplicates in PACKAGE_ARCHS
Duplicate entries in PACKAGE_ARCHS causes problems with rootfs
generation. For example multiple architecture entries in opkg.conf
will confuse the opkg package manager.

(From OE-Core rev: 06aca3de95483e5086b0231df070bac76a6e3c19)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-18 16:48:01 +00:00
Paul Eggleton 3046a96bf0 sanity: detect if bitbake wrapper is not being used or pseudo is broken
* Shows a warning during sanity checking if the scripts/bitbake wrapper is
  not being used
* Check to see if pseudo is working during sanity checking, and if it
  isn't an error occurs (if we are using the wrapper script and pseudo
  has been built; otherwise it is a warning).

Fixes [YOCTO #653]

(From OE-Core rev: 0b06b69992dd3df1dfff7bde694d7ad23d8d15a0)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-17 00:18:14 +00:00
Richard Purdie de796d5df5 sanity.bbclass: Fix inverted mmap_min_addr logic
(From OE-Core rev: 2956705bb0dad88b5ad7d42490c345ccb1d9d478)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-14 23:21:09 +00:00
Khem Raj 6030fd77aa sanity.bbclass: Check for /proc/sys/vm/mmap_min_addr to be >= 65536
* Now qemu can handle lower values we can chnage this sanity test
  to check of values if less than 65536

(From OE-Core rev: 5f172d8b9b829554f3d884a9007a33fff7dcc187)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-08 11:04:31 -08:00
Martin Jansa bd32707850 sanity.bbclass: some multilib systems have symlink /lib -> /lib64
* ie gentoo has /lib -> /lib64
* old test assumed only /lib64 -> /lib

(From OE-Core rev: 776af6c2fa5a80debfafb4697c462d0dd0e7d76c)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Acked-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-08 11:04:30 -08:00
Richard Purdie 222796ed93 sanity/sstate: Due to the sysroot layout changes, the toolchain bootstrap process changes and the recent pseudo bug, bump the tmpdir layout version number and the sstate version numbers
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-25 12:32:50 +00:00
Jessica Zhang fe9f7162f9 sanity.bbclass: remove SDK_ARCH check
remove sanity check for SDK_ARCH=i686 due to recent fixes in cross toolchain areas, etc. the old issue no longer exists

Signed-off-by: Jessica Zhang <jessica.zhang@intel.com>
2011-01-20 21:36:59 +00:00
Mark Hatle 4de544015b sanity.bbclass: Disable TERMCMD checking with noop patching
If PATCHRESOLVE is set to "noop", then it isn't supposed to try and
resolve patches at all, and thus does not need TERMCMD. Therefore,
make sure Poky doesn't check for (and possibly fail at finding)
TERMCMD if it isn't needed in the first place.

Signed-off-by: Derek Buitenhuis <dbuitenh@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2011-01-20 21:36:58 +00:00
Beth Flanagan d4731a3f7d Adding check for DL_DIR permissions: sanity.bbclass
Check to ensure that DL_DIR is set and that if it exists that it
is user writeable.

Signed-off-by: Beth Flanagan <elizabeth.flanagan@intel.com>
2011-01-12 12:09:33 +00:00
Richard Purdie 33f67ee2fc classes: Drop Handled/NotHandled eventhandler keywords, they don't do anything
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-31 09:51:18 +00:00
Richard Purdie 68030f43f8 sanity.bbclass: Add check for '.' in PATH and error if found (see bug #572)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-21 14:06:41 +00:00
Paul Eggleton 670c18c3ef sanity.bbclass: add check for creation of long filenames
Detect and fail if filesystem in use for TMPDIR or SSTATE_DIR has an
unreasonably short file name length limit (eg. eCryptFS). This can cause
"file name too long" errors during poky builds (e.g. when writing sstate
files for packages with a git revision as the version).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2010-12-20 14:54:13 +00:00
Paul Eggleton 1993ca1f87 sanity.bbclass: allow minimisation of impact of more invasive sanity checks
Add a mechanism to avoid running more invasive checks every time bitbake is
invoked. Adds a file in conf/ (i.e. under user's build directory) that
tracks a new variable SANITY_VERSION (set in sanity.conf) as well as TMPDIR
and SSTATE_DIR, allowing checks to be run when these are changed.

Fixes [BUGID #562]

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2010-12-20 14:54:02 +00:00
Paul Eggleton 2ec7757a48 sanity.bbclass: make indenting consistent
Use four spaces throughout the file

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2010-12-20 14:51:22 +00:00
Jiajun Xu b99fd0374e sanity.bbclass: Check if DISPLAY is set when IMAGETEST is set
Fixes [BUGID: 594]

In imagetest-qemu.bbclass, we depend on DISPLAY to start qemu in
a X desktop. When user wants to run qemu sanity test, we need to
check if the variable is set.

Signed-off-by Jiajun Xu <jiajun.xu@intel.com>
2010-12-16 15:27:14 +00:00
Joshua Lock 63b85e74a3 sanity.bbclass: Warn people when TERMCMD is set to a non-installed program
We default to gnome-terminal for TERMCMD (and TERMRUNCMD) so should check that
this program actually exists during sanity checking.

As a corollary document how to change these variables in the local.conf

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-12-06 22:02:28 +00:00
Paul Eggleton 4d6a8d2574 sanity.bbclass: add wget to required utilities
Signed-off-by: Paul Eggleton <paul.eggleton@intel.com>
2010-11-22 09:56:09 -08:00
Joshua Lock 271bd9d8f9 sanity.bbclass: ensure 32it libc is correctly detected
Fix to work for both Ubuntu and Fedora multilib paths.

Fixes [BUGID #454]

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-10-13 15:31:12 +01:00
Joshua Lock 7f7c185cf1 Revert "Drop vm_mmap_min_addr checks from scripts and sanity class"
This reverts commit 138df217ef.

We still need the vm_mmap_min_addr set to 0 to run locale generation for
qemu-arm

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-09-29 17:10:41 +01:00
Richard Purdie 97dec8410b sstate.bbclass: Update to use SSTATE variables everywhere and remove the now unneeded complicated paths from the sstate files
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-29 12:12:26 +01:00
Richard Purdie 7a0f6ceb81 sanity.bbclass: Don't run the handler in worker context
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-19 22:36:26 +01:00
Mark Hatle 1c9f061d1f pseudo: Upgrade pseudo and correct problems
Fix an issue where pseudo could try to compile incorrectly on an
x86_64 host system.  Now it verifies that it should be trying to build
a 32-bit library, and if so the necessary prereqs are available.

Also uprev to the latest version of pseudo changes to enable wrapping
of execl, local variable storage and misc fixes.

Signed-off-by: Mark Hatle <mhatle@windriver.com>
2010-08-12 15:47:02 +01:00
Joshua Lock 971907567c Enable build dir outside of the poky directory
You need to first set up the build directory by sourcing the poky build script,
after that builds can be run in that directory so long as bitbake is in $PATH
removing the need to source the init script for each build.

i.e:
$ . poky-init-build-env ~/my-build
$ bitbake some-image
<<later, in a different shell>>
$ cd ~/my-build
$ export PATH=/path/to/bitbake/bin:$PATH
$ bitbake an-image

This patch also removes use of OEROOT in recipes, etc.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-07-21 15:39:53 +01:00
Richard Purdie abf39a181a sanity.bbclass: Fix SDKMACHINE sanity check. We need to check the SDK_ARCH variable, not SDKMACHINE directly.
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-14 12:54:44 +01:00
Joshua Lock c350927b22 sanity.bbclass: Fix test for i686 SDKMACHINE
The 'is' keyword tests for object identity, returning True if the variables are
both referencing the same object. Changed the test to use the equality
operator, which compares the values of the objects.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-14 12:53:48 +01:00
Joshua Lock 6a9312cccc sanity.bbclass: Check for Python 2.6 or newer
In relocatable.bbclass and utility-tasks.bbclass we depend on functionality
that was only introduced with Pytrhon 2.6, so we now check that the build
system has it in the sanity class.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-08 17:29:46 +01:00
Joshua Lock c4a0b5463d sanity.bbclass: version each of the files in the build/conf/ directory
We already have versioning of the local.conf file but it's entirely plausible
for the bblayers.conf and site.conf to change incompatibly so we should version
those too.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-07 16:16:35 +01:00
Joshua Lock 7ada79de07 sanity.bbclass: check for invalid characters in OEROOT
Some characters in the path for OEROOT are known to cause issues, so check for
them in the sanity checker.
Currerently we warn on +'s and spaces.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-02 15:25:00 +01:00
Richard Purdie 7dcf1e47b7 sanity.bbclass: Check for SDKMACHINE=i686 and error if found
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-01 17:25:05 +01:00
Joshua Lock 138df217ef Drop vm_mmap_min_addr checks from scripts and sanity class
QEMU 0.12.x is relocatable so we no longer need these tests, which is good
because it doesn't work reliably with modern kernels.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-28 15:32:41 +01:00
Joshua Lock d425fac6d1 sanity.bbclass: fix typo in earlier commit
Commit fbe3d41eb0 left a trailing bracket which
cause an interpretation error

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-30 20:15:56 +01:00
Joshua Lock fbe3d41eb0 Version the build configuration directory
The addition of BBLAYERS changes the build/conf directory to be incompatible
with the "old way" in the Purple release.

As such things are likely to occur in future we should bersion the build/conf
directory through local.conf

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-30 16:25:41 +01:00
Joshua Lock 69d788ad5e Fix sanity check for new abi
current_abi is the abi of the tmp directory, not the current abi specified in
the abi file...

Now the sanity check should work sanely.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-29 10:25:39 +01:00
Joshua Lock 19a81653b7 Bump the ABI to alert people that cross has gone
Since we've change the tmpdir layout quite a bit we're going to bump ABI and
force a rebuild.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-28 17:48:08 +01:00
Joshua Lock d1f413ff30 sanity.bbclass: handle lack of permission to read /proc/sys/vm/mmap_min_addr
Patch from OE.dev by Martin Jansa to workaround that we on modern Linux we can
no longer read this file.

We need a better fix but best option will be to update to a newer, relocatable,
QEMU release.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-27 16:58:42 +01:00
Joshua Lock 7f019514d8 Move STAGING_BINDIR_CROSS into target sysroot, instead of native
Cross scripts now live in sysroot/$arch-distro-os/crossscripts, this conveys
that they are no longer native system dependant and emphasises their purpose.

Bump the staging ABI and implement a simple migration from ABI 3 to ABI 4.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-04-27 16:58:42 +01:00
Richard Purdie e17a0bd6c0 sanity.bbclass: Add a note about using dpkg-reconfigure
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:33:56 +00:00
Joshua Lock da10a2af54 sanity.bbclass: Add chrpath to the required utilities
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-15 16:43:38 +00:00
Richard Purdie b772c8cde5 bitbake.conf/base.bbclass: Rename the staging directory to sysroots and the populate_staging task to populate_sysroot
This change makes the purpose of the staging directory more obvious and
the taskname more true to what it now actually does.

The layout version number is increased due to the change in layout
but code to convert existing directories and insert a symlink for
backwards compatibility is included.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:42 +00:00
Richard Purdie c54117458a classes: Remove and sanitise import statements
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:28 +00:00
Damien Lespiau 65bf6c90e6 base.bbclass: packages pulling a mercurial tree should depend on mercurial
As we don't provide a mercurial-native package (yet) let's assume the
build machine has it installed and check (sanity.bbclass) if it's the
case.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2009-08-26 00:44:41 +01:00
Richard Purdie f2a9705633 sanity.bbclass: Really fix TMPDIR change warning message
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-05-28 21:32:30 +01:00
Richard Purdie ec4d79ddc8 sanity.bbclass: Fix the warning message above tmpdir moving to point to the correct path
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-05-23 10:56:21 +01:00
Damien Lespiau bcf14a38d5 sanity.bbclass: Fix error message when not having g++ on build 2009-02-04 09:47:35 +01:00
Richard Purdie bbdeccfd5b sanity.bbclass: Provide preserving the mmap_min_addr setting over reboots
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5106 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-08-26 10:23:59 +00:00
Richard Purdie 8beb43ca48 Move SANITY_ABI to its own file and give a more general name
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4938 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-07-24 11:10:33 +00:00
Richard Purdie 1b969af1b9 sanity.bbclass: Sync with OE, introduce TMPDIR ABI versioning, drop bitbake 1.8.6 cruft, only run the mmap_min_addr check on ARM when we need to run binary locale generation
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4450 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-05-07 09:49:38 +00:00
Richard Purdie f7cabaae53 sanity.bbclass: Add check of the /proc/sys/vm/mmap_min_addr value and warn if its potentially problematic
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4448 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-05-07 09:31:43 +00:00
Ross Burton 6697984ca2 sanity.bbclass: we don't use the md5sum binary any more, remove it
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4388 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-05-01 11:01:16 +00:00
Richard Purdie 7445d676db sanity.bbclass: Add a check for dash as /bin/sh and error if found
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4298 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-04-21 22:53:20 +00:00
Richard Purdie a0c44e0e6c sanity.bbclass: Fix typo
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3695 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-02-07 10:24:40 +00:00
Richard Purdie 51fd745b36 sanity.bbclass: Fix qemu check
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3694 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-02-07 10:23:08 +00:00
Richard Purdie 48f8cda2c3 Rename gcc-native3 -> gcc3-native for consistency and update sanity.bbclass to account for gcc3 changes
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3670 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-02-05 17:27:12 +00:00
Richard Purdie 27793088ad sanity.bbclass: Check TMPDIR doesn't change, error if it does
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3647 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-01-31 15:18:54 +00:00
Marcin Juszkiewicz 66ff85a048 base and sanity bbclasses + qemu: move gcc3 availability checking into base.bbclass
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3402 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-01-03 14:07:44 +00:00
Richard Purdie e2fe0bd7ee sanity.bbclass: Run sanity checks before parsing for speed, sync with OE
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2485 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-12 23:23:18 +00:00
Richard Purdie 6d5285742a sanity.bbclass: Further qemu check improvements
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2426 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-09 11:02:13 +00:00
Richard Purdie 043b8012bc sanity.bbclass: Factor ASSUME_PROVIDED into qemu checks
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2425 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-09 10:57:33 +00:00
Richard Purdie b14c8cd294 Switch back to using our own qemu binary for locale generation by default
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2424 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-09 10:52:43 +00:00
Richard Purdie 315b113c83 sanity: Add check for help2man
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2275 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-01 13:05:06 +00:00
Marcin Juszkiewicz fd46f224ad sanity: if Poky is used by root user (userid 0) then raise error
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2093 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-07-04 07:53:48 +00:00
Richard Purdie ae60cc23f9 README, sanity.bbclass: Add makeinfo (from texinfo) as a dependency. Also check for qemu-arm binary
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1086 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-12-22 13:51:35 +00:00
Matthew Allum 5eadd9dfaf Remove now uneeded gcc-3.x check
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1008 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-12-05 14:47:38 +00:00
Richard Purdie adabf6c093 sanity.bbclass: Add umask check
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@986 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-11-29 16:55:31 +00:00
Richard Purdie db564fe4d9 sanity.bbclass: Add sdl-config to required programs list. Remove fixme as now dealt with.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@941 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-11-22 16:43:41 +00:00
Richard Purdie 5962332b14 sanity.bbclass: Merge with OE syncing improvements both ways
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@855 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-11-16 14:20:49 +00:00
Matthew Allum 5713649ceb Add check for gawk, needed by x86 glic build
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@794 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-10-12 12:48:46 +00:00