]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
sstatesig: Improve output hash calculation
authorMateusz Marciniec <mateuszmar2@gmail.com>
Fri, 10 Feb 2023 23:18:34 +0000 (00:18 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 15 Feb 2023 10:20:44 +0000 (10:20 +0000)
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>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/sstatesig.py

index f0224454c939393205ae618b9d46d775a5de42a3..ae7ef14453fda7166825a76b439c2e46cfaa22f3 100644 (file)
@@ -652,6 +652,10 @@ def OEOuthashBasic(path, sigfile, task, d):
                 if f == 'fixmepath':
                     continue
                 process(os.path.join(root, f))
+
+            for dir in dirs:
+                if os.path.islink(os.path.join(root, dir)):
+                    process(os.path.join(root, dir))
     finally:
         os.chdir(prev_dir)