Bug 2044

Summary: sstate needs a mechanism to detect changes to local files
Product: [Build System, Metadata & Runtime] BitBake Reporter: Paul Eggleton <bluelightning>
Component: bitbakeAssignee: Paul Eggleton <bluelightning>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: mark.hatle, poky.bs.watcher, poky.watcher, richard.purdie, sgw, song.liu, Xiaofeng.yan
Version: unspecified   
Target Milestone: 1.3   
Hardware: x86   
OS: Multiple   
Whiteboard: (P1) Implemented
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

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.