Bug 4877 - 'bitbake -C' does not throw error for invalid task
Summary: 'bitbake -C' does not throw error for invalid task
Status: VERIFIED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 1.5
Hardware: x86 Multiple
: Low normal
Target Milestone: 1.5
Assignee: Petter
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-07-19 11:01 UTC by Stoicescu Cornel
Modified: 2013-10-01 14:23 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
cooker log (2.29 KB, application/octet-stream)
2013-07-19 11:01 UTC, Stoicescu Cornel
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stoicescu Cornel 2013-07-19 11:01:54 UTC
Created attachment 1340 [details]
cooker log

Poky configuration:

Build Configuration:
BB_VERSION        = "1.19.1"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-12.04"
TARGET_SYS        = "x86_64-poky-linux"
MACHINE           = "qemux86-64"
DISTRO            = "poky"
DISTRO_VERSION    = "1.4+snapshot-20130719"
TUNE_FEATURES     = "m64"
TARGET_FPU        = ""
meta
meta-yocto
meta-yocto-bsp    = "master:31e6eee860b5f9f4ac9ef0889bcff5648de6e3f9"

Steps to reproduce:

"
lserban@computer1:~/work/poky/build$ bitbake man

lserban@computer1:~/work/poky/build$ bitbake -C invalid_task man

NOTE: Resolving any missing task queue dependencies
NOTE: Preparing runqueue
NOTE: Tainting hash to force rebuild of task /home/lserban/work/poky/meta/recipes-extended/man/man_1.6g.bb, do_invalid_task
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 782 tasks of which 782 didn't need to be rerun and all succeeded.

lserban@computer1:~/work/poky/build$ bitbake -cclean man

lserban@computer1:~/work/poky/build$ bitbake -C invalid_task man

NOTE: Resolving any missing task queue dependencies
NOTE: Preparing runqueue
NOTE: Tainting hash to force rebuild of task /home/lserban/work/poky/meta/recipes-extended/man/man_1.6g.bb, do_invalid_task
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 782 tasks of which 780 didn't need to be rerun and all succeeded.
"


See attached the cooker log for the last command. Even though the task does not exist, the man package is built.

EXPECTED OUTCOME: Error should be presented for invalid task.
Comment 1 Petter 2013-07-23 21:54:52 UTC
I might be wrong, but I don't think this is a fault (perhapes It could be a warning or note). I think it's supposed to work like this. If for example 'bitbake -c invalid_task man' was successful (and no addtask for do_invalid_task exists..), it should have been a fault.

But when giving bitbake '-C' it will only remove a stamp file and if the stamp file don't exists nothing bad happens except that no task has a dependency to 'invalid_task' so nothing needs to be rebuild.. So except if you specify that a task is 'nostamp', I think it's OK that no error occurs.

For example do_listtasks (when it should be a fault)
$ bitbake -C listtasks man
...
ERROR: Task do_listtasks is marked nostamp, cannot invalidate this task

Perhapes a notification could be added e.g. "this task don't exist, so it will not have any effect".

Comments about this?
Comment 2 Stoicescu Cornel 2013-07-24 08:02:29 UTC
A notification sounds good to me as long as the user understands why it's not an error or a warning from it.
Comment 3 Petter 2013-07-24 08:58:00 UTC
(In reply to comment #2)
> A notification sounds good to me as long as the user understands why it's
> not an error or a warning from it.

After some thoughts I think a warning is more correct after all. Maybe something like:

----

NOTE: Preparing runqueue
WARNING: Task do_invalid_task does not exist, invalidate this ta
sk will have no effect
NOTE: Tainting hash to force rebuild of task...
...

----
Comment 4 Petter 2013-07-24 10:11:51 UTC
Change to accepted since this is clearly a bug. Even if error might be a little bit to hard, at least a warning or note should be displayed to the user.
Comment 5 Petter 2013-07-24 10:20:36 UTC
Started with a solution that adds a check in 'bitbake/lib/bb/runqueue.py' and displays a warning if the task does not exists for the target/recipe.

Suggestion (as in my previous comment).

----

NOTE: Preparing runqueue
WARNING: Task do_invalid_task does not exist, invalidate this ta
sk will have no effect
NOTE: Tainting hash to force rebuild of task...
...

----
Comment 6 Petter 2013-07-29 09:26:38 UTC
Send for review:

The following changes since commit 67864ca79da08df752487a3a4e1a975546da123d:

  systemd: Remove systemd_unitdir if systemd is not in distro features (2013-07-24 11:35:39 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib petmab/bug/4877
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=petmab/bug/4877
Comment 8 Stoicescu Cornel 2013-10-01 14:23:04 UTC
When issuing the command in step 2) from description, the user receives a coherent warning message:
WARNING: Task do_invalid_task does not exist, invalidating this task will have no effect

Setting to VERIFIED for:
poky master:2f64fae60b3f61a2c45dc9e5314d2d16b1e64605