| Summary: | Feature request: recipe hook for source tree preparation | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Christopher Larson <kergoth> |
| Component: | core | Assignee: | Unassigned <unassigned> |
| Status: | NEW --- | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | Medium | CC: | bluelightning, meta.mr.watcher, meta.watcher, randy.macleod, richard.purdie, sgw |
| Version: | unspecified | ||
| Target Milestone: | Future | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Yes (doc changes required) | |
Chris, I'll assign this one back to you since you already have a proposed implementation ;) Not sure we have a large number of recipes needing this but there are some tangential problems such as the hoops devtool has to jump through to get prepared sources. This proposal has some interesting ideas but not be the full solution we need... (In reply to comment #2) > Not sure we have a large number of recipes needing this but there are some > tangential problems such as the hoops devtool has to jump through to get > prepared sources. This proposal has some interesting ideas but not be the > full solution we need... Yeah, that's why I never got around to implementing it, adding an explicit point for devtool and the rest to use as well. I still think the concept is sound, providing an explicit hook rather than the recipes determining the right mechanism to use, but it's low priority, and never got around to doing anything about it. For devtool, we are thinking of using the source unpack tracing to help so that can help here too. |
It's a common pattern among recipes to need to tweak the source tree after fetch/unpack/patch but before configuration. It's done to move files from workdir, sed files in the source tree, move things around, kill local m4 macros, move aclocal.m4 to acinclude.m4, etc. Often recipes will do one of these today: - prepend do_configure, which isn't ideal, as do_configure runs in ${B} now, so they need to cd to ${S}, modify, and go back, and of course these changes wouldn't be included in any source archival - add a postfunc to unpack/patch - add their own task between patch and configure I think there's value in providing an explicit hook for all recipes to be able to use to do this sort of logic. Using conditional noexec, we can avoid the overhead of even running the task when it isn't defined. We should state that classes shouldn't define it, either they should add their own task or _append/_prepend, that way the user is free to define it directly and not have to append/prepend to it themselves. See https://gist.github.com/kergoth/9d7d31999db83ab045db for a functioning prototype.