Overview: Firstly, there is a snippet of code to split the keyword 'before': https://github.com/openembedded/bitbake/blob/5419a8473d6d4cd1d01537de68ad8d72cf5be0b2/lib/bb/build.py#L952 1. addtask binary_patch after do_unpack before do_deploy_deb This code has no problem, because it is split into ['do_deploy_deb']. 2. addtask binary_patch after do_unpack before do_deploy_deb # this is a comment This code is split into ['do_deploy_deb', '#', 'this', 'is', 'a', 'comment']. Though I think the comment should not be in the split result, fortunately 'do_deploy_deb' is still a valid function what I want. 3. addtask binary_patch after do_unpack before do_deploy_deb# this is a comment Unfortunately, this code is split into ['do_deploy_deb#', 'this', 'is', 'a', 'comment'], where 'do_deploy_deb#' is not the function I want. I think the root cause is due to: https://github.com/openembedded/bitbake/blob/5419a8473d6d4cd1d01537de68ad8d72cf5be0b2/lib/bb/parse/parse_py/BBHandler.py#L25 bitbake use regexp to parse addtask, but does not ignore the comment. Steps to Reproduce: 1. In your recipe, write a line of code like "addtask A after B before C# comment". Please pay attention that there is no space between "C" and "#". 2. Build the target and check the dependencies. Actual Results: No dependency is added between A and C. Expected Results: There is a before dependency between A and C. Build Date & Hardware: Build 2023-10-09 on Debian 11 Additional Information: I don't know the whole procedure of how bitbake parse recipes. - Maybe the bug is due to bitbake having no step to remove all the comments before parsing other syntaxes. - Maybe changing the regular expression is one solution. (Other regular expressions may have the same bug.) - Maybe it is acceptable to just write some hints in the documentation.
Good to fix but you can move the comment around to avoid the error - YP bug board review.
https://git.yoctoproject.org/poky/commit/bitbake?id=5226f46342cae47cb96fafb725dc082ef206f9e8