Message ID | 20240905155909.1595157-1-richard.purdie@linuxfoundation.org |
---|---|
State | Accepted, archived |
Commit | 83acc21cdfdb410082c0871ac7693d29a7c5627d |
Headers | show |
Series | siggen: Fix rare file-checksum hash issue | expand |
> -----Original Message----- > From: bitbake-devel@lists.openembedded.org <bitbake- > devel@lists.openembedded.org> On Behalf Of Richard Purdie > Sent: den 5 september 2024 17:59 > To: bitbake-devel@lists.openembedded.org > Subject: [bitbake-devel] [PATCH] siggen: Fix rare file-checksum hash issue > > There is a subtle issue with full pathnames being included in the > file checksums since the sorting might be different depending upon > how layers are being setup causing hash mismatches for recipes appeneded > from other layers with differing directory layouts. > > Avoid this by filtering out to the path basename which is what is written > into the sig data anyway later in the code. > > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> > --- > lib/bb/siggen.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py > index 8f24535528..a6163b55ea 100644 > --- a/lib/bb/siggen.py > +++ b/lib/bb/siggen.py > @@ -878,7 +878,7 @@ def clean_checksum_file_path(file_checksum_tuple): > f, cs = file_checksum_tuple > if "/./" in f: > return "./" + f.split("/./")[1] Wouldn't it make sense to remove the if-statement above then too? > - return f > + return os.path.basename(f) > > def dump_this_task(outfile, d): > import bb.parse //Peter
On Thu, Sep 5, 2024 at 10:58 AM Peter Kjellerstedt via lists.openembedded.org <peter.kjellerstedt=axis.com@lists.openembedded.org> wrote: > > > > -----Original Message----- > > From: bitbake-devel@lists.openembedded.org <bitbake- > > devel@lists.openembedded.org> On Behalf Of Richard Purdie > > Sent: den 5 september 2024 17:59 > > To: bitbake-devel@lists.openembedded.org > > Subject: [bitbake-devel] [PATCH] siggen: Fix rare file-checksum hash > issue > > > > There is a subtle issue with full pathnames being included in the > > file checksums since the sorting might be different depending upon > > how layers are being setup causing hash mismatches for recipes appeneded > > from other layers with differing directory layouts. > > > > Avoid this by filtering out to the path basename which is what is written > > into the sig data anyway later in the code. > > > > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> > > --- > > lib/bb/siggen.py | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py > > index 8f24535528..a6163b55ea 100644 > > --- a/lib/bb/siggen.py > > +++ b/lib/bb/siggen.py > > @@ -878,7 +878,7 @@ def clean_checksum_file_path(file_checksum_tuple): > > f, cs = file_checksum_tuple > > if "/./" in f: > > return "./" + f.split("/./")[1] > > Wouldn't it make sense to remove the if-statement above then too? > I believe that would break the ability to detect changes to in-tree code. Refer to the following two commits for background: https://git.openembedded.org/bitbake/commit/?id=b4975d2ecf615ac4c240808fbc5a3f879a93846b https://git.openembedded.org/bitbake/commit/?id=5293a1b36eeb89f57577cb709ec7f293909039a1 ..Ch:W..
diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py index 8f24535528..a6163b55ea 100644 --- a/lib/bb/siggen.py +++ b/lib/bb/siggen.py @@ -878,7 +878,7 @@ def clean_checksum_file_path(file_checksum_tuple): f, cs = file_checksum_tuple if "/./" in f: return "./" + f.split("/./")[1] - return f + return os.path.basename(f) def dump_this_task(outfile, d): import bb.parse
There is a subtle issue with full pathnames being included in the file checksums since the sorting might be different depending upon how layers are being setup causing hash mismatches for recipes appeneded from other layers with differing directory layouts. Avoid this by filtering out to the path basename which is what is written into the sig data anyway later in the code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> --- lib/bb/siggen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)