6

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

David Bensoussan
  • 2,887
  • 2
  • 38
  • 55
  • 1
    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? – Anders Oct 11 '17 at 12:55
  • I have updated the description. It was not complete indeed – David Bensoussan Oct 11 '17 at 19:04
  • 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? – Anders Oct 12 '17 at 05:39
  • https://github.com/agherzan/meta-raspberrypi/blob/master/recipes-bsp/bootfiles/rpi-config_git.bb I have a bbappend extending this configuration. – David Bensoussan Oct 12 '17 at 05:42
  • 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`? – Anders Oct 12 '17 at 05:59
  • 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 here – David Bensoussan Oct 12 '17 at 06:05
  • 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... – Anders Oct 12 '17 at 06:09
  • 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. – David Bensoussan Oct 12 '17 at 07:38

1 Answers1

14

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

john madieu
  • 1,209
  • 12
  • 16