Bug 1180882 - perf does not build reproducibly
Summary: perf does not build reproducibly
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Kernel (show other bugs)
Version: Current
Hardware: Other All
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Tony Jones
QA Contact: E-mail List
URL: https://lore.kernel.org/linux-perf-us...
Whiteboard:
Keywords:
Depends on:
Blocks: 1041090
  Show dependency treegraph
 
Reported: 2021-01-13 11:46 UTC by Bernhard Wiedemann
Modified: 2023-03-21 15:19 UTC (History)
2 users (show)

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Wiedemann 2021-01-13 11:46:33 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
Comment 1 Takashi Iwai 2021-01-15 14:08:57 UTC
Something for Tony.
Comment 2 Tony Jones 2021-01-23 00:45:00 UTC
Bernhard,  where can I find info on how to setup a reproducer?
i.e how can I test I've fixed it?
Comment 3 Bernhard Wiedemann 2021-01-23 07:59:49 UTC
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
Comment 4 Bernhard Wiedemann 2021-03-08 06:58:20 UTC
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")
Comment 5 Tony Jones 2021-03-08 14:55:30 UTC
(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
Comment 6 Bernhard Wiedemann 2023-03-20 20:27:09 UTC
I sent a fix upsteam. Thanks Tony for the help.
Comment 7 Tony Jones 2023-03-21 15:19:41 UTC
(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.