Re: Using custom python modules in classes and functions
On 7/22/22 08:53, Marek S?omiany wrote:
Hello everyone,Anonymous functions are run during parsing before anything is built. Therefore, I don't think it'll be possible to use a python module from a recipe in an anonymous function.
In order to use native binaries from recipes in another recipe, the binaries need to be in the recipe sysroot-native directory. This is what DEPENDS does behind the scenes, it adds a dependency for one task of your recipe on the population of sysroot-native from all dependencies (DEPENDS). Therefore, your DEPENDS will be enough if it happens in any task running after the do_prepare_recipe_sysroot task of your recipe.
Don't forget that a task is run only if it's in the path of a task requested by the user or another recipe as a dependency. Usually it needs to be in the path of the do_build task. e.g. addtask my_task after do_prepare_recipe_sysroot is not enough if you want my_task to always run during a normal build because nothing has a dependency ON my_task. addtask my_task after do_prepare_recipe_sysroot before do_configure for example, will work, because when do_configure will need to be run, it'll ask my_task to be run too by bitbake.