Commit Graph

31 Commits

Author SHA1 Message Date
Richard Purdie 564c687c2a bitbake: parse/ConfHander/BBHandler/utils: Fix cache dependency bugs
Currently bitbake only adds files to its dependency list if they exist.
If you add 'include foo.inc' to your recipe and the file doesn't exist,
then later you add the file, the cache will not be invalidated.

This leads to another bug which is that if files don't exist and then
you add them and they should be found first due to BBPATH, again the
cache won't invalidate.

This patch adds in tracking of files we check for the existence of so
that if they are added later, the cache correctly invalidates. This
necessitated a new version of bb.utils.which which returns a list of
files tested for.

The patch also adds in checks for duplicate file includes and for now
prints a warning about this. That will likely become a fatal error at
some point since its never usually desired to include a file twice.

The same issue is also fixed for class inheritance. Now when a class
is added which would be found in the usual search path, it will cause
the cache to be invalidated.

Unfortunately this is old code in bitbake and the patch isn't the
neatest since we have to work within that framework.

[YOCTO #5611]
[YOCTO #4425]

(Bitbake rev: 22e6b1c4c4afb27057689bbc94cbdf1f19f93e3d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-02 13:08:47 +00:00
Martin Jansa aa0b237144 bitbake: parse: Return IOError when including file with absolute path
* resolve_file was behaving different when relative and absolute
  paths were passed to it

* include relative-path/non-existent-file.inc
  works correctly resolve_file throws IOError, BBHandler.py:handle()
  doesn't catch it, ConfHandler.py:include() catches IOError and shows:
  DEBUG: CONF file 'relative-path/non-existent-file.inc' not found
* include /absolute-path/non-existent-file.inc
  was failing, because resolve_file just returns fn,
  BBHandler.py:handle() calls bb.parse.mark_dependency(d, abs_fn)
  which throws:
  OSError: [Errno 2] No such file or directory: '/absolute-path/non-existent-file.inc'
  and parsing fails.
  Ad isfile() test for absolute fn and throw IOError to make
  resolve_file behavior consistent for both paths.

* I know we had some issues with -b relative-path-to-recipe.bb and
  absolute path, so consider this patch only as RFC and documentation of
  this problem

* Catch OSError too in ConfHandler.py:include() e.g. in case the file exists, but user
  cannot read it or something like that.

(Bitbake rev: b0bbd89a4f0b98fa1ab28b8e0526cd9ddb76fa57)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-26 11:29:46 +01:00
Peter Seebach 4dd6d9139c bitbake: bitbake: data_smart.py and friends: Track file inclusions for bitbake -e
This code adds inclusion history to bitbake -e output, showing
which files were included, in what order. This doesn't completely
resolve timing questions, because it doesn't show you which lines
of a file were processed before or after a given include, but it
does let you figure out what the path was by which a particular
file ended up in your build at all.

How it works: data_smart acquires a .history member, which is an
IncludeHistory; this represents the inclusion of a file and all its
inclusions, recursively. It provides methods for including files,
for finishing inclusion (done as an __exit__), and for
dumping the whole tree.

The parser is modified to run includes inside a with() to push
and pop the include filename.

RP Modifications:

a) Split Include and Variable tracking
b) Replace deepcopy usage with dedicated copy function
c) Simplify some variable and usage

(Bitbake rev: b2dda721262da8abb7dc32d019e18fbc32ed8860)

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-18 12:35:19 +00:00
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
Lianhao Lu 959981da53 bitbake: Added BBINCLUDED variable.
Added new variable BBINCLUDED indicating the file dependency
information. It exposes the internal variable '__base_depends' and
'__depends'.

(Bitbake rev: af524a656fce32d01687481b86c31bef00eb9fc3)

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-28 12:27:21 +00:00
Paul Eggleton 99d326a818 bitbake: add file and line number to ParseError
Ensure that a file and line number are reported for ParseError where
possible. This helps particularly in the case of inherit and require
which previously did not report either of these upon failure.

