How to force package to be recompiled on Yocto
Asked Answered
K

1

8

TL;DR: Is there a way to force to recompile a package every time an image is generated?

I have a bbappend with a do_deploy_append appending to a file and if I modify this step, the recipe will not be recompiled when generating an image using it. This can lead to errors pretty hard to ind. Bitbake assumes it has been unchanged. I have only 2 packages like this, very small.

Is there a parameter to force those package being cleaned and recompiled without manually do it?

I am using Yocto morty

Kerrison answered 11/10, 2017 at 12:25 Comment(8)
How are you adding the file? Normally, bitbake should detect that the file has been modified and automatically rebuild the recipe. Which version of OE / Yocto are you running?Baalbeer
I have updated the description. It was not complete indeedKerrison
Could you add an example? I've got bbappends both replacing files and modifying files using eg sed? in a do_install_append()`-step. They all works as intended. Besides, which version of OE / Yocto are you using?Baalbeer
github.com/agherzan/meta-raspberrypi/blob/master/recipes-bsp/… I have a bbappend extending this configuration.Kerrison
Ah, that makes it more interesting... Unfortunately, all my recipes with bbappends do actually use a do_install task. As ${B} is completely unused in rpi-config_git.bb I guess that you're modifying files in ${S} (which also could be bad for rerunning the task). Would you mind to try and replace your do_install_append with a do_deploy_append?Baalbeer
Exactly, it seems that bitbake ignores the ${S} directory, it would actually make sense but in this particular case, the deploy append doesn't make a difference. I think the recipe iteself needs a rewriting, because this looks like a kind of hack hereKerrison
Yes, a rewrite to install stuff to B, then deploy from B to deploy_dir would normally be a good idea. Hm, a nice rewrite would likely be to install to B and make all modifications from do_deploy in B; then use the modified files from B to deploy them... I'm not using any RPi, though, so I won't be testing it. Though, I would have assumed that changes to do_deploy by an append would have been recognized by bitbake...Baalbeer
This is pretty uncommon, it should not happen in the deploy, I understand bitbake isn't aware them. To answer the question, I would also take another case. If in a recipe, SRCREV="${AUTOREV}", bitbake will not check if there's a new commit on this repo. Working on a project in development daily needs this variable set this way, but I find myself cleaning everytime.Kerrison
M
18

Generally speaking, if you want a task to always be executed, you should use the [nostamp] varflag on this task, which should be set to "1". For example, if you want the recipe to be recompiled every time, you should add the below line to the package's recipe:

do_compile[nostamp] = "1"

To always execute the do_configure task, you should add the following line:

do_configure[nostamp] = "1"

This applies for any task that you need to always be executed. Have a look here for more information on nostamp variable flag: http://www.yoctoproject.org/docs/2.3.2/bitbake-user-manual/bitbake-user-manual.html

Moises answered 16/10, 2017 at 14:43 Comment(1)
This is exactly what I was looking for. Thank you!Kerrison

© 2022 - 2024 — McMap. All rights reserved.