bitbake-worker: Add DryRun event
PATCH 1/1 bitbake-worker: Add DryRun event
There may be actions that a user wants to take, but the information is only available during task execution. Using the DryRun event you can prevent the actual task execution, but get access to the associated data stores.
--- bin/bitbake-worker | 2 ++ lib/bb/event.py | 5 +++++ 2 files changed, 7 insertions(+)
bin/bitbake-worker +2 -0
@@ -268,6 +268,8 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, append os._exit(1) try: if dry_run: + localdata = bb.build._task_data(fn, taskname, the_data) + bb.event.fire(bb.event.DryRun(), localdata) return 0 return bb.build.exec_task(fn, taskname, the_data, cfg.profile) except:
lib/bb/event.py +5 -0
@@ -832,3 +832,8 @@ class FindSigInfoResult(Event): def __init__(self, result): Event.__init__(self) self.result = result + +class DryRun(Event): + """ + Event to fire during a dry run + """
Signature · 1 line
2.16.0.rc2
Quoted 32 lines · Mark Hatle
There may be actions that a user wants to take, but the information is only available during task execution. Using the DryRun event you can prevent the actual task execution, but get access to the associated data stores.
Signed-off-by Mark Hatle <[email protected]>--- bin/bitbake-worker | 2 ++ lib/bb/event.py | 5 +++++ 2 files changed, 7 insertions(+)bin/bitbake-worker +0
-0@@ -268,6 +268,8 @@ def fork_off_task(cfg, data, databuilder,workerdata, fn, task, taskname, append
os._exit(1) try: if dry_run:+ localdata = bb.build._task_data(fn, taskname,
the_data)
+bb.event.fire(bb.event.DryRun(), localdata)
return 0
return bb.build.exec_task(fn, taskname,the_data,
cfg.profile)
except:lib/bb/event.py +0
-0
lib/bb/event.py class FindSigInfoResult(Event): · line 839
Quoted 8 lines
lib/bb/event.py +5
-0@@ -832,3 +832,8 @@ class FindSigInfoResult(Event): def __init__(self, result): Event.__init__(self) self.result = result + +class DryRun(Event): + """ + Event to fire during a dry run + """
I think we can add something like this but the DryRun event should really be in build.py and subclass TaskBase, called something like TaskDryRun?
I'm hoping that doesn't upset some of the other code that looks at TaskBase events but its certainly logically where the dryrun event belongs.
We may want to pass dry_run into exec_task as a parameter and put this code at the top of exec_task to make things cleaner across the files?
Cheers,
Richard
Quoted 50 lines · Richard Purdie
Quoted 32 lines · Mark Hatle
There may be actions that a user wants to take, but the information is only available during task execution. Using the DryRun event you can prevent the actual task execution, but get access to the associated data stores.
Signed-off-by Mark Hatle <[email protected]>--- bin/bitbake-worker | 2 ++ lib/bb/event.py | 5 +++++ 2 files changed, 7 insertions(+)bin/bitbake-worker +0
-0@@ -268,6 +268,8 @@ def fork_off_task(cfg, data, databuilder,workerdata, fn, task, taskname, append
os._exit(1) try: if dry_run:+ localdata = bb.build._task_data(fn, taskname,
the_data)
+bb.event.fire(bb.event.DryRun(), localdata)
return 0
return bb.build.exec_task(fn, taskname,the_data,
cfg.profile)
except:lib/bb/event.py +0
-0lib/bb/event.py class FindSigInfoResult(Event): · line 839
Quoted 8 lines
lib/bb/event.py +5
-0@@ -832,3 +832,8 @@ class FindSigInfoResult(Event): def __init__(self, result): Event.__init__(self) self.result = result + +class DryRun(Event): + """ + Event to fire during a dry run + """I think we can add something like this but the DryRun event should really be in
build.pyand subclass TaskBase, called something like TaskDryRun?I'm hoping that doesn't upset some of the other code that looks at TaskBase events but its certainly logically where the dryrun event belongs.
Quoted 7 lines
We may want to pass
dry_runintoexec_taskas a parameter and put this code at the top ofexec_taskto make things cleaner across the files?Cheers,
Richard
Hey Mark,
I was looking at local WR patches that we carry and noticed this one.
Quoted 24 lines · you
Quoted 6 lines · Randy
Isn't this always firing?
It's mostly harmless but it's no longer really a completely dry-run
Quoted 7 lines
if you're logging PR info. Do you think anyone will object or
have you already discussed it with upstream folks?
Why not add a new flag?
If there is no event handler, then firing takes nearly no time at all.. I've
sent the change to bitbake.. We'll see if RP or others have comments.
The change itself though is designed to be generic, in that we want any possible
Quoted 9 lines
event handlers to work through this -- as it could be useful for collecting
statistics and such as well -- without running a build.
--Mark
so do you or Robert still care about this ?
I don't see it mentioned in the WR docs but
now that I think about it, it could be useful in a few use cases. The one that was mentioned in the internal email was:
Quoted 7 lines
Typically populating PR service takes a full build. This is because the
do_packagetask is what actually assigns the PR service values. So we wanta way that will allow us to generate the PR service values in significantly
less time then a full build.. (minutes vs hours)
Signature · 2 lines
# Randy MacLeod # Wind River Linux
A message that is not in the archive (sent off-list or not yet received): [email protected]
Use Mark's current email address.
../Randy
Quoted 126 lines · Randy MacLeod
Quoted 50 lines · Richard Purdie
Quoted 35 lines · Mark Hatle
There may be actions that a user wants to take, but the information is only available during task execution. Using the DryRun event you can prevent the actual task execution, but get access to the associated data stores.
Signed-off-by Mark Hatle <[email protected]>---
bin/bitbake-worker | 2 ++
lib/bb/event.py | 5 +++++2 files changed, 7 insertions(+)bin/bitbake-worker +0
-0@@ -268,6 +268,8 @@ def fork_off_task(cfg, data, databuilder,workerdata, fn, task, taskname, append
os._exit(1)
try:
ifdry_run:
+ localdata =bb.build._task_data(fn, taskname, the_data)
+bb.event.fire(bb.event.DryRun(), localdata)return 0
returnbb.build.exec_task(fn, taskname, the_data, cfg.profile)
except:lib/bb/event.py +0
-0@@ -832,3 +832,8 @@ class FindSigInfoResult(Event):def
__init__(self, result):
Event.__init__(self)
self.result = resultlib/bb/event.py class FindSigInfoResult(Event): · line 839
Quoted 5 lines
lib/bb/event.py +5
-0+ +class DryRun(Event): + """ + Event to fire during a dry run + """I think we can add something like this but the DryRun event should really be in
build.pyand subclass TaskBase, called something like TaskDryRun?I'm hoping that doesn't upset some of the other code that looks at TaskBase events but its certainly logically where the dryrun event belongs.
Quoted 7 lines
We may want to pass
dry_runintoexec_taskas a parameter and put this code at the top ofexec_taskto make things cleaner across the files?Cheers,
Richard
Hey Mark,
I was looking at local WR patches that we carry and noticed this one.
Quoted 24 lines · you
Quoted 6 lines · Randy
Isn't this always firing?
It's mostly harmless but it's no longer really a completely dry-run
Quoted 7 lines
if you're logging PR info. Do you think anyone will object or
have you already discussed it with upstream folks?
Why not add a new flag?
If there is no event handler, then firing takes nearly no time at all.. I've
sent the change to bitbake.. We'll see if RP or others have comments.
The change itself though is designed to be generic, in that we want any possible
Quoted 9 lines
event handlers to work through this -- as it could be useful for collecting
statistics and such as well -- without running a build.
--Mark
so do you or Robert still care about this ?
I don't see it mentioned in the WR docs but
now that I think about it, it could be useful in a few use cases. The one that was mentioned in the internal email was:Quoted 7 lines
Typically populating PR service takes a full build. This is because the
do_packagetask is what actually assigns the PR service values. So we wanta way that will allow us to generate the PR service values in significantly
less time then a full build.. (minutes vs hours)
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#13130): https://lists.openembedded.org/g/bitbake-devel/message/13130
Mute This Topic: https://lists.openembedded.org/mt/72130803/3616765
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 2 lines
# Randy MacLeod # Wind River Linux