Bug 11461

Summary: Poor interaction between sstate, devshell and addto_recipe_sysroot
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Paul Eggleton <bluelightning>
Component: coreAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: High CC: meta.mr.watcher, meta.watcher, randy.macleod, richard.purdie
Version: 2.2   
Target Milestone: 2.4 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Paul Eggleton 2017-05-05 04:01:33 UTC
If I do the following:

1) bitbake nodejs-native
2) bitbake -c clean nodejs-native
3) bitbake nodejs-native  (now restoring from sstate)
4) bitbake -c addto_recipe_sysroot nodejs-native
5) bitbake -c devshell nodejs-native

In theory I should be able to run npm because it's in nodejs-native's sysroot, but I can't because do_devshell has a dependency on do_patch, which depends on do_unpack which depends on do_fetch which will call clean_recipe_sysroot and my addition of nodejs-native's sysroot files to its own sysroot is wiped out.

What's even more annoying is if I then try to run bitbake -c addto_recipe_sysroot nodejs-native again, that task is still stamped as having run so it won't do anything; in theory I have to clean again but then I'm stuck in the same situation. I could of course force the task, cleansstate and rebuild from scratch, or delete the stamp by hand, but none of those solutions are ideal.
Comment 1 Paul Eggleton 2017-05-05 04:08:16 UTC
(In case it's not clear to everyone, this is by no means specific to nodejs-native / npm, it'll affect any native recipe; it just happened to be where I hit this.)
Comment 2 Richard Purdie 2017-05-09 11:15:03 UTC
I think we may need to teach clean_recipe_sysroot to wipe out any addto_recipe_sysroot stamps? Not perfect but would at least give you a way out of this situation?