Bug 14799 - do_deploy task is not called after kirkstone migration
Summary: do_deploy task is not called after kirkstone migration
Status: RESOLVED NOTABUG
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 4.0.1
Hardware: x86 Multiple
: Medium normal
Target Milestone: 0.0.0
Assignee: Kevin Raymond
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2022-05-12 12:30 UTC by Kevin Raymond
Modified: 2022-05-13 07:02 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments
task deps under kirkstone (4.36 KB, text/plain)
2022-05-12 12:30 UTC, Kevin Raymond
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Raymond 2022-05-12 12:30:09 UTC
Created attachment 4865 [details]
task deps under kirkstone

I am in the process to validate the hardknott -> kirkstone upgrade,
however I am hitting an issue where the do_deploy() task is not run
for a specific recipe under kirkstone, where it is successfully run
under hardknott, using the deploy class.
My current branch is based on the commit "4ec7cb8202 ruby: upgrade 3.1.1 -> 3.1.2". I don’t find anything related to my issue in the recent changes (I plan to rebase the code next week).

Under hardknott, my recipe has the following code:

    inherit deploy
    
    do_deploy() {
        install -m 0644 ${D}/${MYPATH}/${MACHINE}-file.txt ${DEPLOYDIR}/
    }
    addtask deploy before do_build after do_install

My current issue is that do_deploy() is never called under the
kirkstone branch while building my DISTRO where it is called as
expected under hardknott.
running "bitbake -c do_deploy <recipe_name>" successfully deploy the file

diving in the tasks list, I found that:
- in both project branches, do_build is set as noexec. Removing this
flag does not "fix" the issue.
- reverting "bitbake: build: Disable warning about dependent tasks for
now" let me know that the tasks are defined
- do_deploy is not set as a parent task of do_build under kirkstone,
which is the case under hardknott. This is quite the only change I can
find.
- adding do_build[depends] += "${PN}:do_deploy" does not trigger the
do_deploy tasks (even when I remove the noexec flag to the do_build
task) but let me match the task list of the hardknott one

task_deps exported as attachment.


Expectation
-----------
do_deploy() is triggered under kirkstone as in hardknott

Actual Result
-------------
do_deploy() is never called when building my DISTRO unless I call specifically the do_deploy task.


Reproducibility
---------------
100%
Comment 1 Randy MacLeod 2022-05-12 14:38:51 UTC
Which bitbake target are you expecting to run this?

Presumably running:
$ bitbake recipename 
likely does run your task. Does it?

We suspect this is an error or misunderstanding of how bitbake should work and that since we clean-up unneeded build dependencies, you are only noticing this now.
Comment 2 Kevin Raymond 2022-05-12 15:21:07 UTC
hum, you’re right. 

   $ bitbake recipename
run the deploy task where 

   $ bitbake distroname
does not (unlike under hardknott)


Here is my configuration (recipename renamed to recipe1):
    DISTRO set VIRTUAL-RUNTIME_init_manager = recipe2
a runtime dependancy is set to recipe1 in recipe2
    RDEPENDS:recipe2 += "recipe1"
    
Building recipe1 or recipe2 effectively trigger the deploy task, where building the DISRTO does not.

However, when I mean "building the distro" it is in fact the "virtual/kernel" target (linux with initramfs). recipe1 is packaged and installed in the root filesystem, it’s just the deploy task which is not run.


I might do something out of the chart, can you point me to the commit where the unneeded dependencies are dropped?
Comment 4 Kevin Raymond 2022-05-13 07:02:58 UTC
Ok thank you very much, I missed this on the 3.4 migration guide.

To resolve my issue I’ll move to build the image instead of the virtual/kernel target and pull the task from there, as the do_deploy is needed only when building the image.

Closing as NOTABUG