On Mon, Mar 03, 2025 at 06:23:55PM -0500, Frank Ch. Eigler wrote:
> Hi -
> 
> > [...]
> > Distributions like Yocto update the RPMs but they set all files inside to
> > a fixed timestamp, so that internal timestamp doesn't tell if files
> > changed.
> > [...]
> 
> Can you please elaborate on your explanation?  I'm afraid I can't quite see
> why this yocto behaviour should change anything, or why substituting one
> mtime for another should fix it.

Sure. The yocto distribution prepares hundreds of RPMs/debs/... for the
OS, and they contain the binaries, debug info & srcs. That's ideal for
debuginfod on the whole OS:
https://docs.yoctoproject.org/dev-manual/debugging.html#using-the-debuginfod-server-method

To achieve binary-reproducibility, the build yocto recipes set a fixed
timestamp to all files going into the package archives (rpm, deb...). So
when debuginfod indexes the files in the RPMs it will take the fixed
timestamp.

Every time you rebuild some packages, the package files are rebuilt with the
new contents. When this happens, the new package files will have a newer
mtime, but the files inside the archive (elf, source) will have the same
fixed timestamp as before. And when debuginfod will traverse them (without
the patch I propose), it will not update the database because it will find
consider that the files inside the packages were not modified.

The yocto distribution tries to guess a good "fixed timestamp" based on
multiple sources of information, but only from the source alone.

https://git.yoctoproject.org/poky/plain/meta/lib/oe/reproducible.py

So if there was a source change in a package, it will pick a newer mtime.
But if it was a dependency that was updated (like openssl), that will not
contribute to a newer fixed mtime for the files. That's when debuginfod
will have a completely outdated database fooled by the fixed mtimes
determined by the yocto distribution.

That's the problem I'm facing where, before my patch, the only thing I
could do was to remove the sqlite debuginfod database and index all again
every time I rebuild a package in the yocto distribution, to have
debuginfod serving the new debuginfo correctly.

Regards,
Lluís.

Reply via email to