Bug 15742

Summary: do_task[depends] cannot add dependencies needed for conversion types
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Louis Rannou <louis.rannou>
Component: oe-core otherAssignee: Ross Burton <ross.burton>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: Medium CC: randy.macleod, ross.burton
Version: unspecified   
Target Milestone: Future   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Attachments:
Description Flags
Patch to publish the base type resolution
none
Patch to publish the base type resolution
none
add tasks for conversion types none

Description Louis Rannou 2025-02-14 10:53:44 UTC
Created attachment 5098 [details]
Patch to publish the base type resolution

When a new task requires a dependance to a image type, we are supposed to write:
    mytask[depends] = 'myimage:do_image_tar'

If we require a conversion type (eg tar.gz or tar.gz.lzo), there is nothing to help.

That's quite unconfortable for a user and complexifies automation.

A first step would be to provide the _image_base_type function from image.bbclass. This would let anyone resolve types (patch provided).

Then, oe might be able to resolve something like
mytask[depends] = 'myimage:do_image_tar_gz_loz'
Comment 1 Louis Rannou 2025-02-14 13:13:27 UTC
Created attachment 5099 [details]
Patch to publish the base type resolution
Comment 2 Louis Rannou 2025-02-14 13:57:25 UTC
Actually forget about the first step and the patch as it wouldn't be available from an other recipe :/
Comment 3 Louis Rannou 2025-02-14 15:07:59 UTC
Created attachment 5101 [details]
add tasks for conversion types

This is a patch to create tasks for conversion commands

For example, if IMAGE_FSTYPES contains "tar.gz.lzo", the new tasks depends are created:

    do_image_complete -> do_image_tar_gz_lzo
    do_image_complete -> do_image_tar_gz
    do_image_tar_gz_lzo -> do_image_tar_gz_lzo
    do_image_tar_gz -> do_image_tar
Comment 4 Randy MacLeod 2025-02-20 15:37:18 UTC
Bug review:
The automatic image conversion is quite complicated so we're not surprised that there are corner cases. Likely a full expansion of all combinations is not sensible since tasks are somewhat slow in bitbake.

This may have to wait to early in 5.3 since we're weeks away from feature freeze.
Comment 5 Ross Burton 2025-02-20 16:16:52 UTC
Wouldn't it be better to depend on myimage:do_image_complete, which is the "the images you requested have all been built" task?
Comment 6 Randy MacLeod 2025-02-20 19:05:56 UTC
Louis, See Ross' question, please.
Comment 7 Louis Rannou 2025-02-21 10:24:55 UTC
(In reply to Ross Burton from comment #5)
> Wouldn't it be better to depend on myimage:do_image_complete, which is the
> "the images you requested have all been built" task?

When the new task is from another recipe it would indeed. But if the task is somehow in the same recipe we can't.

Let's take a dummy example and suppose the wic has to include a tar.gz.lzo.

Today we have to add:
    do_image_wic[depends] = '${PN}:do_image_tar'

It's quite easy for a human, but a bit tricky for a machine.
Comment 8 Randy MacLeod 2025-03-06 16:10:42 UTC
Ross to look at this.