Commit Graph

98 Commits

Author SHA1 Message Date
Richard Purdie 5de7744a49 bitbake: parse/cache/cooker: Preserve order in the file inclusion list
The data returned by get_file_depends() may me used in contexts like
checksums where order is important. The current usage of sets means
that some of the checksums can change in circumstances they should not.

This patch changes to use lists, thereby removing the problem.

(Bitbake rev: a44285fc4109236ab89f7aad0a1fc9220eec19b6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-20 15:31:56 +00:00
Richard Purdie d485d0b0e8 bitbake: build/siggen: Add support for stamp 'clean' masks
Currently when we execute a task, we don't remove other potentially stale
stamps. This can mean if you switch between two different versions of a
recipe without a clean, the build can get very confused.

This patch adds in functionality to allow a wildcard expression of stamp
files to be removed when creating a new stamp file. This patch adds in
the core of the code to enable this but it also requires metadata support
to enable it.

When writing this improvement I went through several different options but
this was the only way I could find to allow things like noexec tasks to
function correctly (where stamps need to be created without the data store).

[YOCTO #2961]

(Bitbake rev: e026469b307522e5b6a680e0ae5587749d33dcae)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-20 11:48:38 +01:00
Paul Eggleton 8b8be74ed2 bitbake: implement checksums for local files in SRC_URI
Gathers a list of paths to have checksums calculated at parse time, and
processes these when calculating task hashes. Checksums are cached with
the file's current mtime. Thus, changing any local file in SRC_URI will
now cause the do_fetch taskhash to change, thus forcing a rebuild.

This change adds very roughly about an 8% increase in parse time (a few
seconds) and maybe a few seconds during runqueue generation, so a fairly
moderate performance hit.

Note that since paths are resolved at parse time, this will not force
a rebuild when files are introduced which would cause that resolved path
to be different - for example, where a machine-specific version of a file
was added without otherwise changing the recipe. This will need to be
handled in a future update.

Code to hook this into the signature generator was courtesy of
Richard Purdie <richard.purdie@linuxfoundation.org>.

Implements [YOCTO #2044].

(Bitbake rev: c993b7c457f8b7776e8a5dff253bfa0724bc2cae)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-23 11:35:04 +01:00
Paul Eggleton d7b818b51f bitbake: refactor out codeparser cache into a separate class
We want to be able to reuse most this functionality for the file
checksum cache.

(Bitbake rev: 0fe3cb1438d297f90dd0fc6b26362ecbff75c76d)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-23 11:33:18 +01:00
Shane Wang 8fa33800ef bitbake: change for adding progress bar in Hob2.
The changes include:
- Clean some events in event.py
- Fire essential events for Hob2 to handle with more information.
- knotty changes

(Bitbake rev: 9ede881620c501574f014e600cea6947ea908ac2)

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-23 22:52:17 +00:00
Dongxiao Xu 8e737db4fc cache: Use configuration's hash value to validate cache
Previously we use the file time stamp to judge if a cache is valid.
Here this commit introduce a new method, which calculates the total
hash value for a certain configuration's key/value paris, and tag
it into cache filename, for example, bb_cache.dat.xxxyyyzzz.

This mechanism also ensures the cache's correctness if user
dynamically setting variables from some frontend GUI, like HOB.

(Bitbake rev: 1c1df03a6c4717bfd5faab144c4f8bbfcbae0b57)

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-23 22:52:15 +00:00
Shane Wang a95445cf7b bitbake: Add description into the cache and clean up cache duplication
With the addition of new cache domains, the summary, license and section
information is no longer requred in the core cache since its only used by
the hob UI. This patch removes the duplicated entries.

It also adds the DESCRIPTION field to the cache for the benefit of hob2.

(Bitbake rev: 33ffb2e99825cb643b148b3462c2d4cf33ff5f58)

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-02 16:55:28 +00:00
Richard Purdie 4cd9671078 bitbake: Update users of getVar/setVar to use the data store functions directly
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-27 10:35:30 +00:00
Richard Purdie 12c6bcbf49 Add FAKEROOTNOENV variable
Add a FAKEROOTNOENV which does the opposite of the FAKEROOTENV variable
and is data loaded into the environment for tasks without the fakeroot
flag.

The intent here is to provide a way to control the environment when we
aren't needing fakeroot context which allows us to unload the preload
from memory entirely and gain a valuable speedup.

I'm not 100% happy with needing this at the bitbake level, particularly
with the cache hit but it does give a valuable speedup.

(Bitbake rev: 05c29ab0b2ad3c521414cabb6a92bca15c6e919c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10 11:51:11 +00:00
Joshua Lock eeaa87f3ec bb/cache: rename confusing variable
The bNeedUpdate variable doesn't reflect its purpose, and doesn't match
coding style (type encoded in variable name, camel case) - rename to
cache_ok.

(Bitbake rev: cc4158db215493ac270e27f92d977bcbe337f3db)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-11 19:07:59 +01:00
Paul Eggleton daed107ce1 bitbake: show more information for NoProvider errors
"Nothing PROVIDES" errors often come up when a recipe has been skipped
for some reason, and therefore it is useful to print out that reason
information when showing the error so that the user understands why the
error has occurred.

Given that we already feed the reason information into the skiplist for
various situations (COMMERCIAL_LICENSE, COMPATIBLE_MACHINE etc.) this
should now output a useful error message for skipped recipes.

Fixes [YOCTO #846], [YOCTO #1127]

(Bitbake rev: 6765218430e31c165888f26fbc75023c89a6eab2)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-27 16:54:04 +01:00
Paul Eggleton 3e0eb8a317 bitbake/cache: allow class names with arguments to be specified
This ensures we understand e.g. "virtual:multilib:lib64:pn" for multilib.

(Bitbake rev: 0b9dee799cfe2229ec62c257dda36bd6c15d34a9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-25 12:09:40 +01:00
Christopher Larson 9070e745c0 cache: fix remnant broken 'info' reference from recent cache changes
(Bitbake rev: 807fb0b3bbad5163fdab24d379c2deba8f0b4f13)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-21 11:09:46 +01:00
Richard Purdie 159aee22dc cache.py: Ensure additional .bbappend files are accounted for
Currently if a user adds a new .bbappend file to the system, the cache still
thinks the cached data is valid. This code fixes that to ensure additions and
changed in append application order are accounted for.

[YOCTO #1091]

(Bitbake rev: 54fe91fe96aaae47c40077c5f441c79da71da777)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-07 10:57:42 +01:00
Robert Yang 671e580111 bitbake: Add task specific stamp file support
This patch, based on proof of concept code from Richard adds code to
bitbake to allow individual tasks to optionally specify their stamp
file using the stamp-base flag. This takes the same form as the STAMP
variable but can be specified on a per task basis.

Code is also added to runqueue to ensure that if two tasks share the
same stamp file, only one will be executed at once.

A significant usecase for this code is to share source code (${S})
between recipes where separate build directories (${B}) are used.

(Bitbake rev: 41bef02bef8379590ba012319aebe05068a8081e)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-28 13:44:38 +01:00
Richard Purdie ba5db2d81c bitbake/cooker: Fix -b option by ensuring the empty cache structure is present
(Bitbake rev: 1430a36e81737bd92245042710eb9d6ad8b6f1a7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-13 15:10:07 +01:00
Scott Garman 73871c2712 cache.py: fix bitbake -s command
This uses the correct index of self.pn when setting up cachedata's
pkg_pn, fixing the output of bitbake -s.

This fixes bug [YOCTO #1149].

(Bitbake rev: d000493c09ac5c1dcbab22d3a91296a9cb194ac0)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-09 22:18:50 +01:00
Paul Eggleton 81e2f52fb8 track skipped packages
Add skiplist to cooker that allows access to the list of packages skipped
via SkipPackage (this includes COMPATIBLE_MACHINE, INCOMPATIBLE_LICENSE,
etc.) This can be used to enhance error reporting.

(From Poky rev: 6c12b7b1099c77b87d4431d55e949cf7c5f52ded)

(Bitbake rev: 7d2363f35350be27a33f568c23eb07fcd3d27e53)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-09 18:12:51 +01:00
Liping Ke 5af197b55a cache: Implement multiple extra cache fields request support
This patch is to support extra cache. If user needs to request
extra cache fields besides CoreRecipeInfo fields, just add a new
XXXRecipeInfo class definition as Hob Does.
Currently supported Extra RecipeInfo name is an array. We can
support multiple extra cache fields at the same time besides
CoreRecipeInfo which is needed by all clients.

(Bitbake rev: 077657e50ad032c0fa876bf54e9802af2686e0fb)

Signed-off-by: Liping Ke <liping.ke@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-07 22:40:01 +01:00
Liping Ke b3c41b1f46 Introduce new param caches_array into Cache impl.
When using hob ui interface, we need extra cache fields.
We will save ui required extra cache fields into a separate
cache file. This patch introduce this caches_array parameter.
It will be used in the extra cache implementation (following patch).
Caches_array at least contains CoreRecipeInfo. If users need extra
cache fields support, such as 'hob', caches_array will contain
more relevant elements such as HobRecipeInfo.

(Bitbake rev: d50389ae692377c957afec7c846fc2ce2c070a09)

Signed-off-by: Liping Ke <liping.ke@intel.com>
2011-06-07 22:39:52 +01:00
Liping Ke 8df355140c cache.py: Refactory Current Cache implementation
This patch is for refactorying current cache implementation, the
main reason is for introducing extra cache fields requests for
image creator as well as other users. The refactory parts include:
Move cache data retrieve methods out of Cache Data Fields
Definition. Since this retrieve methods will be shared for
both CoreRecipeInfo as well as the new introduced extra RecipeInfo
in the following patches.

(Bitbake rev: f0f53506926a3f79181796dde177f11f0a396b75)

Signed-off-by: Liping Ke <liping.ke@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-07 22:38:32 +01:00
Richard Purdie 001a555c2f bitbake/cache.py: Ensure skipped recipes make it into the cache to avoid reparsing
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-05 15:53:09 +01:00
Richard Purdie 9211fd9c37 bitbake/ast.py: Only run finalise() for the specified variant
Allows the heavy finalise function to only be run for the case we're
interested in when running tasks, saving some processing time.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-05 15:52:36 +01:00
Saul Wold 28e7041a9c universe target: add a new target to collect all recipe targets
This new universe target is not intended to be used for
compiling or building everything, it use is for sanity checking
and other tasks that need to find all targets. This does not
exclude any broken or virtual targets.

Signed-off-by: Saul Wold <sgw@linux.intel.com>
2011-05-03 12:10:53 +01:00
Richard Purdie e41671ea1d Revert "bitbake/gcc: Enable a shared common source tree"
This reverts commit 12b163dbd8 as it
was an unintended change for master
2011-03-29 00:34:11 +01:00
Richard Purdie 12b163dbd8 bitbake/gcc: Enable a shared common source tree
This patch is a quick proof of concept to show how source code could
be shared between recipes which use ${B} to have a separate build
directory compared to source directory ${S}.

Issues:

a) gcc uses sed and creates config files against ${S} which means
the directory should not be shared. Need to change the way that works.

b) Could be extended to cover eglibc except there is a patch applied
against nativesdk versions which again makes the source incompatible.

c) Need to clean up the layout in work-shared and make a directory level deeper
to ensure patch separation.

d) clean task does not remove stamps

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-28 15:09:50 +01:00
Richard Purdie 1b08a7eb8b bitbake/cache/runqueue.py: Move workload for recipe parsing to the child process
Parsing the recipe in the parent before forking off the child worker
can mean the parent doesn't hit the idle loop and becomes a bottleneck
when lauching many short lived processes.

The reason we need this in the parent is to figure out the fakeroot
environmental options. To address this, add the fakeroot variables
to the cache and move recipe loadData into the child task.

For a poky-image-sato build this results in about a 2 minute speedup
(1.8%).

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-28 20:48:08 +00:00
Joshua Lock 08c7a59b5a bitbake/cache: bump cache version after recent changes
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-02-24 16:02:13 +00:00
Joshua Lock a13304e1c6 bitbake/[cooker|cache]: cache summary, license and group. Add to targets tree
Add summary, license and group metadata to RecipeInfo and the cache.
Unfortunately this impacts parse speed but gives us a much richer set of
metadata to expose through UI's which can be accessed via the
generateTargetsTree command.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-02-24 15:54:51 +00:00
Joshua Lock 920c402342 bitbake/cache: store a list of inherited files in the cache
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-02-24 15:54:50 +00:00
Chris Larson 882ac1afea cache: fix docstring usage
Use comments instead of docstrings where appropriate in CacheData.

(Bitbake rev: 088d516e02bb2b4ce8a50bbaa967e944c46e620b)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10 22:34:10 +00:00
Dongxiao Xu 5da9423217 bitbake: fix parameter order for flaglist()
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
2011-01-20 23:29:25 +00:00
Dongxiao Xu 80cf3e405c bitbake: Introduce stamp-extra-info task flag into stamp filenames
For certain tasks, we need additional information in build stamp file
other than the task name and file name. stamp-extra-info is introduced as
a task flag which is appended to the stamp file name.

[Code simplifcations/tweaks from Richard]

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-18 12:50:04 +00:00
Chris Larson f305e95840 cache: don't expand variables for skipped recipes
Errors can result from these expansions, but for skipped recipes, we
shouldn't care about those failures.  This fixes the same issue which
Richard Purdie fixed in poky, commit 847b717.

(Bitbake rev: 96ee6840010c1ae1080e6bf7ff0f4eb2d361e84b)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 13:24:03 +00:00
Richard Purdie 847b717862 bitbake/cache.py: Expansion of variables in skipped recipes should not be attempted as they can trigger errors
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-07 12:56:06 +00:00
Bernhard Reutner-Fischer aae8532528 cache: defer marking fn as clean
Only mark fn as clean if it is clean.
This saves us from removing (prematurely added) fn from our clean set
and saves me a few percent of runtime (and misleading debugging output
from remove()).

(Bitbake rev: 884365228fcaac07421ac1440d4946693fb628c5)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 15:00:18 +00:00
Richard Purdie 0090a798eb bitbake: Sync a load of whitespace and other non-functionality changes with bitbake uptream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:54 +00:00
Bob Foerster 2735a70ece Show the user progress when loading the cache
(Bitbake rev: bdd7813d8eecf7b6b636322e748ca6bf69118513)

Signed-off-by: Bob Foerster <robert@erafx.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:51 +00:00
Chris Larson b890c19a33 cache: change to more incremental format
(Bitbake rev: 4fe4ffbef3885887c97eebe021edc3f23feab9ea)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:45 +00:00
Chris Larson 8a938d567f cache: ensure 'pn' is included in the pkgvars
(Bitbake rev: cefc28a2aa1e5703119dacfd885c8c159a1e47a3)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:44 +00:00
Chris Larson 739bb5a2d1 cooker: stop loading the cache for -b
Previously, the cache was actually being loaded from disk twice whenever using
-b or -e -b.  This also moves the bb_cache instance into the CookerParser, as
it's not needed by the cooker itself at all.

(Bitbake rev: dd0ec2f7b18e2a9ab06c499b775670516bd06ac8)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:43 +00:00
Chris Larson 7846d8db11 cache: don't add info to cache if cache is disabled
(Bitbake rev: f12bb303f3d86a68d0b3dda1112dd654b9251704)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:43 +00:00
Chris Larson 95d2f56126 Simplify cache syncing
Rather than adding nocache items to the cache, then copying the cache and
removing them to sync it, don't add them in the first place.  Also use 'with'
for the cachefile.

(Bitbake rev: 343b6f6255ad020c39e30742175a241f0859a5a6)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:43 +00:00
Chris Larson 32ea766871 Implement parallel parsing support
This utilizes python's multiprocessing module.  The default number of threads
to be used is the same as the number of available processor cores, however,
you can manually set this with the BB_NUMBER_PARSE_THREADS variable.

(Bitbake rev: c7b3ec819549e51e438d293969e205883fee725f)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:42 +00:00
Chris Larson 570bec37a8 cache: don't write out the cache unnecessarily
If the only recipes's we reparsed this run were those flagged as not to be
cached, there's no point in re-saving the cache, as those items won't be
included anyway.

(Bitbake rev: 1e0c4dbcbec886a30b89f8b4bb365c3c927ef609)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:42 +00:00
Chris Larson acca344057 cache: create and use a RecipeInfo class
This class holds the particular pieces of information about a recipe which are
needed for runqueue to do its job.

By using it, I think we improve code clarity, reduce method sizes, reduce
overuse of primitive types, and prepare for parallel parsing.  In addition,
this ditches the leaky abstraction whereby bb.cache attempted to hide the
difference between cached data and a full recipe parse.  This was a remnant
from the way things used to be done, and the code using it had to know the
difference anyway.  If we choose to reimplement caching of the full recipes,
we can do it in bb.parse, in a completely transparent way.

(Bitbake rev: 992cc252452221f5f23575e50eb67528b2838fdb)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:42 +00:00
Chris Larson 66b364cf8e cache: make loadDataFull a classmethod
(Bitbake rev: 16a9d689e61c35cfca94bbecd9772eab3c5072ba)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:41 +00:00
Chris Larson 814c80f53c cache: Add debug msg for a nonexistant dep file
If a recipe depends on a file, and that file is out of date, we show a
message, but if that file was removed, we do not, until now.

(Bitbake rev: 67984ba0ac2db79874541bc031f2e3e9ff7a6c32)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:41 +00:00
Chris Larson 84f02831a7 cache: use new style classes
(Bitbake rev: e084430446be2544dd1a6b627088f888c37cc7f0)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:40 +00:00
Chris Larson c4d939079e cache: pyflakes/pep8/pylint cleanup
(Bitbake rev: 06420ff839ffc37de3e42474b8b0e47c4608a985)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:40 +00:00