Bug 1245

Summary: BitBake proceeds unhindered when unrecognised commands are called
Product: [Build System, Metadata & Runtime] BitBake Reporter: Joshua Lock - Disabled <josh>
Component: bitbakeAssignee: Constantin Musca <constantinx.musca>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: alexandru.damian, belen.barros.pena, jessica.zhang, poky.bs.watcher, poky.watcher
Version: unspecified   
Target Milestone: 1.3   
Hardware: x86   
OS: Multiple   
Whiteboard: 8202e49c5fa03822adf3a4d75bc87d33b23a7f65;8d019a77d7c6ded1cff66094bfb9effa38c75c98
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Joshua Lock - Disabled 2011-07-15 10:50:43 UTC
When I'd done a bad job of merging some changes across branches I had some code calling a command that didn't exist. BitBake should probably complain loudly, when this happens.
Comment 1 Joshua Lock - Disabled 2011-07-19 15:20:27 UTC
It turns out that this isn't entirely 'silent'. The runCommand method of the command module returns a "No such command" string if the command is not recognised, or True if the command is run.

Not sure if the best approach is to change the runCommand method to return False if the command isn't run/available and wrap all calls to runCommand.
Perhaps easiest will be to create a runCommand wrapper for hob which checks to ensure the return value isn't "No such command" or "Busy "...
Comment 2 Joshua Lock - Disabled 2011-12-13 14:27:53 UTC
As this is a P3 issue I'm pushing it out to M4
Comment 3 Jessica 2011-12-20 11:35:12 UTC
RP thought he can get it fixed earlier and would like to assign to him
Comment 4 Richard Purdie 2012-01-26 12:26:22 UTC
Looking at the code, you should be checking the return value of runCommand with something like:

err = runCommand(x)
if err != True:
    bb.fatal("runCommand failed!")

Since Joshua isn't working on hob now and I'm not familar with the v2 codebase  I'm reassigning to Shane. 

Shane: Can you find someone working on hobv2 to ensure the new code has error handling checks in place?
Comment 5 Belen Barros Pena 2012-05-28 11:07:19 UTC
Will this display an error in Hob? If yes, how can users recover from this error: eg. ignore the bad command and continue, stop the build, restart Hob, etc? 

Belen
Comment 6 Jessica 2012-08-16 14:46:28 UTC
Please audit the command that HOB is using
Comment 7 Constantin Musca 2012-10-01 12:52:24 UTC
Should I throw a Hob exception in hobeventhandler.py if runCommand returns "Busy..." or "No such command"? Is this the desired behavior? I didn't discovered any errors using this validation. This needs to be tested more because it might uncover bugs.
Comment 8 Constantin Musca 2012-10-04 13:33:32 UTC
Bug fixed.
Comment 9 Belen Barros Pena 2012-10-04 15:22:15 UTC
Hi Constantin,

This bug was filed by Joshua, who is no longer working with us. I can test the fix, but I would need a test case. Do you have one I could use?

Thanks!
Comment 10 Belen Barros Pena 2012-10-31 14:18:04 UTC
Hi Constantin,

Last time we spoke we agreed on some changes to the message Hob gives you when an unrecognised command is called. I believe the final text was: "$command_line has failed with output $output. We recommend that you restart Hob".

Any luck with implementing the changes? 

Also, if you could tell me again the test case, that would be really helpful. I remember I slightly modified one Hob file, but can't remember which one :(

Thanks!

Belen
Comment 11 Belen Barros Pena 2012-10-31 14:18:50 UTC
Reopening to find out if the agreed changed have been implemented.
Comment 12 Constantin Musca 2012-10-31 14:41:15 UTC
(In reply to comment #11)
> Reopening to find out if the agreed changed have been implemented.

The changes have been implemented in 8d019a77d7c6ded1cff66094bfb9effa38c75c98.

Constantin
Comment 13 Belen Barros Pena 2012-10-31 14:49:29 UTC
Thanks! Any chance you could remind me of the test case? We changed one letter of a command in a Hob file, but I can't remember which file, which line or which command :(
Comment 14 Belen Barros Pena 2012-10-31 16:46:17 UTC
verified on e9e3285e1397cfd2d34f4eb7b5aa59311eea861d

To test this bug, you can do the following:

1. Open the following file in a text editor: 
./bitbake/lib/bb/ui/crumbs/hobeventhandler.py

2. Go to line 139

3. Change self.runCommand(["findConfigFilePath", "bblayers.conf"]) to self.runCommand(["findConfigFilePathx", "bblayers.conf"])

4. Run Hob