Re: SRC_URI Directory Change


Richard Purdie
 

On Sun, 2021-10-17 at 14:59 -0700, Chuck Wolber wrote:


On Fri, Oct 15, 2021 at 6:58 AM Richard Purdie
<richard.purdie@...> wrote:

I have a bit of a horrible idea to do this in master-next which does solve
the
problem. We probably need a new bitbake selftest testcase before I could
think
about merging it though.

I tested the patch you posted on IRC against bitbake 1.50.0. It seems to work
quite well, but I think I found two minor bugs in it. I pasted an updated
patch below.

In a nutshell...

If you have a SRC_URI file:// entry that ends in a "/", then you get a "."
that is
not enclosed in "/./" when running the checksum_dir method, which causes
checksum_file to throw warnings that look like this:

WARNING: Unable to get checksum for gettext-minimal-native SRC_URI entry
.intlmacosx.m4: [Errno 2] No such file or directory: '/mnt/openembedded-
core/meta/recipes-core/gettext/gettext-minimal-0.21/aclocal/.intlmacosx.m4'

I think the simplest fix is to add a "pth = pth.rstrip("/")" in the
checksum_dir method after
the guard statement. But then that exposes a different issue in the patch.

For recipes that trigger the above warning, the rstrip() fix fixes the
warning, but then you
expose a new problem in siggen.py calc_taskhash().

In your patched version, the check for the "/" fails to include the filename
in the hash calculation
for files at the root of a SRC_URI entry (there is no "/" to be found). This
results in a task hash
mismatch error on the first build, but not on subsequent builds for fairly
obvious reasons.

I solved this by adding a third field to the tuple with a True/False value,
which is a much more reliable semaphore (IMHO).

I tested these fixes and it worked perfectly. Here is an updated version of
your patch that takes into
 account the fixes I described. I can produce a "patch against your patch" if
these fixes are
considered correct and do not cause even bigger problems that are not obvious
to me.


..Ch:W..

P.S. The gettext-minimal-native_0.21.bb (from OEC) is a very good example of
something that triggers this behavior. But I found plenty of others as well.
Thanks, I got around to looking at this again. For the first issue I agree the
rstrip is the best option. For the second, I don't really want to change the on
disk signature formats since that will break the tools and have compatibility
issues. I've therefore tweaked the patch slightly differently in the v2 I've
sent out.

Hopefully this one gives us a version that can be merged.

Cheers,

Richard

Join yocto@lists.yoctoproject.org to automatically receive all group messages.