Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Hongxu Jia <hongxu.jia@windriver.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 1/3] sstatesig: Only dump incremental locked signatures
Date: Thu, 18 Sep 2014 14:47:47 +0100	[thread overview]
Message-ID: <1411048067.4736.8.camel@ted> (raw)
In-Reply-To: <afb9eb87d6ebebd33c1f6febf8f37111db63a614.1411023982.git.hongxu.jia@windriver.com>

On Thu, 2014-09-18 at 15:23 +0800, Hongxu Jia wrote:
> The idea of incremental sig is:
> 
> New sig file = Old sig file (if available) + New sig items in current build.
> 
> The condition of incremental locked signature dump is an existed locked sig
> file is required and it is also the dump sig file.
> 
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
>  meta/lib/oe/sstatesig.py | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
> index af7617e..56fd953 100644
> --- a/meta/lib/oe/sstatesig.py
> +++ b/meta/lib/oe/sstatesig.py
> @@ -151,19 +151,23 @@ class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash):
>                  types[t] = []
>              types[t].append(k)
>  
> -        with open(sigfile, "w") as f:
> +        with open(sigfile, "a") as f:
>              for t in types:
> -                f.write('SIGGEN_LOCKEDSIGS_%s = "\\\n' % t)
> +                f.write('SIGGEN_LOCKEDSIGS_%s += "\\\n' % t)
>                  types[t].sort()
>                  sortedk = sorted(types[t], key=lambda k: self.lockedpnmap[k.rsplit(".",1)[0]])
>                  for k in sortedk:
>                      fn = k.rsplit(".",1)[0]
> +                    pn = self.lockedpnmap[fn]
>                      task = k.rsplit(".",1)[1]
>                      if k not in self.taskhash:
>                          continue
> -                    f.write("    " + self.lockedpnmap[fn] + ":" + task + ":" + self.taskhash[k] + " \\\n")
> +                    if pn in self.lockedsigs and task in self.lockedsigs[pn] and self.taskhash[k] == self.lockedsigs[pn][task]:
> +                        continue
> +                    sigentry = pn + ":" + task + ":" + self.taskhash[k]
> +                    f.write("    " + sigentry + " \\\n")
>                  f.write('    "\n')
> -            f.write('SIGGEN_LOCKEDSIGS_TYPES_%s = "%s"' % (self.machine, " ".join(types.keys())))
> +            f.write('SIGGEN_LOCKEDSIGS_TYPES_%s += "%s"\n' % (self.machine, " ".join(types.keys())))
>  
>      def checkhashes(self, missed, ret, sq_fn, sq_task, sq_hash, sq_hashfn, d):
>          checklevel = d.getVar("SIGGEN_LOCKEDSIGS_CHECK_LEVEL", True)

I'm afraid I'm starting to feel very strongly this is not a direction we
should move in. Having the ability to write out a .inc file containing
on a delta is one thing, writing out a file for automatic inclusion and
trying to maintain that file is not something I feel comfortable with.

I think that at some point there needs to be external tooling handling
the inclusion and updating of this file and that the sigs code is not
the place for this.

For example, consider the case where you switch machines and want to
share an include file between these machines. With the changes proposed
in this patch series it will simply overwrite the file and remove the
entries for the other machine.

We could keep trying to patch up this code to cover every combination
and eventuality but in the end, I believe the maintenance of this file
should be something external, the sigs code should only be concerned
with the generation of the core entries.

Cheers,

Richard 






  reply	other threads:[~2014-09-18 13:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18  7:23 [PATCH V3 0/3] sstatesig: add support to dump incremental locked signatures Hongxu Jia
2014-09-18  7:23 ` [PATCH 1/3] sstatesig: Only " Hongxu Jia
2014-09-18 13:47   ` Richard Purdie [this message]
2014-09-18 13:56     ` Mark Hatle
2014-09-18 15:10     ` Hongxu Jia
2014-09-18 16:47     ` Hongxu Jia
2014-09-18  7:23 ` [PATCH 2/3] sstatesig: add new item checking for locked signature dump Hongxu Jia
2014-09-18  7:23 ` [PATCH 3/3] sstatesig: fix to support unincremental " Hongxu Jia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1411048067.4736.8.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=hongxu.jia@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox