1

Is there a way to run bitbake task with python command line options ? Example: I have debug in the code, and the debug is always True, is there a way to pass an python option like python -O when executing bitbake task.

python do_some_task(){
    if __debug__:
        print("...")
    ...
  }
addtask do_some_task

I'm running my task's in the following way:

bitbake -c some_task ...
Željko
  • 21
  • 4

1 Answers1

0

No. Python tasks are eval/exec by the worker directly, not by spawning a new instance of python.

For debugging can't you just use bb.debug() and read the task logs, which is where debug output goes?

Ross Burton
  • 3,516
  • 13
  • 12
  • I don't want just to log some info, I won't to skip a pice of code that does a commit to the SVN. So when other guys do testing on the code, they can pass in a parameter (or something) and eg. add list will be logged and commit won't be done. The other solution, would be to make separate dbg. functions/tasks. – Željko Jan 24 '18 at 09:04
  • Use a variable you set in local.conf. ie DEBUG_MYSTUFF="1" in local.conf and then skip if d.getVar("DEBUG_MYSTUFF")=="1". – Ross Burton Jan 25 '18 at 13:16
  • I use the same thing, only whit the True and False. I was hoping to get a solution with parameter from the terminal when calling the task. – Željko Jan 26 '18 at 09:09