Bugzilla – Bug 1180882
perf does not build reproducibly
Last modified: 2023-03-21 15:19:41 UTC
While working on reproducible builds for SLE and openSUSE, I found that our perf package differs across builds. /usr/bin/perf differs in ELF section .dynsym /usr/bin/perf differs in ELF section .rela.dyn because nftw in https://github.com/torvalds/linux/blob/v5.3/tools/perf/pmu-events/jevents.c#L1130 reads pmu-events/arch/x86/*/*.json in random filesystem readdir order
Something for Tony.
Bernhard, where can I find info on how to setup a reproducer? i.e how can I test I've fixed it?
It is a bit more complicated here, because the perf package does not contain the sources, but kernel-source does. setup https://github.com/bmwiedemann/reproducibleopensuse/ osc checkout openSUSE:Factory/perf cd $_ mkdir -p deps cp -afl /path/to/fixed/kernel-source.noarch.rpm deps/ oscbuildparams+=" -p deps " rbk alternatively, you have a project in OBS with the fixed kernel-source and do project=home:tonyj repo=openSUSE_Factory rbk
I just noticed that https://git.yoctoproject.org/cgit.cgi/yocto-testresults/plain/oeselftest/testresults.json lists qemux86_64/perf_5.10.16-r9_amd64.deb under known unreproducible, so there is probably wider interest to make its build deterministic. To debug, you can use my devel branch that has in the rebuild script: [[ $rbfilesys = unreproducible ]] && grep -q vm-disk-dirindex /usr/lib/build/build && oscopts+=("--build-opt=--vm-disk-dirindex")
(In reply to Bernhard Wiedemann from comment #4) > I just noticed that > https://git.yoctoproject.org/cgit.cgi/yocto-testresults/plain/oeselftest/ > testresults.json > lists qemux86_64/perf_5.10.16-r9_amd64.deb under known unreproducible, > so there is probably wider interest to make its build deterministic. Ok. I guess it would be useful to see if this is failing for the same reasons as under openSUSE. > To debug, you can use my devel branch that has in the rebuild script: > [[ $rbfilesys = unreproducible ]] && grep -q vm-disk-dirindex > /usr/lib/build/build && oscopts+=("--build-opt=--vm-disk-dirindex") ok, so this is negating: https://github.com/openSUSE/obs-build/pull/634
I sent a fix upsteam. Thanks Tony for the help.
(In reply to Bernhard Wiedemann from comment #6) > I sent a fix upsteam. Thanks Tony for the help. No problem. I see revised version was accepted upstream. Given your comment in slack that this is low pri, I'm not going to check fix into Factory, rather wait for it to appear via kernel-source update. Closing.