Bug 14232

Summary: recipe checksum bypass bug
Product: [Build System, Metadata & Runtime] BitBake Reporter: akuster <akuster808>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: akuster808, dorindabassey, meta.mr.watcher, meta.watcher, poky.bs.watcher, poky.watcher, randy.macleod, weaverjs
Version: 3.3   
Target Milestone: 3.4   
Hardware: x86   
OS: Multiple   
Whiteboard: NEWCOMER
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description akuster 2021-02-10 04:23:06 UTC
I just noticed if I set the SRC_URI hash to and empty string, not error is thrown   and the checks seems to be bypassed.

to reproduced:

SRC_URI[md5sum] = ""

or

SRC_URI[sha256sum] = ""
Comment 1 Randy MacLeod 2021-02-11 16:08:39 UTC
Dorinda, do you want to work on this, check for 'None' and error. Discuss with the list I guess.
Comment 2 Dorinda 2021-02-12 19:33:25 UTC
Yes, I would love to work on this thanks.
I just reproduced this on a recipe, and from what I understood here a check in bitbake __init__.py might suffice, let me think of a solution.
Comment 3 Dorinda 2021-02-19 23:00:51 UTC
Hi All, I noticed that they're some inconsistencies when this variable is set to empty string or commented out in some recipes as such:

SRC_URI[sha256sum] = ""
SRC_URI[md5sum] = ""
or
#SRC_URI[sha256sum] = ""
#SRC_URI[md5sum] = ""

sometimes the expected error message is displayed after running the build, but when i run the build again the error disappears. i don't know what could be causing this inconsistency.
Comment 4 Randy MacLeod 2021-04-22 18:54:02 UTC
Can you list the examples that you are concerned about?
Comment 5 akuster 2021-04-23 01:21:10 UTC
(In reply to comment #4)
> Can you list the examples that you are concerned about?

who is the question for?
Comment 6 Dorinda 2021-04-23 08:00:44 UTC
Okay, I tested this for rsync and elfutils  recipes.
Comment 7 Randy MacLeod 2021-04-23 15:11:25 UTC
The question was for Dorinda about her statement:
   "this variable is set to empty string or commented out in some recipes"
but now I understand that she's saying that if she changes a recipe to have an empty SRC_URI[*sum] then she's getting different results on the first and second run of bitbake. 

Anyway, I think that for the sha256sum at least there are not any recipes where an empty string is valid and that should result in an error.
Comment 8 Scott Weaver 2021-05-24 16:37:39 UTC
Hello, I haven’t contributed before but I saw the newcomers post and thought I would take a look and see if I can give a little back to the project.
If this issue is unresolved and unassigned then I believe I have a solution to it. I know that in previous comments Dorinda was going to look into this and if that’s still the case then I’ll look at the other issues.
Comment 9 Dorinda 2021-05-24 16:41:08 UTC
It's fine, dig-in your contributions will be much appreciated.
Comment 10 Scott Weaver 2021-05-25 12:39:25 UTC
Thanks, Dorinda. I've submitted a patch to the bitbake-devel list.