(Bitbake rev: f588ba69622a2df35417ced184e56c79ac1b40d5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-23 22:52:15 +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
Bernhard Reutner-Fischer 9ed8e9f371 parse: Use constants from stat instead of magic numbers
(Bitbake rev: bcabe2dfb587042e139890329ff52d9bb9201cf4)

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:07 +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
Chris Larson 717f13d63c parse: use bb.utils.which
(Bitbake rev: 2bc893dc407bf608cac7e12673161b75b712da83)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:52 +00:00
Chris Larson ecc68fa4fb Switch bitbake internals to use logging directly rather than bb.msg
We use a custom Logger subclass for our loggers

This logger provides:
- 'debug' method which accepts a debug level
- 'plain' method which bypasses log formatting
- 'verbose' method which is more detail than info, but less than debug

(Bitbake rev: 3b2c1fe5ca56daebb24073a9dd45723d3efd2a8d)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:33 +00:00
Richard Purdie 9747616600 bitbake/siggen: Ensure full signature data is not held unless needed, reducing memory consumption
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-29 10:47:17 +01:00
Richard Purdie 43595fabbe bitbake: Implement signatures
Includes functionality to find out what changes between two different singature data dumps.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-03 16:08:32 +01:00
Bernhard Reutner-Fischer 30216c65e5 cache: use a set() for __depends
to make updating depends easier/more intuitive/eventually faster

(Bitbake rev: f7c69462b8ba726861898817cc5b13174c78e35a)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:35 +01:00
Chris Larson 9d32ff0c87 Make the file not found error actually useable.
(Bitbake rev: 1cfcbee014478eb129ed382c13622317412b036e)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:35 +01:00
Chris Larson 1180bab54e Apply some 2to3 transforms that don't cause issues in 2.6
(Bitbake rev: d39ab776e7ceaefc8361150151cf0892dcb70d9c)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:33 +01:00
Chris Larson 0b4ad7062b Drop __all__ usage
(Bitbake rev: b4983cc7bfe5300c1d2904f34fb03d4fb2f41d90)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:33 +01:00
Chris Larson 6623d79ada Stop using functions via 'bb' that were moved from there to other modules
(Bitbake rev: 03a6c26f8da226f442c3cab557e4733f7cd6eeac)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:32 +01:00
Chris Larson c675bfd5bf bitbake: [parse] Use bb.which in resolve_file
(Bitbake rev: 3cd06ed487ee0617892f154cff461379a323a1fb)

Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:56 +00:00
Holger Freyther 7b57ad901a bitbake: [parser] Make resolve_file only resolve the path
Do not attempt to open the file in the resolve_file method
(a lot like bb.which... maybe bb.which can be used). This way
we don't need to open/close a file which we have already parsed.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:55 +00:00
Holger Freyther 793c88dd92 bitbake: [parser] Remove the "data" from feeder, evaluate after parsing a file
Evaluate the statements after having parsed one file. This is
referred to as "entwirren" and we can remove the direct evaluation
and postpone a bit, in the future we can use a cached copy instead
of parsing the original.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:51 +00:00
Chris Larson 3eb2e6cf02 bitbake: [parse] Move vars_from_file from bb.parse.BBHandler into bb.parse.
(Bitbake rev: fda0707d772e0964a0185d4ec4d016522f6972f3)

Signed-off-by: Chris Larson <clarson@mvista.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:50 +00:00
Chris Larson 6f52a1521e bitbake: [parse] Don't use relative import of parse_py.
(Bitbake rev: 0a2bb3dd790e3e40867195f14f4e174f98f8a47c)

Signed-off-by: Chris Larson <clarson@mvista.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:49 +00:00
Holger Freyther 4b25b519ae bitbake: [parser] Cary a Statement Node through the parsing
When parsing we will collect a number of statements
that can be evaluated...The plan is to be evaluate
things twice (old+new) and then compare the result,
it should be the same.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:06:50 +00:00
Holger Freyther 913e78898e bitbake: [parse] Unify opening a file...
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-10 16:31:33 +00:00
Richard Purdie 31511eb978 bitbake parse/__init_.py: Add missing update_mtime function fixing bitbake shell reparse failures
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5196 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-09-16 19:14:49 +00:00
Richard Purdie f5665d5bfc bitbake: Sync with upstream.
* File licence headers were sanitised causing most of the diff. 
 * cooker.py was created from bin/bitbake. 
 * cvs fetcher port option was added
 * The -f force option was fixed to work correctly
 * Multiple entries in rrecrdeps are now handled correctly
   (allows adding do_deploy to image depends)
 


git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1129 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-01-08 23:53:01 +00:00
Richard Purdie 306b7c7a97 bitbake: Upgrade from 1.4 -> 1.7.4ish
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@863 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-11-16 15:02:15 +00:00
Richard Purdie 27dba1e624 Update to bitbake 1.4.2 (latest stable branch release). This includes the caching speedups
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@371 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-05-09 15:44:08 +00:00
Richard Purdie 62dc8f47b3 Update bitbake to latest bitbake svn
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@262 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-02-10 10:11:32 +00:00
Richard Purdie f54da734eb Initial population
git-svn-id: https://svn.o-hand.com/repos/poky@2 311d38ba-8fff-0310-9ca6-ca027cbcb966
2005-08-31 10:47:56 +00:00