[v3,10/17] bitbake: siggen: Split out task depend ID

Submitted by Joshua Watt on Dec. 4, 2018, 3:42 a.m. | Patch ID: 156866

Details

Message ID 20181204034245.25461-11-JPEWhacker@gmail.com
State New
Headers show

Commit Message

Joshua Watt Dec. 4, 2018, 3:42 a.m.
Abstracts the function to get the dependency ID for a task so it can
return something other that the taskhash

[YOCTO #13030]

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 bitbake/lib/bb/siggen.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index ab6df7603c8..2daca70538a 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -41,6 +41,9 @@  class SignatureGenerator(object):
     def finalise(self, fn, d, varient):
         return
 
+    def get_depid(self, task):
+        return self.taskhash[task]
+
     def get_taskhash(self, fn, task, deps, dataCache):
         return "0"
 
@@ -186,7 +189,7 @@  class SignatureGeneratorBasic(SignatureGenerator):
                 continue
             if dep not in self.taskhash:
                 bb.fatal("%s is not in taskhash, caller isn't calling in dependency order?" % dep)
-            data = data + self.taskhash[dep]
+            data = data + self.get_depid(dep)
             self.runtaskdeps[k].append(dep)
 
         if task in dataCache.file_checksums[fn]:
@@ -261,7 +264,7 @@  class SignatureGeneratorBasic(SignatureGenerator):
             data['file_checksum_values'] = [(os.path.basename(f), cs) for f,cs in self.file_checksum_values[k]]
             data['runtaskhashes'] = {}
             for dep in data['runtaskdeps']:
-                data['runtaskhashes'][dep] = self.taskhash[dep]
+                data['runtaskhashes'][dep] = self.get_depid(dep)
             data['taskhash'] = self.taskhash[k]
 
         taint = self.read_taint(fn, task, referencestamp)

Comments

Richard Purdie Dec. 5, 2018, 10:50 p.m.
On Mon, 2018-12-03 at 21:42 -0600, Joshua Watt wrote:
> Abstracts the function to get the dependency ID for a task so it can
> return something other that the taskhash
> 
> [YOCTO #13030]
> 
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
>  bitbake/lib/bb/siggen.py | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
> index ab6df7603c8..2daca70538a 100644
> --- a/bitbake/lib/bb/siggen.py
> +++ b/bitbake/lib/bb/siggen.py
> @@ -41,6 +41,9 @@ class SignatureGenerator(object):
>      def finalise(self, fn, d, varient):
>          return
>  
> +    def get_depid(self, task):
> +        return self.taskhash[task]
> +
>      def get_taskhash(self, fn, task, deps, dataCache):
>          return "0"

I spent a while wondering why we still had "IDs" in the runqueue code
when I thought I'd removed them all. Once I'd gotten over that I
somehow thought this related to the task's dependencies and then how
could it only have one of them?

I therefore suspect calling this "depid" is going to be confusing and
we need a better name for it. I'm wondering about taskresid?
taskresolvid? taskresolvedid? taskreshash?

I appreciate why you're calling it an 'ID', hash may be clearer
thought, not sure...

Cheers,

Richard
Joshua Watt Dec. 6, 2018, 2:58 p.m.
On Wed, 2018-12-05 at 22:50 +0000, Richard Purdie wrote:
> On Mon, 2018-12-03 at 21:42 -0600, Joshua Watt wrote:
> > Abstracts the function to get the dependency ID for a task so it
> > can
> > return something other that the taskhash
> > 
> > [YOCTO #13030]
> > 
> > Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> > ---
> >  bitbake/lib/bb/siggen.py | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
> > index ab6df7603c8..2daca70538a 100644
> > --- a/bitbake/lib/bb/siggen.py
> > +++ b/bitbake/lib/bb/siggen.py
> > @@ -41,6 +41,9 @@ class SignatureGenerator(object):
> >      def finalise(self, fn, d, varient):
> >          return
> >  
> > +    def get_depid(self, task):
> > +        return self.taskhash[task]
> > +
> >      def get_taskhash(self, fn, task, deps, dataCache):
> >          return "0"
> 
> I spent a while wondering why we still had "IDs" in the runqueue code
> when I thought I'd removed them all. Once I'd gotten over that I

I suppose I'm not familiar enough with bitbake's history to have
understood that these "IDs" were problematic in the past :)

> somehow thought this related to the task's dependencies and then how
> could it only have one of them?
> 
> I therefore suspect calling this "depid" is going to be confusing and
> we need a better name for it. I'm wondering about taskresid?
> taskresolvid? taskresolvedid? taskreshash?
> 
> I appreciate why you're calling it an 'ID', hash may be clearer
> thought, not sure...

Ya, I struggled with the naming. There is no reason it has to be a
hash, so I went with a (probably too generic) "ID"... in practice using
a hash is reasonable so I don't have a problem using "hash" in the
name. My runner up names were "dephash" or "taskdephash". I think
indicating that it is involved in the dependency calculations is
important, although I can see how it might be some confusion about
where it is involved. I'm not too keen on the "resolved" names... but
maybe I'm missing where the are stemming from?

Another option if you want to go more of the graph theory approach
might be "taskedgehash", "edgehash", "taskedgeid", "edgeid", etc.

> 
> Cheers,
> 
> Richard
> 
> 
> 
> 
> 
> 
> 
> 
> 
>