| Summary: | POSTINST_INTERCEPTS_DIR broken by undocumented POSTINST_INTERCEPTS_PATHS since thud | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Yann Dirson <ydirson> |
| Component: | oe-core other | Assignee: | Unassigned <unassigned> |
| Status: | RESOLVED NOTABUG | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | alex.kanavin, kergoth, randy.macleod, richard.purdie |
| Version: | unspecified | ||
| Target Milestone: | 4.2 M1 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | Backport | ||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Yes (doc changes required) | |
|
Description
Yann Dirson
2020-05-11 09:56:14 UTC
Can you provide easy steps to reproduce this please? Good point. In fact with simple variable setting it works (but that's not a very interesting case, we can do nearly as much already with the default POSTINST_INTERCEPTS_PATHS).
What does not work is setting it from an anonymous python block, which I'm using to set it conditionally.
$ git clone git://git.yoctoproject.org/poky
$ cd poky
$ cp -a scripts/postinst-intercepts/ intercepts-copy
$ cat > ../meta/recipes-core/images/test-image.bb <<EOF
include core-image-minimal.bb
#POSTINST_INTERCEPTS_DIR="/tmp/poky/intercepts-copy"
python () {
d.setVar('POSTINST_INTERCEPTS_DIR', "/tmp/poky/intercepts-copy")
}
EOF
$ bitbake test-image -e |& grep ^POSTINST_INTERCEPT|grep -v CHECKSUM
POSTINST_INTERCEPTS="/tmp/poky/scripts/postinst-intercepts/delay_to_first_boot /tmp/poky/scripts/postinst-intercepts/postinst_intercept /tmp/poky/scripts/postinst-intercepts/update_font_cache /tmp/poky/scripts/postinst-intercepts/update_gio_module_cache /tmp/poky/scripts/postinst-intercepts/update_gtk_immodules_cache /tmp/poky/scripts/postinst-intercepts/update_icon_cache /tmp/poky/scripts/postinst-intercepts/update_pixbuf_cache /tmp/poky/scripts/postinst-intercepts/update_udev_hwdb"
POSTINST_INTERCEPTS_DIR="/tmp/poky/intercepts-copy"
POSTINST_INTERCEPTS_PATHS="/tmp/poky/meta-poky/postinst-intercepts:/tmp/poky/build/postinst-intercepts:/tmp/poky/meta/postinst-intercepts:/tmp/poky/meta-yocto-bsp/postinst-intercepts:/tmp/poky/intercepts-copy"
Sadly I cannot help you further. This is not a scenario we test or support, so I'd say you have to find out where it breaks yourself. I'd be happy to squash this bug, but: * the lack of doc ot the feature remains * I'll need some assistance as to why traces added to image-postinst-intercepts.bbclass don't show up in the task log Mingli can you work on this for M2? Mingli had moved this to 3.99 since she's not able to work on it for 3.2. I'm moving it back to 3.2-M3 / unassigned in case someone wants to fix it. It seems like a use case that few people trip over so perhaps it should be a lower importance. The issue here is that image-postinst-intercepts uses the variables to set other variables at RecipePreFinalise event, which runs before anonymous python functions do. To set POSTINST_INTERCEPTS_DIR or POSTINST_INTERCEPTS_PATHS programmatically, you'd have to have an event handler of your own which runs before this one (registered before this one, i.e. create your own class and add it to INHERIT), or define it using inline python, i.e. POSTINST_INTERCEPTS_DIR = "${@my_function(d)}", or copy the event handler from image-postinst-intercepts.bbclass into a function so you can call it directly after you set it in your anonymous python function.
In any case, there's no real way around this. image-postinst-intercepts has to do this processing at parse time to ensure we track the checksums of the external postinst intercept scripts to ensure the task is re-run when those change or are created, so it cannot be postponed to image creation time.
As Christopher mentions, we can't really avoid this. We have to include the checksums of the intercepts in the task hashes for sstate purposes so setting this conditionally from anonymous python isn't possible, |