Bug 2044 - sstate needs a mechanism to detect changes to local files
Summary: sstate needs a mechanism to detect changes to local files
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: 1.3
Assignee: Paul Eggleton
QA Contact:
URL:
Whiteboard: (P1) Implemented
Depends on:
Blocks:
 
Reported: 2012-03-01 15:42 UTC by Paul Eggleton
Modified: 2012-05-30 08:50 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Eggleton 2012-03-01 15:42:35 UTC
Currently if you change a local file (such as a patch) referred to in SRC_URI, the hashes produced for the recipe's tasks do not change, and thus when using hash-based stamps and the eventual PR service the recipe will not be rebuilt.
Comment 1 Xiaofeng Yan 2012-04-11 02:47:52 UTC
I am interest in enhancing this feature. I want to implement this function in 1.3.
Comment 2 Richard Purdie 2012-05-02 10:45:30 UTC
We can split this tsak into a few logical changes that are needed. Firstly, we need a new bitbake module which maintains a list of files, their checksums and their mtimes. Users of the API will be able to request the checksum, if the mtime matches, it gets returned, if it doesn't we need to checksum the file first. We need to persist this cache. 

The initial user will be the fetcher but it may be worth consolidating all the various mtime caches in bitbake into this module. Its worth assuming that once we've checked the mtime of a file, it won't change again through the lifetime of bitbake (unless the cache is manually cleared maybe from a user like the hob UI).

The fetcher needs a new function which simply returns a string representing the SRC_URI checksums. This will mean different things to the different url backends. We're primarily interested in file:// urls here but this is a good opporutnty to explicitly add the SRC_URI[md5sum] info (and friends) into the task checksum too.

We can then call this function explictly from base.bbclass to add the string to the data for the do_fetch task and everything should be correctly tied into the sstate checksums.