Bug 7617

Summary: devtool: detect need to re-run configure
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Paul Eggleton <bluelightning>
Component: devtools / tool chainAssignee: Paul Eggleton <bluelightning>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: Medium CC: benjamin.esquivel, henry.bruce, markus.lehtonen, meta.mr.watcher, meta.watcher
Version: 1.8   
Target Milestone: 2.1.2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Paul Eggleton 2015-04-16 11:12:07 UTC
It would be useful if devtool (or rather, externalsrc.bbclass) could ensure that do_configure re-runs if one of the files that might change the behaviour of that step (e.g. configure.ac in the case of autotools) was changed. 

We would probably implement this by ensuring that file dependencies exist on an appropriate list of files, so that it's bitbake doing the checking rather than some additional code.
Comment 1 Markus Lehtonen 2015-10-01 13:15:50 UTC
You're thinking about making educated guesses about the project? That is, detect changes in common autotools files: configure[.ac|.in], Makefile.{ac|in}, autogen.sh etc.

How would you detect changes when externalsrc is in effect? Looking at do_configure stamps or something else?
Comment 2 Paul Eggleton 2015-10-02 12:48:49 UTC
Well, we can have a pretty good idea of what files to monitor based on what classes the recipe inherits. It won't necessarily be perfect, I agree.

We'll have to have a closer look at this in 2.1 and see if it's actually practical (and helpful).
Comment 3 Markus Lehtonen 2016-04-05 10:05:47 UTC
We could do something similar that we currently have for do_compile. That is, run a python function to get a list of files to put to do_configure[file-checksums], e.g. in externalsrc.bbclass do
  d.setVarFlag('do_configure', 'file-checksums', '${@get_configure_files(d)}')

get_configure_files() would then examine the source tree and recipe data and return a list of files to depend on.
Comment 5 Henry Bruce 2016-10-13 20:36:46 UTC
Re-opened as I am requesting fix be bapckported to krogoth.
Also setting importance to major as I believe this to be release blocker.

In the meantime, krogoth workaround is to add the following to recipe (and replicate for all other child CMakeLists.txt files in project
do_configure[file-checksums] += "${S}/CMakeLists.txt:True"
Comment 6 Paul Eggleton 2016-10-18 22:17:45 UTC
Sent krogoth backport for review (along with some other backports from master).