From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: Mateusz Marciniec <mateuszmar2@gmail.com>,
"openembedded-core@lists.openembedded.org"
<openembedded-core@lists.openembedded.org>
Cc: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Subject: RE: [OE-core][PATCH] sstatesig: Improve output hash calculation
Date: Thu, 9 Feb 2023 09:43:50 +0000 [thread overview]
Message-ID: <b1cd5f2506de45a1a3edb6788c280d4e@axis.com> (raw)
In-Reply-To: <20230208235011.40486-1-mateuszmar2@gmail.com>
> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Mateusz Marciniec
> Sent: den 9 februari 2023 00:50
> To: openembedded-core@lists.openembedded.org
> Cc: Mateusz Marciniec <mateuszmar2@gmail.com>; Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
> Subject: [OE-core][PATCH] sstatesig: Improve output hash calculation
>
> From: Mateusz Marciniec <mateuszmar2@gmail.com>
>
> Symbolic links to the files are included during the output hash
> calculation but symlinks to the directories are missed.
> So if the new symlink to a directory was the only change made,
> then the output hash won't change,
> and the Hash Equivalence server may change unihash.
> In the next run bitbake may use an older package from sstate-cache.
>
> To fix this followlinks=True flag could be set for os.walk
> but it can lead to infinite recursion if link points
> to a parent directory of itself.
> Also, all files from a directory to which symlink points
> would be included in depsig file.
> Therefore another solution was applied, I added code that will loop
> through directories and process those that are symlinks.
>
> Signed-off-by: Mateusz Marciniec <mateuszmar2@gmail.com>
> Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
> ---
> meta/lib/oe/sstatesig.py | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
> index f0224454c9..a5bc030f58 100644
> --- a/meta/lib/oe/sstatesig.py
> +++ b/meta/lib/oe/sstatesig.py
> @@ -652,6 +652,11 @@ def OEOuthashBasic(path, sigfile, task, d):
> if f == 'fixmepath':
> continue
> process(os.path.join(root, f))
> +
> + for d in dirs:
Don't use `d` as a local variable for the directory, it is universally
used as reference to the datastore (also in this function as the function
declaration above indicates). Use `dir` instead.
> + if not os.path.islink(os.path.join(root, d)):
> + continue
> + process(os.path.join(root, d))
> finally:
> os.chdir(prev_dir)
>
> --
> 2.39.1
//Peter
prev parent reply other threads:[~2023-02-09 9:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-08 23:50 [OE-core][PATCH] sstatesig: Improve output hash calculation mateuszmar2
2023-02-09 9:43 ` Peter Kjellerstedt [this message]
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=b1cd5f2506de45a1a3edb6788c280d4e@axis.com \
--to=peter.kjellerstedt@axis.com \
--cc=mateuszmar2@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=tomasz.dziendzielski@gmail.com \
/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