Commit Graph

253 Commits

Author SHA1 Message Date
Robert Yang 48b5ea6782 sanity.bbclass: check /bin/sh is dash or bash
The build would fail when /bin/sh links to ksh or csh, we only test dash
and bash AFAIK.

* When /bin/sh -> csh:
  $ bitbake quilt-native
$ bitbake quilt-native -cfetch
Illegal variable name.
Illegal variable name.
[snip]
uname: extra operand `2'
Try `uname --help' for more information.

* When /bin/sh -> ksh:
  If there are only a few tasks running, for example,
  "bitbake quilt-native", the build would be OK, but it would fail if we
  run "bitbake world" for a while, there would be a lot of "Broken pipe"
  errors:
Exception: CalledProcessError: Command
'cd /path/to/xx; find . -type d -print | tar -cf - -C /path/to/sysroot-destdir -p --files-from - --no-recursion | tar -xf - -C /path/to/xxx'
returned non-zero exit status 2 with output tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
find: `standard output': Broken pipe
find: write error

[YOCTO #7917]

(From OE-Core rev: ecdfdd7286a2f406655577f2c4d6fcf3fe3de429)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-26 09:28:53 +01:00
Richard Purdie 86d30d756a meta: Add explict getVar param for (non) expansion
Rather than just use d.getVar(X), use the more explict d.getVar(X, False)
since at some point in the future, having the default of expansion would
be nice. This is the first step towards that.

This patch was mostly made using the command:

sed -e 's:\(getVar([^,()]*\)\s*):\1, False):g' -i `grep -ril getVar *`

(From OE-Core rev: ab7c1d239b122c8e549e8112c88fd46c9e2b061b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:57:25 +01:00
Juro Bystricky fe0f643496 sanity.bbclass: Prevent 'vdi' and 'live' to be built together
Same reason and check as for vmdk.

(From OE-Core rev: deb7ee16cd04b03417a68d32d14b5b0ad3c59eca)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-11 23:59:13 +01:00
Jussi Kukkonen f63e9b30ea xserver-xorg: Upgrade 1.16.3 -> 1.17.1 (OELAYOUT_ABI change)
* Increase OELAYOUT_ABI: this is required because the
  xf86-video-modesetting package moves from its own recipe to
  xserver-xorg and sanity check cannot handle that currently.
  The upgrade will delete old xf86-video-modesetting files from
  sysroots.
* Remove upstreamed xserver-xorg patches
* Remove xf86-video-modesetting recipe: the driver is now included in
  xserver-xorg recipe, which now produces the xf86-video-modesetting
  package. The package version changes from 0.9 to 1.17.1
* Update xserver-xorg license checksum: modesetting license
  info (another MIT one) has been added to the file

(From OE-Core rev: 950846d019ffac21909a96d90af8cf7e5bdd5738)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-03 16:38:48 +01:00
Jussi Kukkonen 9d8c61acd0 sanity.bbclass: import subprocess in correct function
check_sanity() no longer needs the subprocess module but
sanity_handle_abichanges() does use subprocess.call().

(From OE-Core rev: 469b53fb3bb94c7e5e9fb53d07cec2292b13c87d)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-22 13:29:47 +01:00
Shiqun Lin 66e2eef21d sanity.bbclass: improve the sanity check for PATH and BBPATH
Build fails if "./" is in the PATH

To reproduce the issue:

  $ export PATH="./:$PATH"
  $ make -C build-tools elfutils

  Error: ./ld: unrecognized option '--sysroot=/'

(From OE-Core rev: b6a23572b8f14e27d4341892b9069e7cac1e9c14)

Signed-off-by: Shiqun Lin <Shiqun.Lin@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-20 21:41:09 +01:00
Mariano Lopez f6e13ec535 sanity.bbclass: Increased verbosity for connectivity check
The connectivity sanity error doesn't tell you which URL failed to fetch nor how
it failed.

This provides the URL that failed and why it failed using BBFetchException
messages during the connectivity check.

[YOCTO #7592]

(From OE-Core rev: e025d1ff02795fc9236b41606e916749f0d5e959)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-14 11:43:57 +01:00
Andre McCurdy 09fa915b56 mirrors.bbclass: drop support for svk sources
The svk fetcher was removed from bitbake 1.22, so svk support should
logically have been removed from oe-core Daisy onwards.

(From OE-Core rev: 9560d58596ceb50280b81296688883f3fca99aa6)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-05 22:15:17 +01:00
Robert Yang 72ead27887 sanity.bbclass: vmdk and live can't be built together
Both vmdk and live use syslinux, but they have different/conflicted
configurations, the main conflictions are:

                    vmdk                live
SYSLINUX_ROOT       root=/dev/sda2      root=/dev/ram0
SYSLINUX_LABELS     boot                boot install
INITRD              No                  yes

So it would make the boot menu strange and vmdk can't be boot, we need
add a few extra vars to fix the problem such as SYSLINUX_ROOT_VMDK
SYSLINUX_ROOT_LIVE, but that needs a lot of changes in the code, so just
add a sanity checking for it.

[YOCTO #6889]

(From OE-Core rev: 521737f456b6ea7f7f153132c77cb74c08f088dc)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-22 08:50:02 +00:00
Paul Eggleton 1bb0022384 classes/sanity: avoid bblayers version issue when switching between poky and other DISTRO values
If you create a build directory with poky, or set DISTRO to "poky" and
run bitbake, you'll get a bblayers.conf file with LCONF_VERSION set to
6. If you then set DISTRO to any other value where the new distro config
doesn't pull in poky's config, e.g. "nodistro", you would then get a
bblayers.conf version error which didn't immediately make sense. (The
layer versions have been out-of-step ever since meta-yocto-bsp was
split out of meta-yocto several years ago).

This is just painful and we'd rather users didn't have to deal with
it. Obviously it isn't an OE-Core problem per se, but a simple way to
resolve it for everyone is to bump OE-Core's version to 6 with an
automatic no-op upgrade. Also ensure that multiple upgrade functions
(such as the poky one) have a chance to execute by not breaking out of
the loop as we were before.

Fixes [YOCTO #6139].

(From OE-Core rev: 2fdeee2fad69445b0d97148826c7b027820be63a)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-23 18:00:20 +00:00
Richard Purdie d0857f4ae3 sanity: TMPDIR ABI change for kernel process
The kernel source is being moved into the sysroot, to do this and
preserve previous builds, we need to change the TMPDIR ABI and
provide a function to uninstall all kernels from the sysroot.

This change adds code to do that and increases the ABI number.

(From OE-Core rev: 323f9ea99cff00a751e446286bf8bcf8756e4351)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-21 12:37:53 +00:00
Christopher Larson 8491ca52b8 sanity: refactor mirrors checks to be more pythonic
- 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>
2014-08-27 12:12:29 +01:00
Christopher Larson af6d66852f sanity: fix support for regex schemes in mirrors check
(From OE-Core rev: c8afcb9cab9d610892db9c41b29685583f3b5773)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-27 12:12:29 +01:00
Christopher Larson d68255d14b sanity: handle both \n and \\n in mirror vars
(From OE-Core rev: 3e203e91afa48557eb754dd554944012f7f0c0a2)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-27 12:12:29 +01:00
Robert Yang 0ae7b58060 sanity.bbclass: check the format of MIRRORS
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>
2014-08-23 23:01:57 +01:00
Robert Yang eb34d6650b sanity.bbclass/kernel.bbclass: minor fixes
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>
2014-08-23 23:01:57 +01:00
Mark Hatle bfb23e6038 sanity.bbclass: Add ability to verify toolchain flags
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>
2014-08-02 09:26:17 +01:00
Richard Purdie 3134ae1127 sanity: Check for setgid/setuid TMPDIR
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>
2014-07-23 21:59:17 +01:00
Richard Purdie 47309419d3 sanity.bbclass: Update minimum git version to 1.7.8
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>
2014-07-08 11:20:14 +01:00
Richard Purdie 5f45b00604 sanity.bbclass: Add libsdl-native check
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>
2014-06-03 16:49:19 +01:00
Stefan Stanacar 342322c7bb sanity: testimage needs DISPLAY set only for qemu targets
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>
2014-04-04 11:53:50 +01:00
Richard Purdie 1588b02d14 image/image-prelink/image-mklibs/sanity: Drop pointless EXPORT_FUNCTIONS
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>
2014-04-01 23:37:01 +01:00
Paul Eggleton 49f2bc450c classes/sanity: check if SDKMACHINE setting has taken effect
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>
2014-03-31 22:53:45 +01:00
Richard Purdie b015b64a9d sanity.bbclass: Update against bitbake sanity event changes
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>
2014-03-27 09:42:07 +00:00
Olof Johansson b1a75ba1d8 sanity.bbclass: support wildcards in SANITY_TESTED_DISTROS
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>
2014-03-05 15:50:21 +00:00
Robert Yang 4720817502 sanity.bbclass: check that TMPDIR is not located on nfs
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>
2014-02-02 11:22:11 +00:00
Robert Yang 8b576acb21 sanity.bbclass: check required perl modules
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>
2014-01-28 00:52:34 +00:00
Mike Crowe 447a057988 sanity: Use random filename for maximum path length test
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>
2013-11-25 16:14:48 +00:00
Mike Crowe 181875b5d9 sanity: Don't hard code value of ENAMETOOLONG
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>
2013-11-25 16:14:48 +00:00
Paul Eggleton c028dcda06 classes/sanity: validate SDKMACHINE value
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>
2013-11-14 13:39:48 +00:00
Richard Purdie 40b3030626 bitbake.conf: Default DISTRO to nodistro
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>
2013-11-12 16:00:30 +00:00
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
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