Hi, I'm trying to debug an issue which seems to be caused by the order of prepend operations from bbappends with anonymous python functions. I'm using Xilinx Petalinux tools 2023.1 version which corresponds to Yocto Langdale, but this feels like a generic bitbake/yocto question.
I have two layers both with device-tree.bbappend files, both of which set FILESEXTRAPATHS:prepend, although sometimes through anonymous python functions. I need my layer to apply the prepend last so we have the first entry in FILESEXTRAPATHS and our version of a file is found. The ultimate purpose of this is to find our version of the "config" file with machine specific paths removed as it's stopping us from effectively sharing sstate cache using a network file server. The output from "bitbake-layers show-layers" shows that our layer has the higher priority: meta-xilinx-core <...snip...>/components/yocto/layers/meta-xilinx/meta-xilinx-core 5 meta-datapath-esg <...snip...>/yocto/meta-datapath-esg 9 The meta-xilinx-core layer is a dynamic layer in Xilinx's meta-petalinux layer and in the layer.conf has: BBFILES_DYNAMIC += " \ <...snip...> xilinx:${LAYERDIR}/dynamic-layers/xilinx-core/recipes-*/*/*.bb \ xilinx:${LAYERDIR}/dynamic-layers/xilinx-core/recipes-*/*/*.bbappend \ <...snip...> " But when looking at the FILESEXTRAPATHS variable with "bitbake-getvar -r device-tree FILESEXTRAPATHS" I can see that the lower priorty Xilinx dynamic layer is prepending last via the anonymous python functions so their version of the file is being found first: # $FILESEXTRAPATHS [17 operations] # set? <...path...>/components/yocto/layers/poky/meta/conf/bitbake.conf:376 # "__default:" # set <...path...>/components/yocto/layers/poky/meta/conf/documentation.conf:176 # [doc] "Extends the search path the OpenEmbedded build system uses when looking for files and patches as it processes recipes and append files." <...snip...> # :prepend <...path...>/components/yocto/layers/meta-petalinux/dynamic-layers/xilinx-core/recipes-bsp/device-tree/device-tree.bbappend:3 # "<...path...>/components/yocto/layers/meta-petalinux/dynamic-layers/xilinx-core/recipes-bsp/device-tree/files:" <...snip...> # :prepend <...source path...>/yocto/meta-datapath-esg/recipes-bsp/device-tree/device-tree.bbappend:2 # "<...source path...>/yocto/meta-datapath-esg/recipes-bsp/device-tree/files:" # :prepend <...source path...>/yocto/meta-datapath-esg/recipes-bsp/device-tree/device-tree.bbappend:11 # "<...source path...>/yocto/meta-datapath-esg/recipes-bsp/device-tree/../../../bsps/dgc219:" # :prepend <...source path...>/yocto/meta-datapath-esg-dgc219/recipes-bsp/device-tree/device-tree.bbappend:7 # "<...source path...>/yocto/meta-datapath-esg-dgc219/recipes-bsp/device-tree/files:" # prepend device-tree.bbappend:14 [__anon_18__home_phil_build_dgc219_release_dgc219_components_yocto_layers_meta_petalinux_dynamic_layers_xilinx_core_recipes_bsp_device_tree_device_tree_bbappend] # "<...path...>/project-spec/configs:" # prepend device-tree.bbappend:16 [__anon_18__home_phil_build_dgc219_release_dgc219_components_yocto_layers_meta_petalinux_dynamic_layers_xilinx_core_recipes_bsp_device_tree_device_tree_bbappend] # "<...path...>/components/yocto/layers/meta-xilinx/meta-xilinx-core/gen-machine-conf/gen-machine-scripts:" <...snip...> The relevant operations in the Xilinx bbappend are: FILESEXTRAPATHS:prepend := "${@'${THISDIR}/files:' \ if ((d.getVar('WITHIN_PLNX_FLOW') or '') != '' and \ not d.getVar("SYSTEM_DTFILE")) else ''}" python () { if d.getVar("CONFIG_DISABLE"): d.setVarFlag("do_configure", "noexec", "1") if d.getVar("WITHIN_PLNX_FLOW") and not d.getVar("SYSTEM_DTFILE"): d.appendVar('SRC_URI', ' file://config file://system-user.dtsi') sysconfig_dir = d.getVar('SYSCONFIG_DIR') or '' plnx_scriptspath = d.getVar('PLNX_SCRIPTS_PATH') or '' if sysconfig_dir: d.prependVar('FILESEXTRAPATHS', '%s:' % sysconfig_dir) if plnx_scriptspath: d.prependVar('FILESEXTRAPATHS', '%s:' % plnx_scriptspath) d.appendVar('SRC_URI', ' file://%s' % plnx_scriptspath) } Is this the expected ordering? (That prepends from anonymous python functions d.prependVar() happen after VAR:prepend ignoring bbappend/layer ordering/priority? Is there a way I can ensure my prepend comes last without having to BBMASK out the Xilinx bbappend and recreate/modify it's contents elsewhere? Best Regards, Phil Dawson
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#63927): https://lists.yoctoproject.org/g/yocto/message/63927 Mute This Topic: https://lists.yoctoproject.org/mt/108776846/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-