Commit Graph

250 Commits

Author SHA1 Message Date
Richard Purdie 9e867efdc8 sstate: Add packagedata to list of tasks not to recurse
If we "bitbake X -c packagedata" and the packagedata comes from sstate, we
don't need any of the tasks dependencies. This is similar to the
populate_lic case, we only care about the end result.

Therefore short circuit the dependencies so packagedata doesn't pull in
any other dependencies.

(From OE-Core rev: 76aa4f49db7d32bbd35703c64470fdfc63f403a4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19 17:24:53 +00:00
Richard Purdie 5003d14761 sstate: Ensure populate_lic dependencies are not followed
It was observed that do_fetch dependencies (e.g. subversion-native of tremor)
were being installed even when sstate was available and hence no fetch was
needed. This turned out to be due to the recursive nature of the rootfs
dependencies which include populate_lic.

We can explicitly whitelist these dependencies as being ones we don't
need to follow when installing sstate (the code defaults to being paranoid).

[YOCTO #8746]

(From OE-Core rev: 06c891f0fa6c7712eae233dd18612f1ab1889c45)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 22:30:57 +00:00
Richard Purdie 03f15e5199 sstate: Ensure siginfo and sig files are also touched
Maintaining an sstate mirror is complicated at the moment as only the main
sstate tgz files have their timestamp updated when they're used.

This causes problems as the siginfo files can be removed from the server
due to inactivity but the sstate fetch code tries to fetch them leading
to confusing warnings and reduced debug capability.

This change ensures we touch any sig/siginfo files present and should
help ageing of the objects on sstate mirrors. It doesn't handle the intermediate
task siginfo files but those are never fetched by the current sstate code
so are an order of magnitude less problematic.

(From OE-Core rev: 80b3974081c4a8c604e23982a6db8fb32c616058)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-25 08:09:00 +00:00
Ross Burton 59b27d558f sstate: respect GPG_BIN and GPG_HOME
The package feed signing code supports the user providing the path to the gpg
binary and an alternative gpg 'home' (usually ~/.gnupg), which are useful for
both deployment and QA purposes.

Factor out the gpg command line construction to a function which can fetch both
of these variables, and also use pipes.quote() to sanitise the arguments when
used in a shell context.

[ YOCTO #8559 ]

(From OE-Core rev: 6daf138822bbbc46960121d3b76b42eaf19e7c0e)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-24 15:50:26 +00:00
Ross Burton 5fd30897f5 sstate: run recipe-provided hooks outside of ${B}
To avoid races between the sstate tasks/hooks using ${B} as the cwd, and other
tasks such as cmake_do_configure which deletes and re-creates ${B}, ensure that
all sstate hooks are run in the right directory, and run the prefunc/postfunc in WORKDIR.

(From OE-Core rev: 1d3bde02641f4b40030cf7e305ee3d7c2faabe29)

(From OE-Core rev: a026dbfa0ce4ee769ae2c714f27f4c4eaa4a0c73)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-28 12:00:22 +01:00
Paul Eggleton 3a9e230b7a classes/sstate: break out function to get sstate manifest filename
It is useful in a few different contexts to see which files have been
written out by an sstate task; break out a function that lets us get the
path to the manifest file easily.

(From OE-Core rev: 090196dd2d8f4306b34b239e78c39d37cc86034c)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:48:45 +01:00
Ross Burton 48a144b4a4 sstate: only fetch remote signatures if verification is enabled
Only fetch remote signatures if verification has been enabled, as otherwise the
fetcher throws errors that sstate.bbclass can't ignore.

[ YOCTO #8265 ]

(From OE-Core rev: aa8ba5c4af2636dbc2d0c1ad9c230e8aa26d9962)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:48:35 +01:00
Ross Burton e3feac122b sstate: implement basic signing/validation
To provide some element of integrity to sstate archives, allow sstate archives
to be GPG signed with a specified key (detached signature to a sidecar .sig
file), and verify the signatures when sstate archives are unpacked.

(From OE-Core rev: 237b6c51b42b0c64434dc45685e10f757ac939c2)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-06 15:26:27 +01:00
Jussi Kukkonen 5e7f26d082 gtk-icon-utils: Rename, upgrade, add binary
* Rename from gtk-update-icon-cache to gtk-icon-utils to better
  reflect the content. Fix references in other recipes and classes
* Upgrade to GTK+ 3.16.4
* Add gtk-encode-symbolic-svg binary: it is used by icon themes
  (e.g. Adwaita) to generate png versions of svg icons.
* Depend on librsvg-native for gtk-encode-symbolic-svg
* Add a patch that removes Gdk dependency from gtk-encode-symbolic-svg:
  this way the native build stays slim.

(From OE-Core rev: 5f4fe36f735ff8b97c5112b16bd90e794053573d)

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-07-16 20:39:15 +01:00
Andre McCurdy 7e7e1239d5 sstate.bbclass: remove redundant cd and mkdir commands
Update sstate_create_package and sstate_unpack_package to remove
redundant initial mkdir and cd commands. The working directory is
now setup correctly before the shell functions are called.

(From OE-Core rev: fd2d50d46e38d86829f88b5884a6fde6c38f155e)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:25 +01:00
Aníbal Limón 7f8286fb9e classes/sstate.bbclass: Improve checkstatus using connection cache.
Use FetcherConnectionCache to improve times when do checkstatus over
sstate resources.

[YOCTO #7796]

(From OE-Core rev: e6f66370c6ce15aca18ef64491bab3dc92b80c57)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12 22:55:46 +01:00
Aníbal Limón 615b351bf4 oe/utils.py: Add support for init/end helper functions in ThreadWorker.
Add init/end helper functions for ThreadWorker also pass ThreadWorker
as first argument to init/end/func functions this enables per-thread
storage handling.

classes/sstate.bbclass: Add thread_worker argument to checkstatus
function.

(From OE-Core rev: 08c50d62b520c8405f034e3d7adeea89e06226ee)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-26 09:27:30 +01:00
Aníbal Limón 3fa32158c4 oe/utils.py: Fix thread leakage in ThreadPool
In order to fix Thread leakage caused by not call join() in Threads,

Pass num_tasks in ThreadPool for add all the tasks into a Queue this
enable catch of Queue.Empty exception and exit the threads.

classes/sstate.bbclass: Change checkstatus function to match new
ThreadPool operation.

(From OE-Core rev: 524d92ed7b53bef933527095e82f378b934f25ef)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-26 09:27:30 +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
Richard Purdie ccb2d1b481 sstate: Add eventhandler which cleans up stale recipe data
"Incremental builds do not work well when renaming recipes or changing
architecture" is a long standing issue which causes people considerable
pain. We've struggled for a long time to come up with a way to
generically address the problem.

There are additional issues where removal of a layer caused data to
continue to exist and additionally, changing DISTRO_FEATURES also caused
problems in an existing TMPDIR.

This patch attempts to address this by adding a mapping between stamp
files and manifests. After parsing we can easily tell which stamp files
are still reachable, if any manifest has a stamp that can no longer be
reached, we can remove it. Since this code ties this to the sstate
architecture list, it will not remove data from other than the current
MACHINE (and its active architectures). It does not clean the sstate
cache so if another build activates something which was cleaned, it
should reinstall from sstate.

We can also go one step further, depending on the setting of
SSTATE_PRUNE_OBSOLETEWORKDIR, workdirs which are no longer active can
also be removed. This avoids the buildup of many old copies of data in
WORKDIR for example when versions are upgraded.

The one thing which may surprise people with this change is if you
remove a layer, data added by that layer will be "uninstalled" before
the next build continues. I believe this is a feature and a good thing
to do though.

This code is safe with existing builds. If something isn't in the new
index it simply isn't removed. Since changes to the sstate code trigger
a rebuild, after this merges, we can assume the code will start to
detect changes from that point onwards.

[YOCTO #4102]

(From OE-Core rev: 4ea39427eedeadd51439a62fa015c86be30c3445)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-10 12:00:13 +01:00
Richard Purdie 801436bf31 sstate: Add note when performing sstate mirror checks
The build can pause whilst remote sstate mirrors are checked for
sstate objects. Inform the user this is happening.

(From OE-Core rev: 4f4cfe8a4a0c602d6e11ea9bb75b52241deda9d6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-03 16:38:45 +01:00
Richard Purdie 1f839f233e sstate: Parallelise checkstatus calls for sstate mirror
Currently the urls are checked serially which is a performance bottleneck when
looking at http:// urls in particular. This adds code to check the url status in
parallel, mirroring the way we do this elsewhere.

We need the datastore for the fetcher so we use threads, not multiprocess.

(From OE-Core rev: 77c4865bbde4cd2a061cf333f9ad798afc6de0ef)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-03 16:38:45 +01:00
Richard Purdie 5bcf9666a6 sstate: Add handling of do_shared_workdir task
Changing TMPDIR and rebuilding an image was resulting in rebuilds of
kernels due to dependencies on the shared_workdir task. If installed
from sstate, nothing needs this task so add it to the whitelisted
task patterns.

After this change, the kernel does not rebuild when a new TMPDIR and
hot sstate cache is used.

(From OE-Core rev: 624f575298c74272b69560735cb6f13f5a7761c1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-21 10:51:15 +01:00
Richard Purdie 1237db6ee3 sstate: Improve HASHCHECK function to make siginfo configurable
In some cases we want to test the availability of siginfo files, in some
cases we do not and really want the .tgz files (which may or may
not be present too). This makes adds a parameter to the function to allow
this.

(From OE-Core rev: e8867b97a772f8e64fe209436c15d382b2175ca0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-15 17:44:59 +01:00
Richard Purdie 591e6a6dcb sstate: Use SSTATE_DIR for FILESPATH
FILESPATH was only being overridden in one fetch location, it should be
equally handled in both.

Also use SSTATE_DIR as FILESPATH so that mirror urls which do remapping
can search the local SSTATE_DIR for other paths.

Also ensure that MIRRORS is removed in both locations, previously
it was only unset in one but both codepaths should be consistent.

(From OE-Core rev: ab6bebddbdefec323e284b6438d9c57b3d8a2cc3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-29 10:58:54 +01:00
Adrian 6ad040a522 Add archiver folder to SSTATE_DUPWHITELIST
Without this patch the source archiver class is not allowed to
archive the same source archive for different builds.

(From OE-Core rev: 37284185912d496a974d507bde7208d93eefc29d)

Signed-off-by: Adrian <adrian.freihofer@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-20 11:03:45 +00:00
Peter Urbanec 754288c387 sstate.bbclass: Fix up white space lost in last commit.
Commit e9672387 split one long line into a multi-line string, but in
the process white space between words was lost. This results in badly
formatted output when this message is printed.

(From OE-Core rev: b145374c0a498de0160a9b81f50ce0066ab14862)

Signed-off-by: Peter Urbanec <openembedded-devel@urbanec.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-18 16:14:04 +02:00
Wenzong Fan 0d761fc4ff sstate.bbclass: specify func dirs for sstate_hardcode_path
For some recipes that inhrient cmake, the ${B} may be removed by
cmake_do_configure() while sstate_hardcode_path() running, this
causes build errors:

  Exception: OSError: [Errno 2] No such file or directory: \
  '/path/to/build'

The function sstate_hardcode_path() called command:

  $SSTATE_SCAN_CMD which extended as "find ${SSTATE_BUILDDIR} ..."

So the proper function dirs could be ${SSTATE_BUILDDIR}.

(From OE-Core rev: a949943e622b08485fc7632a0a743bc009079c67)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-18 16:14:04 +02:00
Robert Yang d3a5658519 sstate.bbclass: split the too long line
The too long line would cause "git send-email" report errors:
patch contains a line longer than 998 characters

Though we can use "--no-validate" to force the send.

(From OE-Core rev: e96723879eb3352a5bdea7b3e1a576edf9550e5a)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-10 16:44:32 +01:00
Robert Yang a2001341cf sstate.bbclass: the second bb.fatal not work
The code:
bb.fatal("foo1")
bb.fatal("foo2")

Would make the second one not work, use bb.error for first one to fix
the problem.

(From OE-Core rev: 33a87187a8520e190bcade76cc965aa58faaa85a)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-10 16:44:32 +01:00
Richard Purdie 4572e4cdc7 sstate: Add rpm allarch to overwrite whitelist
The packagegroup allarch rpm files for multilib can overwrite each other since
they are in theory indentical (in contrast to the other backends). We therefore
need to whitelist this to avoid build failures now this overwrite failure
is fatal.

(From OE-Core rev: d59ade0ca2cf629937434fa423dfbf35ce1209fc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-30 14:10:36 +01:00
Robert Yang 3ad2f855a7 sstate.bbclass: update the timestamps after install
Update the sstate file's timestamps after it is installed, it will be
very useful for removing the old sstate file, especially, it's not easy
to remove when use the shared SSTATE_DIR, we can easily remove them with
this change, for example:

$ find state-cache -type f -ctime +10 -exec rm -f {} \;

Will remove the sstate file which isn't used by recent 10 days.

We can use the -atime, but it is not always available, for example,
when mounted with "-o noatime".

The touch is a very light weight action, and the
scripts/sstate-cache-management.sh also requires this.

(From OE-Core rev: bbee747466a6947319cff2ffd676abf9432c16ae)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-29 12:12:44 +01:00
Richard Purdie 5cc591748e sstate: Change overlapping files warning to a fatal error
When files overlap in the sysroot, something bad usually happened. We've had
two independent cases recently where a couple of months after one of these
warnings was shown, builds failed due to corruption.

This change moves the warning to become a fatal error. The complaint I've had
about this is that we need to tell the user what happened and more importantly
how to recover from it. If we could recover from it, great but the trouble is
we simply don't know what happened.

As a compromise, we can document several of the possible scenarios in the error
message. We don't normally go to this level of detail however in this case, I'm
lacking other viable alternatives.

I do believe it is important to stop as corruption occurs rather than letting the
build contunue into territory that is not deterministic amongst other things.

The complex message is followed by a simpler one in case the long message is too
much for the user.

(From OE-Core rev: 179ac7de03977b6e440409eddb2166819e07286a)

(From OE-Core rev: 4b503f25f1ef8f554d3c76d88399db379dc818cc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-29 12:12:42 +01:00
Hongxu Jia 7450ba4053 sstate: set SIGGEN_LOCKEDSIGS_CHECK_LEVEL default to error
(From OE-Core rev: 65020364bd089afbb83cd216e7ae2f837077bfc5)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-17 22:00:26 +01:00
Richard Purdie c5cc4993f0 sstatesig/sstate: Add support for locked down sstate cache usage
I've been giving things some thought, specifically why sstate doesn't
get used more and why we have people requesting external toolchains. I'm
guessing the issue is that people don't like how often sstate can change
and the lack of an easy way to lock it down.

Locking it down is actually quite easy so patch implements some basics
of how you can do this (for example to a specific toolchain). With an
addition like this to local.conf (or wherever):

SIGGEN_LOCKEDSIGS = "\
gcc-cross:do_populate_sysroot:a8d91b35b98e1494957a2ddaf4598956 \
eglibc:do_populate_sysroot:13e8c68553dc61f9d67564f13b9b2d67 \
eglibc:do_packagedata:bfca0db1782c719d373f8636282596ee \
gcc-cross:do_packagedata:4b601ff4f67601395ee49c46701122f6 \
"

the code at the end of the email will force the hashes to those values
for the recipes mentioned. The system would then find and use those
specific objects from the sstate cache instead of trying to build
anything.

Obviously this is a little simplistic, you might need to put an override
against this to only apply those revisions for a specific architecture
for example. You'd also probably want to put code in the sstate hash
validation code to ensure it really did install these from sstate since
if it didn't you'd want to abort the build.

This patch also implements support to add to bitbake -S which dumps the
locked sstate checksums for each task into a ready prepared include file
locked-sigs.inc (currently placed into cwd). There is a function,
bb.parse.siggen.dump_lockedsigs() which can be called to trigger the
same functionality from task space.

A warning is added to sstate.bbclass through a call back into the siggen
class to warn if objects are not used from the locked cache. The
SIGGEN_ENFORCE_LOCKEDSIGS variable controls whether this is just a warning
or a fatal error.

A script is provided to generate sstate directory from a locked-sigs file.

(From OE-Core rev: 7e14784f2493a19c6bfe3ec3f05a5cf9797a2f22)

(From OE-Core rev: 884d4fa3e77cf32836f14a113c11489076f4a84d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-17 22:00:25 +01:00
Robert Yang 563ea5b3d9 sstate.bbclass: fix sstate_hardcode_path()
The "grep -e (x|y)" doesn't work, for example:
$ echo xy | grep -e '(x|y)'
No output

We can use "grep -E" (extended regexp) or "grep -e x -e y" to fix it.
It only affected the cross recipes.

(From OE-Core rev: 62722de6d0ec00608eacc2cb0396362aced00047)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-16 22:13:52 +01:00
Richard Purdie 57edf5991a sstate: Fix incorrect return value handling
The use of [ and && here means $? is reset and the exit 1 error
interception wasn't working, leading to "file changed as we read it"
errors from sstate_create_package when heavily using hardlinks.

Fix this by placing $? into a variable.

(From OE-Core rev: 6e51f900b76b06c09a3d6927f8db7398e2c035ed)

(From OE-Core rev: 75040a098e11927e6872e3a2a6286fe3ed0c7f47)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-16 22:13:51 +01:00
Hongxu Jia 5f26c0292b sstate: Add extra intercept functions SSTATEPOSTCREATEFUNCS
In some cases we do either need to add extra sstate manipulation
functions, or change the existing modification functions. This patch
parametrizes it to SSTATEPOSTCREATEFUNCS after sstate_create_package

(From OE-Core rev: ed5fb9c69fcf0f6e8e98f72ac753c66119468ea5)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-10 11:33:23 +01:00
Richard Purdie 347f9c6bc3 sstate: Add extra intercept functions
In some cases we do either need to add extra sstate manipulation
functions, or change the existing modification functions. This patch
parametrises them to SSTATECREATEFUNCS and SSTATEPOSTUNPACKFUNCS and
abstracts the "hardcoded path" functions into separate functions using
these new variables.

We may use this new functionality to improve binary relocating using
patchelf for example, this at least lets us have the hooks to be able to
experiment.

(From OE-Core rev: 9d659c6f20fa4a141b491c62a3ef0dfb1f896d9c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-28 15:12:42 +01:00
Paul Eggleton be02588097 classes/sstate: ensure do_package_qa_setscene doesn't pull in do_package_setscene
If we have done do_package_qa_setscene we do not also need
do_package_setscene. This means we can again for example rebuild an image
without needing do_package sstate packages to be present.

(From OE-Core rev: a0f584ac3d5a94dec121b684206ecd40c968f7fc)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-18 21:47:58 +01:00
Richard Purdie 03af60ede9 sstate: Allow switching between linux and non-linux SDK builds within the same tmpdir
Currently if you try and switch between linux/darwin/mingw SDK builds in the
same TMPDIR, things break. This is due to sstate not reflecting the SDK_OS in
the manifest names.

Since they are different, reflect this in the manifest naming and allow
this to work.

(From OE-Core rev: 7a0e1233ba196797f5f9bf862685dfae5511e751)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-03 12:40:40 +01:00
Richard Purdie 2fcaad20e9 sstate: Fix shared work preconfigure task handling
When the preconfigure task was added to gcc, it wasn't added to sstate's list
of possible shared work tasks. This meant that diffsigs wasn't able to find
the preconfigure sigdata/info file since it has inconsistent naming.

This adds the task name to the list. Ideally this list would be autogenerated
or not even required, right now its a sanity test that the shared work
code works as intended so is best left as is.

(From OE-Core rev: 72032f6dd6724663a3417b1d1b666d9a63fcbfdb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-19 17:55:10 +01:00
Richard Purdie bc19e915fb classes/lib/oe: Fix cross/crosssdk references
With the renaming of the cross packages, its no longer possible to use
endswith("-cross") and similar to detect cross packages. Replace these
references with other techniques.

This resolves certain build from sstate failures which were due to the
system believing cross packages were target packages and therefore
dependency handling was altered.

(From OE-Core rev: 91edf4cac223298e50a4b8e59dd19f1b272e3418)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-11 12:27:22 +01:00
Richard Purdie e078edbf99 binutils/gcc/gdb: Add TARGET_ARCH to PN for all cross recipes
This allows them to co-exist together in the native sysroot, with one
set of cross tools per target architecture.

(From OE-Core rev: a2c5509520d5c3e082f55844e6545d0309565f8f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-30 16:39:06 +01:00
Richard Purdie 0c282b6d53 sstate: Silence warnings when switching machines
We recently added multiple provider warnings. These could get issued
from -cross recipes due to the way these currently overlap in the
native sysroot. Filter out these warnings for now, until such times
as we improve the cross recipes so they don't have an overlapping
namespace.

(From OE-Core rev: d62f8d428831cc62b395f4c764c1e876353ddede)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-10 17:35:16 +01:00
Richard Purdie d62302f219 sstate: Remove name sstate parameter
A while ago we stopped supporting sstate names which were different from the
taskname. This patch finishes cleaning up some code remnants from that
which were causing data duplication and confusion.

(From OE-Core rev: 5a19863e389d28d8db4a86e409c1daa3c6b46eff)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-05 00:14:37 +01:00
Richard Purdie 633818c21b sstate: Fix an error handling the taskname
Looking at the code, its clear 'task' is meant not to have the do_ prefix,
however its also clear it can be left in through some code paths.

One result of this can be files not being cleaned from the sysroot correctly.

Fix this.

(From OE-Core rev: 3c912102fd9ea6b360f1af209da21e8f27b845c0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-05 00:14:36 +01:00
Alexandru DAMIAN edd500ed0d sstate.bbclass: update missed sstate event
This is a patch to update the missed sstate event with
info about the sstate files locations that were found.
It's needed as to display the found file in the toaster ui.

Also fixes a bug where a setscene task may have appeared in the
missed list even if it was found in a sstate mirror.

(From OE-Core rev: ad66cd521d3e661dd57c5aa02c204585101984f3)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-31 22:53:45 +01:00
Alexandru DAMIAN da4c46fc78 sstate: list missing files for toaster
Toaster needs to record the attempts to restore
setscene tasks that don't have a sstate file.

We build a list of tasks for which we can't find an
sstate file, and if we're running under Toaster data
collection, we send it off with a MetadataEvent.

(From OE-Core rev: 109ae6c5c981610ab0d63d2c83dcd50b2e93276b)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-21 12:05:53 +00:00
Paul Eggleton a3f0852b14 classes/sstate: don't overwrite buildhistory vardepsexclude
This was stomping over the value added in buildhistory.bbclass, leading
to task signatures *still* changing when buildhistory was added to
INHERIT.

Fixes [YOCTO #5897].

(From OE-Core rev: f7a0aa412a921a41d301be072cedcda2662ffbd7)

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>
2014-03-11 08:11:41 -07:00
Richard Purdie 2973c12838 sstate: Ensure SSTATEPOSTINSTFUNCS is accounted for in signatures
Bitbake can't interpret the python execution of these functions so
include the dependency manually.

[YOCTO #4507]

(From OE-Core rev: 39c53d26a1ea0859ca30456b6af0a28b2ea16769)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-05 15:50:20 +00:00
Richard Purdie e4ef6bbc21 sstate: Drop 'SafeDep' code from setscene validation function
I have a feeling this code exists from the time before we had proper
coverage of one sstate task by another task. At that time it was a
"poor" persons version of that idea, we now have much better
code internal to bitbake which handles this.

Worse, this code actually breaks certain rebuild scenarios,
e.g.:

bitbake libtool-cross
bitbake libtool-cross -c cleansstate
rm tmp -rf
bitbake libtool-cross

would fail as binutils-cross wasn't installed from sstate.

The easiest fix is to remove the obsolete/broken code.

[YOCTO #5773]

(From OE-Core rev: ccad07f35fb7f959e24fd50d04c7d10dd5cf20d0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-25 08:01:09 +00:00
Paul Eggleton d7eb0f5731 classes/sstate: fix taints being undone on execution of sstate tasks
The code here that deletes stamps was also deleting the taint files; so
forcing an sstate task with -f would force it to execute and then
because the taint file was deleted in the process, the next execution
would simply restore the output from sstate again. We need to exclude
the taint files just like we did in bb.build.make_stamp().

Fixes [YOCTO #5805].

(From OE-Core rev: 4708859e5627488251dc4250d45cb5f4e9736b8a)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-25 08:01:09 +00:00
Richard Purdie 8d17c39cd6 sstate: Exclude SSTATE_EXTRAPATH from checksums
After the change to allow target recipes to depend on native recipes, the
native checksums becomes all the more critical. Add to this that we're now
accounting for pre/postfuncs and we have a cache reuse issue since the
distro LSB string is getting coded in when it shouldn't be.

This excludes that string and allows one set of native sstate to share
checksums with another set from a different host distro. They're separated
into different directories so this is fine for our use cases.

(From OE-Core rev: 1fa7d4331d994b9eeb6f973d1a1f04cb4df92c13)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 17:15:54 +00:00
Richard Purdie 4e9eb77108 sstate: Improve funciton checksums
Now that bitbake is recursing into pre/postfuncs, we need to ensure
the dependencies of these functions is correct. We don't want dependencies
on MACHINE or other related variables. This patch adds in appropriate
variable exclusions to achieve this.

(From OE-Core rev: 8461283a648d7c5affd51971ebd9b35a8a4c625f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-04 22:51:43 +00:00
Robert Yang a6c6659b3f sstate.bbclass: remove previous version's stamp
There is a potential problem if we don't remove the previous version's
stamp, for example:

The depend chain is:
libtool-native -> autoconf-native -> m4-native
We have two m4-native: 1.4.9 and 1.4.7

1) Clean all of them to make a fresh build so that we can reproduce the
   problem
$ bitbake m4-native autoconf-native libtool-native -ccleansstate

2) Build libtool-native so that the m4-native_1.4.17 will be built
$ bitbake libtool-native

3) Set PREFERRED_VERSION_m4-native = "1.4.9" and build again
$ bitbake libtool-native

4) Set PREFERRED_VERSION_m4-native = "1.4.17" and build again
$ bitbake libtool-native -ccleansstate && bitbake libtool-native

Then the build will fail:
[snip]
| m4: unrecognized option '--gnu'
| Try `m4 --help' for more information.
| autom4te: m4 failed with exit status: 1
[snip]

The is because when we change m4-native to 1.4.17 and build
libtool-native again:
5) libtool-native depends on autoconf-native, and autoconf-native's
   version isn't change, so it can remove the current stamp and mirror
   the sstate (the one depends on m4-native_1.4.9) from the SSTATE_DIR
   correctly.

6) The mirrored autoconf-native depends on m4-native_1.4.17's
   do_populate_sysroot, and the stamp is already there (which is made
   by step 2), so it would do nothing, but this is incorrect, since
   the one that really in the sysroot is m4-native_1.4.9, then the
   error happens.

Remove previous version's stamp in sstate_clean() will fix the problem.

[YOCTO #5422]

(From OE-Core rev: 4659d29b1040349116549644e45035a5b37d9311)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-21 10:45:29 +00:00
Ming Liu e93a345fae sstate: add do_package to the noexec list in setscene_depvalid
do_package doesn't exist and are noexec anyway for native/cross/crosssdk
packages.

(From OE-Core rev: 1028ac813fa9803ebfff6bcfa7f8b67012609b27)

Signed-off-by: Ming Liu <ming.liu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-07 13:58:32 +00:00
Ming Liu 22764d3f4d sstate: Add optimizing logic for crosssdk setscene dependencies
This patch mainly aims to add optimisation for crosssdk setscene dependency
validating which we haven't handled in current logic, and which I think we
could have as we've already implemented to native/cross, although there
are albeit not many crossdk tasks, we could still get some performance
enhancement.

(From OE-Core rev: 1094983ff87a8b745a5bc7bfe9514433ee3c4ad2)

Signed-off-by: Ming Liu <ming.liu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-06 22:17:33 +00:00
Richard Purdie 325fb2bd24 sstate: Use datastore copies due to data changes persisting
The way the "all arch" PKGSPEC is enabled, it causes corruption
of the datastore of sstate operations against other tasks.

Data store copies are cheap and allow us to use that trick, resetting
to a clean copy of the data afterwards.

(From OE-Core rev: afaf16100efa79a275a2f4b9f2caa80decfdeb81)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-21 09:00:52 +00:00
Richard Purdie 3ada51f7aa sstate/sstatesig: Add populate_lic to list of arch invariant sstate tasks
Like fetch, unpack and patch, populate_lic doesn't vary between different
archs so we should mark it as such. This means better sstate cache reuse
with fewer duplicate files as well as less confusing sstate debugging.

sstatesig also needs to account for the fact BPN is used for sstate files
in these cases.

(From OE-Core rev: 3d59d0bed756f64d0092caa3892239c779c4a341)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-20 12:26:32 +00:00
Richard Purdie e5ee1b8c0d sstate: Convert to use ':' as a filename sperator and use SSTATE_SWSPEC globally
Currently the code has problems differentiating between "gcc-cross" and "gcc-cross-initial"
sstate files. We could add in a ton of special casing but tests show this isn't scaling
well. Using a more unique separator resolves the issue.

The choice of which separator to use is a hard one. We need something which isn't commonly
used in PN, PV, PR, *_OS and *_ARCH which rules out '-', '_' and it needs to work ok with
webservers/http which makes ';' and '%' harder.

The change also sets SSTATE_SWSPEC globally since writing out differently named siginfo
files for the fetch/unpack/patch tasks is a waste of diskspace, the hashes match for
all PN in the majority of cases and if they don't, its not a big issue as the hash is
different. This makes the results from sstate debugging more understandable.

(From OE-Core rev: 6f823a23c5f1d0ffa0a27db1c1bc1907de788505)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-20 12:26:31 +00:00
Richard Purdie 480bf037ae sstate: Get rid of crazy name mapping
When originally developed, it was thought a task may have more than one associated
sstate archive. The way the code has grown that idea is now not possible or needed.
We can therefore assume one sstate archive per task and drop the crazy name
mapping code. Simpler is better in this case.

The downside is that various sstate archives will change name so this forces a cache
rebuild. Given the other sstate changes going in at this time, this isn't really
a bad thing as things would rebuild anyway.

(From OE-Core rev: 5afe86a6854b21692fd97c5fc7fab50dbc068acb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-18 17:08:05 +00:00
Richard Purdie 7935ae2e80 sstate/gcc: Fix shared workdir handling for siginfo files
For a shared workdir, any one of the fetch/unpack/patch tasks may run yet the
PN and architecture fields in SSTATE_PKGSPEC may differ. This makes looking up
the appropriate siginfo file near impossible.

I've tried several different ways of resolving this and this is the neatest
solution I could find, its still rather ugly. I believe the usefulness of
better sstate debugging outweighs the ugliness of the code.

This patch also changes the sstate_checkhashes() code to look for siginfo
files rather than the actual sstate packages themselves. This means the
function can be used in other contexts to find info files for tasks that
may not have sstate data. It is assumed that sstate mirrors will have both
files available. This is done to allow bitbake to query whether tasks have
matching signatures in sstate directories or not.

(From OE-Core rev: 068e4289b597699cbff2dfde44ba833af4535281)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-18 17:08:04 +00:00
Richard Purdie 88f0166770 sstate: Write out siginfo files for non-sstate tasks
Currently siginfo files are only written for sstate tasks. In order to be truly
debuggable, its helpful to have the siginfo for intermediate tasks. This
adds that functionality so the extra siginfo files are written out too.

This will be used to add better sstate debugging in future changes.

(From OE-Core rev: 04d108cd16f5ad8f92a62ea537d1330fee712470)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-18 17:08:04 +00:00
Roy Li 8c5f345497 sstate.bbclass: ignore the tar failure.
sstate_package creates hardlink from sysroot to SSTATE_BUILDDIR, and
sstate_create_package stores SSTATE_BUILDDIR into a archive file by
tar, these two task can be run simultaneously for different packages,
and make a hardlink for a file will lead to the change of the links
number of file, and if tar is reading this file, it will fail with exit
code 1, and report "file changed as we read it":

    DEBUG: Executing shell function sstate_create_package
    tar: x86_64-linux/usr/share/aclocal/xorg-macros.m4: file changed as we read it

4b3e353a5[sstate.bbclass: fix parallel building issue] tries to use the
tar parameter --ignore-failed-read to fix, but it does not work, and
tar parameter --warning=no-file-changed can close the warning, but can
not change the exit code. so close shell immediate exit, only fail
if tar returns not 1 and 0.

Exit codes of tar:
    http://www.gnu.org/software/tar/manual/html_section/Synopsis.html

(From OE-Core rev: fad604b719e00b03e09da5fdb485e72332275b4a)

Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-24 17:24:12 +01:00
Roy.Li 0acde33c75 sstate.bbclass: fix parallel building issue
sstate_package creates hardlink from sysroot to SSTATE_BUILDDIR, then
sstate_create_package will store SSTATE_BUILDDIR into a archive file by
tar, but once other packages install the same file into sysroot, the
creating the archive file will fail with below error:

    DEBUG: Executing shell function sstate_create_package
    tar: x86_64-linux/usr/share/aclocal/xorg-macros.m4: file changed as we read it

This kind of error is harmless, use --ignore-failed-read to ignore it.
The error in tar occurs when the timestamp of the file changes and this
can happen when the number of symlinks change. The file will be included
in the archive.

[YOCTO #5122]

(From OE-Core rev: 4b3e353a532c7b68b0bb86df4a2fcc44f8bb3ef2)

Signed-off-by: Roy.Li <rongqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-14 08:20:59 +01:00
Richard Purdie 554c892ccf meta: Don't use deprecated bitbake API
These have been deprecated for a long time, convert the remaining
references to the correct modules and prepare for removal of the
compatibility support from bitbake.

(From OE-Core rev: 6a39835af2b2b3c7797fe05479341d71a3f3aaf6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01 15:51:42 +01:00
Richard Purdie 4273aa4287 sstate: Fix the relative symlink replacement code
ant reported on irc that the sstate absolute to relative symlink creation
code wasn't working in klibc. He was correct although the level of breakage is
rather surprising since it only worked for one level of symlink (usr/include) with
everything else being broken.

The reason is probably that nothing really uses absolute paths, we use relative
paths where at all possible already. Nothing in the target sysroot should use
absolute paths for a start. In this regard, the klibc-dev package is broken and
needs fixing. It will currently break when building for one machine, then switching
to another of the same TUNE_PKGARCH and installing from sstate but that is a
separate issue.

This patch fixes the symlink creation code by firstly passing in the correct
value we need (where the symlink will end up) and seccondly, actually using it.

I've also tweaked the debug message to contain appropriate information and got
right of the double "//" value the existing code created in favour of the form
'./..' which looks neater.

(From OE-Core rev: 9b05c65450526522d7358d0c0901b594de546748)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-23 17:29:33 +01:00
Joe MacDonald 4d326e5edf sstate.bbclass: Add an extra check for sstate_mirrors
BB_NO_NETWORK disables any fetching, however if we're using an external
sstate cache, we may want to be able to fetch those objects even if we are
not fetching the upstream sources.  Denote this situation by setting
SSTATE_MIRROR_ALLOW_NETWORK in local.conf.  When it is found, for sstate
cache fetches, mask off BB_NO_NETWORK for the local function.

(From OE-Core rev: ed585cad2e1fdc323c05fa82055a071bcf98d1bc)

Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-05 15:34:26 +01:00
Christopher Larson 00c8834293 sstate.bbclass: fetch archive+siginfo in a single pstaging_fetch
This avoids unnecessary duplication of setup. The only visible change in
behavior will be the case if siginfo exists and the archive does not, in which
case it'll redownload both, but this doesn't seem unresasonable to me,
particularly since the archive is downloaded first, making this case
particularly unlikely.

(From OE-Core rev: aa4991c307d4bbdd06c3cbf8448240b74c5e01c4)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-11 16:16:02 +01:00
Christopher Larson fbf64380f4 sstate.bbclass: kill MIRRORS and FILESPATH to speed up fetching
The default FILESPATH isn't really of use, as we don't expect to find sstate
archives buried in layer recipe directories, and the default MIRRORS is
intended for use for fetching SRC_URI, not sstate.

(From OE-Core rev: 46402b2f5b69004751f6663d435bedae0ad9dab1)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-11 15:56:01 +01:00
Richard Purdie 7bf5c38e0f base/useradd/sstate: Ensure do_package setscene has correct fakeroot dependencies
The do_package_setscene task needs to depend on fakeroot in order to correctly
install its files.

We can whitelist the dependency in the sstate handling code for some
performance improvements since we only need this if we're installing the
package from sstate.

Also use an append operator in base.bbclass for clarity.

(From OE-Core rev: 0810ea2a72bdea67a3d8002c4e12fb20f45cf1d5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-07 17:52:08 +01:00
Jackie Huang 50fae526de sstate.bbclass: fixup extra hardcoded paths
sstate has a logic to fixup hardcoded paths in scripts,
but it misses in some specific cases, so add
EXTRA_STAGING_FIXMES to the fixup hardcoded paths
mechanism, so that we can specify what hardcoded paths
need to be fixed in a recipe, e.g.
EXTRA_STAGING_FIXMES = "STAGING_BINDIR_TOOLCHAIN"

(From OE-Core rev: 2e840db56c45b4c63fded55f4ed763b7099284b9)

Signed-off-by: Jackie Huang <jackie.huang@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 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
Robert Yang c51e8b4532 sstate.bbclass: make hard links for staging files
Make hard links for staging files instead of copy to save the disk space
(3G will be saved for a core-image-sato build), and it doesn't affect
much on the build time.

The following directories are affected:
1) The sysroot
2) The DEPLOY_DIR
3) The pkgdata

[YOCTO #4372]

(From OE-Core rev: 5853e0f482b22258c909268fe71673a29e31989b)

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>
2013-05-02 17:41:53 +01:00
Phil Blundell 2895bcf95a sstate: Set umask to 002 before packaging runs
Otherwise we might end up creating directories under sstate-cache with whatever
random umask has been selected for the task that we're trying to package.  This
would be a bad thing since it might result in losing group write access for
newly created dirs, and/or losing group read access for the sstate files
themselves.

(From OE-Core rev: d8c4f442c41bf3ac5e064630657cd3fa1b5c43b1)

Signed-off-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-29 14:45:06 +01:00
Paul Eggleton c7f52855f9 classes/sstate: avoid traceback when no files have been staged
If no files have been staged we want to continue without error instead
of showing a traceback.

Fixes [YOCTO #4056].

(From OE-Core rev: ca36be708e54c0c86535bc8512295c76c48f6cf5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-03 17:01:13 +01:00
Andreas Müller 13837e5a31 sstate.bbclass: remove reference to gtk+-native
(From OE-Core rev: 13bc0117a0a18165e83e2bcdd880e704a0df5e3f)

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-02 18:11:06 +01:00
Jeff Polk b50626c6f0 sstate: add -f to mv when moving sstate files into place
Under some conditions (ACLs enabled, NFS) mv can interactively prompt
before overwriting files.  Avoid hanging builds in that case by using
-f which should be harmless in other cases.

(From OE-Core rev: b1a085db9d8ad2a3117af6f50e510bc9c2f9407b)

Signed-off-by: Jeff Polk <jeff.polk@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-02 18:08:23 +01:00
Leonardo Sandoval 66ed85a0c9 sstate.bbclass: Enclose sstate search parameter with quotes
In case filenames have spaces, execution of the function
sstater_install will hang, so the print parameter %s must be
enclosed with quotes.

(From OE-Core rev: 545d7aa26dfefdc927e0f4e2cc37398ef2c63fa6)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-05 13:28:09 +00:00
Richard Purdie 7e2e2cf508 sstate: Add gtk-update-icon-cache-native to postinst recipes list
(From OE-Core rev: 59cd32a6661d76ee070810823614eb797d6cc153)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-05 13:14:54 +00:00
Laurentiu Palcu b1a7b15941 sstate.bbclass: consider postinstall dependencies too
When checking the dependencies in setscene_depvalid(), make sure we also
consider those dependencies needed when running the postinstalls on
host.

[YOCTO #3918]

(From OE-Core rev: 8de0616825ed1b238b3486077af6897834bcb62d)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-05 13:14:53 +00:00
Richard Purdie 6c6f6b7ffd sstate.bbclass: Ensure build directory is cleaned to start with
This directory is cleaned upon completion however if a previous build
crashes, it can lead to corrpution, hence ensure its clean at the start
too.

(From OE-Core rev: 8ef0e59d5a7da3671d1ad9a54fe068ed78f928d5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06 13:12:59 +00:00
Richard Purdie dd61d22584 sstate/path.py: Add copyhardlinktree() function and use for performance optimisation
Add a function which copys a tree as a set of hardlinks to the original
files, then use this in sstate to reduce some of the overhead of sstate
package creation since the file isn't actually copied.

(From OE-Core rev: 8e373e69acac853213a62afb8bbdf0adc0c5045a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06 13:12:59 +00:00
Richard Purdie b01b1a704b sstate: Move debug comment to more logical place
The same log message gets output multiple times in the log which look
confusing and is rather pointless. Move the log message to the correct
level.

(From OE-Core rev: 3917409004a830e7ad0646f05ad7421385cbd1de)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-30 14:09:09 +00:00
Richard Purdie 0d2a301bca sstate: Add optimisation for useradd injected dependencies
useradd.bbclass adds sstate dependencies on base-passwd, shadow-native and
shadow-sysroot. Due to the way these are injected, they interact badly with
the other dependency validation logic and end up pulling in dependencies we
don't actually need. This patch adds code to optimise those cases out.

(From OE-Core rev: 784ca68fcca4ffb34390d55d9343570cfdf0305f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-25 12:42:48 +00:00
Richard Purdie 3247292683 Split do_packagedata task from do_package
Currently, do_rootfs has a dependency on all the do_package output being present
due to its usage of the pkgdata directories. This means that if you run:

bitbake xxxx-image -c rootfs

you end up having to fetch and unpack all the do_package data which is usually
large and inefficient. It also means rm_work has to leave all the do_package
data lying around so rootfs works.

This patch splits the actual creation of the pkgdata directory off into a separate
task, "packagedata" which happens immediately after do_package. We can then remap
the dependencies so this task is depended upon, not do_package. Sstate can then be
programmed not to require do_package at the appropriate times.

Whilst this patch doesn't do so, it opens the possibility of rm_work wiping
out the do_package output from WORKDIR as long as it also removed the do_package
stamp (both normal and setscene variants) and allowing more space savings
with rm_work which has been regularly requested.

(From OE-Core rev: 6107ee294afde395e39d084c33e8e94013c625a9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-25 12:42:47 +00:00
Martin Ertsaas 2c7bba51a6 sstate: Do not add the --no-run-if-empty arguement to xargs when on Darwin, as it is not supported.
(From OE-Core rev: 73b34d43633717b99e4f2f669939939cfa59eecb)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-15 08:10:14 +00:00
Hongxu Jia be78e8190a sstate.bbclass:specify function dirs to avoid race
Specify dirs in which the shell function "sstate_create_package" and
"sstate_unpack_package" are executed and don't use ${B} as default dirs
to avoid possible race with task do_rootfs at deb image creation time.

[YOCTO #3674]

(From OE-Core rev: ccef1cf783669a4683eda9d4b44dbe6bcf426259)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-09 15:05:26 +00:00
Richard Purdie 1e548a7fc7 sstate.bbclass: Improve stamp-extra-info task handling to avoid warnings
If you change a machine to a different package architecture, you will see sstate
errors about overwriting files as the code stands today. Instead it should clean
out the files safely and correctly. This patch changes the naming of stamp-extra-info
manifest files to avoid this problem. It will potentially trigger warnings during
builds in existing TMPDIRs until the system adjusts to the new naming, these are
harmless.

[YOCTO #3521]

(From OE-Core rev: 2cc8ee57f8148844bb7bcd4aaf34f6891cf3d410)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-17 17:24:58 +00:00
Richard Purdie 2636cb1133 sstate.bbclass: Remove unused/uneeded variable
(From OE-Core rev: 33ddf788c04044c8fe7ffbadab8787a5b6603186)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-17 17:24:58 +00:00
Richard Purdie d46766ea5c sstate.bbclass: Simplify overcomplicated cleanall function
The code was written before SSTATETASKNAMES existed. Since it
does exist, lets simply the code.

(From OE-Core rev: 9817e2efdb94395655d711f5eadedcd249c8cffe)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-17 17:24:57 +00:00
Saul Wold d3154aa9f8 sstate: fix typo
(From OE-Core rev: 17d27fd6e2750e6455f656159da56c3350c4b3cd)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06 22:59:10 +00:00
Richard Purdie dd3ad7f7f3 sstate: fix typo
(From OE-Core rev: 10cceb3854acd5c619d81011bac02da11ed580d2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06 16:36:08 +00:00
Saul Wold 97a91e81ea sstate: fetch .siginfo files from SSTATE_MIRROR
This would be useful for doing siginfo compares to understand why a build
is not reusing something when using SSTATE_MIRROR. No error will be reported
if it fails to find the .siginfo file

[YOCTO #2898]

[RP: Small tweaks]
(From OE-Core rev: 6d86690330f0d43839b904fced4b4b02cb27b8c6)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06 12:31:19 +00:00
Martin Jansa 381c4b69c7 sstate.bbclass: fix detection of owners matching sstate files
* without this patch:
  Python 2.7.3
  >>> sstate_search_cmd = "grep -rl /OE/jansa-test/shr-core/tmp-eglibc/pkgdata/armv7a-vfp-neon-oe-linux-gnueabi/runtime-reverse/vim-common /OE/jansa-test/shr-core/tmp-eglibc/sstate-control --exclude=master.list | sed -e 's:^.*/::' -e 's:\.populate-sysroot::'"
  >>> cmd_array = sstate_search_cmd.split(' ')
  >>> search_output = subprocess.Popen(cmd_array, stdout=subprocess.PIPE).communicate()[0]
  grep: |: No such file or directory
  grep: sed: No such file or directory

* Adding shell=True and using cmd string instead of array makes it work:
  >>> search_output = subprocess.Popen(sstate_search_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
  >>> print search_output
  manifest-armv7a-vfp-neon-gvim.package
  manifest-armv7a-vfp-neon-vim-tiny.package
  manifest-armv7a-vfp-neon-vim.package

  But still isn't 100% reliable, I guess it's caused by some other package
  being removed from sstate while grep is already running.
  So sometimes grep can show error on STDERR
  >>> search_output = subprocess.Popen(sstate_search_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
  grep: /OE/jansa-test/shr-core/tmp-eglibc/sstate-control/manifest-armv7a-vfp-neon-systemtap.package: No such file or directory

(From OE-Core rev: d84f7d7a12b4271f7b2bfde9fb356d750abff15d)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-05 15:34:07 +00:00
Enrico Scholz 306761b026 sstate.bbclass: fixed file-conflict check
The value of subprocess.Popen().communicate()[0] is a string.
Checking for '!= None' will always match causing bogus warnings
regarding already staged files.

(From OE-Core rev: acdd76482efc3caf80e9e0b7359be7ca724ae09a)

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-05 15:34:06 +00:00
Richard Purdie 13ecfdb331 packagegroup/allarch: Convert to use allarch class
Currently there is some odd behaviour of the packagegroup class in relation
to sstate since it sets PACKAGE_ARCH = "all" but does not use the allarch class
leading to it being undetected by sstate.

Previously it was not possible to use allarch as the recipe couldn't "undo"
settings made by the allarch class. Since this no longer happens when
PACKAGE_ARCH != all, we can use the allarch class.

This patch also fixes up one case we need to preserve TRANSLATED_TARGET_ARCH
and ensures sstate only assumes allarch when PACKAGE_ARCH is "all".

(From OE-Core rev: 591fa7c1ab9e9ff75fdce602c77ecdeda3a255d9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-26 10:01:24 +00:00
Richard Purdie 4fbcd2403f sstate: Explicitly define populate_sysroot task relationships
Clean up and clarify the populate_sysroot task dependencies. Target sysroot
packages do need their dependencies installed, as do some target/cross
relationships. We can whitelist the *-initial dependencies as these are
never needed indirectly.

(From OE-Core rev: eeec307917234d97be2674beeadef71599fb1487)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-24 15:12:28 +00:00
Richard Purdie 4b45039be4 sstate: Add a rule for target sysroot requirements from cross dependencies
For example gcc-cross depends on linux-libc-headers and needs it to be present
to build/work correctly.

(From OE-Core rev: 43ce7a1d86bf82d976ad241057a4207b1a340b3b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-24 15:12:28 +00:00
Richard Purdie f32ef56cda sstate: Implement a setscene dependency validation routine to allow skipping of some sstate installation
This is a first attempt at logic to determine when a sstate dependency needs
to be installed and when it does not. Its a start at the logic and errs on the
side of caution, as it gets wider testing, we can refine the logic as needed.

This code should allow a significant performance speedup to certain workflows, for
example "bitbake xxx-image -c rootfs" will not populate the target sysroot.

(From OE-Core rev: b43faba37816817edc5240a139361d16e07c6131)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-20 15:31:49 +00:00
Richard Purdie 2c82669988 sstate: Drop now unneeded python whitelist entries
(From OE-Core rev: 2a9a3e5e3e9229eb11f20eeabef7929014bccd11)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-18 16:42:07 +00:00
Richard Purdie 9e0d3c0faa sstate: Bump version number to deal with layout fixes
The recent preveeding sstate directory layout fixes made the code do what it
was originally intended to do, as can be clearly seen from the code.
Unfortunately this changed the contents and layout of the sstate files
themselves since the bug was leading to a directory prefix being missing.

This is now resulting in chaotic messages on the console since things
are getting confused with the two different layouts. The simplest way to
resolve this is to bump the version number, hence moving the new layout
into its own new namespace.

Its worth noting that whilst the failure messages are scary, the failure
mode is relatively harmless since it will just fall back to building the
data rather than installing from sstate.

Usually I'd give more notice of a change like this but under the
circumstances, I'm just going to push this in to resolve the failures
people are seeing. Initially I thought the problem was limited to
some of the -cross packages and therefore of low impact but that is
clearly not the case.

(From OE-Core rev: b53ea6687b6201c8c5ab5cb0d2a845ef7e7b2abe)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-14 23:37:45 +00:00
Richard Purdie aa75269454 sstate: Fix various path manipulation issues
Fix missing parameter to endswith and pass paths through normpath to remove
any duplicate "/" characters which would corrupt other calls like basename.

(From OE-Core rev: 172a74c540378149eec493c37c030e9f42f9603d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-14 15:58:08 +00:00
Richard Purdie 19ecc264f8 sstate: Be consistent about sstate-inputdirs/outputdirs ending with '/'
The manifest file can become corrupted if sstate-inputdirs and sstate-outputdirs
don't have matching endings. This patch ensures that even if set incorrectly,
the code functions as intended, thereby handling manifest corruption safely.

(From OE-Core rev: 0109a3623a19f9ae289952a4f054e53c3eca4eaa)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-14 14:38:28 +00:00