Bug 11605

Summary: bitbake documentation: "file-checksums" needs to be documented
Product: [Build System, Metadata & Runtime] BitBake Reporter: Patrick Ohly <patrick.ohly>
Component: bitbakeAssignee: Richard Elberger <rich>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: antonin.godard, komal.pal2904, poky.bs.watcher, poky.watcher, randy.macleod, rich
Version: unspecified   
Target Milestone: 5.99   
Hardware: x86   
OS: Multiple   
Whiteboard: NEWCOMER
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Patrick Ohly 2017-06-02 08:28:14 UTC
The "file-checksums" varflag and how to set it using bb.fetch.get_checksum_file_list should get documented. Together they solve the problem of "a task depends on certain files (regardless whether they exist at the moment or not)".
Comment 1 Patrick Ohly 2017-06-02 09:28:46 UTC
bb.fetch.get_checksum_file_list() is specific to SRC_URI. It merely shows the expected content of file-checksums.

I found that I needed an utility method:

fakeroot do_ostree_prepare_rootfs () {
    ...
    ${FLATPAKBASE}/scripts/gpg-keygen.sh ...
    ...
    ${META_REFKIT_CORE_BASE}/scripts/mk-ostree.sh ...
}

def get_file_list(filenames):
    filelist = []
    for filename in filenames:
        filelist.append(filename + ":" + str(os.path.exists(filename)))
    return ' '.join(filelist)

do_ostree_prepare_rootfs[file-checksums] += "${@get_file_list(( \
   '${META_REFKIT_CORE_BASE}/scripts/mk-ostree.sh', \
   '${FLATPAKBASE}/scripts/gpg-keygen.sh', \
))}"

Note that files moving around is covered by the vardep on FLATPAKBASE and META_REFKIT_CORE_BASE in do_ostree_prepare_rootfs.

I'm not sure whether some example like this would be useful for the documentation, and whether get_file_list() should be in bitbake itself (where, under which name?). Suggestions welcome...
Comment 2 Komal Pal 2022-04-18 09:07:00 UTC
Could I get link to some other document according to which I need to document all the things which are mentioned in above example or is there some template for the same?
Comment 3 Richard Elberger 2023-02-22 18:16:34 UTC
Notes:
The varflag [file-checksums] should be documented in section 3.7 of the Bitbake documentation

As inferred by OP the list is derived from bitbake's bb.fetch.get_checksum_file_list which is an internal function. I think that given the current depth of explanations in section 3.7 make inline examples out of scope. However I see the value in it but it needs to be a reproducible example without extensive dependencies.
Comment 4 Richard Elberger 2023-02-26 16:06:10 UTC
Patch has been accepted to docs repository.
Comment 5 Randy MacLeod 2023-10-24 14:24:26 UTC
Bulk move from 4.99 or 0.00 to 5.99
Comment 6 Randy MacLeod 2025-02-20 16:24:13 UTC
Antonin to check if resolved.
Comment 7 Antonin Godard 2025-02-21 19:01:46 UTC
Now documented by commit https://git.yoctoproject.org/poky/commit/?id=d86cbd3d3d9d2565cd29abd5698243781623185e

Moving to Resolved fixed