18:08:04 #startmeeting 18:08:04 Meeting started Mon Nov 16 18:08:04 2020 UTC. The chair is vagrantc. Information about MeetBot at http://wiki.debian.org/MeetBot. 18:08:04 Useful Commands: #action #agreed #help #info #idea #link #topic. 18:08:39 #link https://pad.sfconservancy.org/p/reproducible-builds-debugging 18:08:50 #topic who is here? 18:08:58 * vagrantc = Vagrant Cascadian 18:09:07 * bmwiedemann = Bernhard M. Wiedemann 18:10:43 anyone else? Foxboron? anthraxx? 18:12:14 Ohno, I forgot about the meeting! Yes I am :( 18:12:18 i failed to do any reminder emails and whatnot ... 18:12:19 :)* 18:12:21 yay 18:13:22 #topic agenda on the fly 18:14:02 i could probably walk through my typical steps when debugging reproducibility for a package 18:14:24 it would be interesting to do for each distro, maybe? 18:14:50 I guess, the general steps of find, debug, fix, submit are the same? 18:15:08 Im actually curious about your tooling these days. Especially for distribution packages 18:15:56 bmwiedemann: in general, sure 18:17:38 vagrantc: so please tell us about the details 18:19:30 ok, i'll talk about debian for a bit 18:19:40 #debugging Debian packages 18:19:44 er, 18:19:48 #topic debugging Debian packages 18:20:44 so, first thing i do is use https://tests.reproducible-builds.org/debian/PACKAGE 18:21:08 to see if there is useful build information from the test infrastructure :) 18:21:34 sometimes i'll see something that only fails on 32-bit architectures, sometimes only on arm* or x86* 18:22:51 how much do you look through the diffoscope output? 18:22:57 on a good day, it may even come with some diffoscope output 18:23:10 i definitely scroll through it. 18:23:33 i'll also look at the differences between unstable and bullseye (our current testing suite) 18:24:10 because one varies build-path and the other doesnt 18:24:22 or because of toolchain patches? 18:24:23 since we do more variations in unstable and experimental (e.g. build path, and fixfilepath a.k.a. -ffile-prefix-map) 18:25:28 i like to target non-build-path variations first, especially if i can get rid of all of those in the packages, then the diff becomes smaller eventually :) 18:26:40 locally, i mostly use reprotest to compare results, which has an --auto-build feature that seems similar to your autoclassify on opensuse 18:27:52 so it tells you which variations matter? 18:27:53 let's see if i can dig up an example 18:28:33 bmwiedemann: it uses keywords instead of a bitmask, and also can run diffoscope on each resulting combination 18:29:02 reprotest --auto-build --store-dir=$(mktemp -d) --min-cpus=10 --vary=-user_group,-domain_host,-fileordering auto -- null 18:29:41 i disable some of the variations that require more privledges to set up, which means it cannot tests those variations, of course 18:30:02 but for most things, i already know from tests.r-b.org weather i'm looking for one of those issues 18:30:50 and if so, i can use sbuild to build as a different user, a virtual machine to change the hostname, etc. 18:31:31 reprotest currently supports varying: +environment, +build_path, +kernel, +aslr, +num_cpus, +time, +user_group, +fileordering, +do- main_host, +home, +locales, +exec_path, +timezone, +umask 18:32:08 so reprotest would return and say results did not differ in such a case, when you did not vary the relevant bits? 18:32:38 with --auto-build it will tell you which of the variations matched a control build 18:33:10 so it basically does a control build, and then does a build normalizing everything it can to see if it can be made reproducible 18:33:44 e.g. comparing the default build, and then a normalized build against that to see if it is reproducible ... and then proceeds to test each individual variation 18:34:03 it might also do a build with all the requested variations 18:34:49 i use --store-dir to be able to look at all the various diffoscope outputs for each variation 18:34:58 When looking at the CI and using reprotest, are you hitting repro issues you'd have if you only tried rebuilding the package according to the buildinfo file? 18:36:19 Foxboron: haven't done much in the way of verification builds 18:36:50 Foxboron: h01ger has done a bit more of that sort of thing with the attempt at rebuilders 18:37:14 but mostly i'm just looking at and for issues and then submitting patches 18:37:52 i.e. reproducing the issue locally, not necessarily the artifacts 18:38:04 and then reproducing builds locally 18:39:24 i'm not sure there's much else to my workflow, beyond the specifics of filing bugs ... i usually don't submit upstream, but to the debian bug tracker ... so i can have all my bugs in a consistent interface ... and hope that the debian maintainers for the package forward them upstream 18:40:31 oh, i also look to see if the issue is fixed upstream, since very amazing people such as bmwiedemann *do* usually file upstream and sometimes i can just ask the debian package maintainer to include the upstream patch 18:41:04 :D <3 18:41:49 the rest is just basic debugging ... patch, rebuild, see the results, rinse, wash, repeat :) 18:41:56 sometimes I also hit an issue and look at the Debian package for the relevant patch and test+upstream that 18:42:27 bmwiedemann: i just saw yesterday a patch of mine you helpfully forwarded upstream :) 18:43:40 anyone want to spell out their workflow from some other distro? 18:43:47 only works well, if there is an openSUSE package 18:44:23 oh, let me throw a few links in for the bot 18:44:38 #link https://tests.reproducible-builds.org/debian/PACKAGE 18:45:02 #link https://tracker.debian.org/reprotest 18:45:45 #info reprotest --auto-build --store-dir=$(mktemp -d) --min-cpus=10 --vary=-user_group,-domain_host,-fileordering auto -- null 18:45:47 I can quickly take the Arch stuff :) 18:45:51 #link https://wiki.debian.org/ReproducibleBuilds/Howto 18:46:20 bmwiedemann: really need to update that page ... a lot of the links should be moved to reproducible-builds.org/docs 18:46:27 but yeah 18:46:40 #topic debugging Archlinux packages 18:46:46 Foxboron: you have the stage :) 18:47:48 Yas! 18:48:08 * vagrantc hopes Archlinux is appropriately spelled/cased 18:48:13 Our packages have no bugs 18:48:15 So when I started to contribute back in 2017 things where sorta similar to vagrantc. Look at CI, figure out the difference, patch and see if it works. 18:48:19 vagrantc: Arch Linux :D 18:48:23 or archlinux, but never Archlinux 18:48:24 doh. 18:48:33 #topic debugging Arch Linux 18:48:43 These days however we don't rely on the CI as much. We use the lovely rebuilderd kpcyrd wrote for us! 18:48:50 #link https://reproducible.archlinux.org/ 18:49:07 This utilizes archlinux-repro which does verification builds towards distributed packages. 18:49:12 #link https://github.com/archlinux/archlinux-repro/blob/master/docs/repro.8.txt 18:49:51 this allows us to always recreate the results we see from rebuilderd, then we can build a new package, patch it, and see if we can reproduce. All using the same consistent tooling. 18:50:23 The downside is that we don't have reprotest so any upstream reproducability issues isn't neccesarily found as when you use the CI system. But it gives us an advantage that we can always do 1:1 builds from what we see 18:50:50 Now rebuilderd also has log output, so it's easier to have a starting point on the issues, and see what needs to be done. 18:50:52 #link https://reproducible.archlinux.org/api/v0/builds/74/diffoscope 18:50:56 #link https://reproducible.archlinux.org/api/v0/builds/74/log 18:51:17 We also have the reprobuilds wiki page that sorta introduces all this, but it's not super well structured :/ 18:51:18 #link https://wiki.archlinux.org/index.php/Reproducible_Builds/Status 18:51:25 noo, 18:51:27 #link https://wiki.archlinux.org/index.php/Reproducible_Builds#Helping_out 18:51:28 that one! 18:51:56 So yeah, we have quite a nice workflow (i'd say) with repro and rebuilderd. But we also avoid the tricky issues as we only done one architecture when building 18:53:13 A short link spam, but I hope that grouped up the stuff nicely :) 18:53:53 so how do you find out what causes the variations in the output? e.g. date vs hostname vs readdir-order? 18:54:03 i guess in theory you could add a mode to ... repro ... to do reprotest-like things 18:54:28 vagrantc: We sorta decided to keep it seperate. repro also does verification while if we need to have a difference between the build envs one should use reprotest 18:54:53 bmwiedemann: So it depends a little bit. We have had issues where the repro/rebuilderd tooling is complicated enough to introduce issues. 18:55:27 So sometimes you don't know if you are looking at a reproducability issue, or a tooling issue. This requires some "clever" hacks where we jump into the container and mess around :p it's not super straight forward. 18:55:47 Foxboron: makes sense ... though i was curious for some of the systemd-nspawn integration if it would be feasible to re-use the code to spawn a reprotest environment 18:55:48 As for figuring out the issues it's mostly the same. Git clone the project, try write a patch, then apply it on the package and run repro 18:56:03 vagrantc: I think so, but I havne't really investigated 18:56:32 for "write a patch" you need a clue what to look for, though. 18:57:22 It's educated guessing :p Some stuff we have tried document. Like "PYC issues, look at PYTHONHASHSEED". But we haven't been good at that. 18:57:24 I sometimes apply as many fixes as I can think of and then drop them one by one as long as it remains reproducible. 18:57:31 sometimes my patches are just turning debugging up to the MAX :) 18:57:34 haha 18:57:54 I wanted to try include some container breakpoint into repro so you can go into the env, and build by hand to figure out any issues 18:58:02 include git, then you can git commit stuff and get out patches :p 18:58:20 But it would need some more work I think 18:58:41 Say you can step into the build process and flick switches. let it continue and see what happened. 18:58:44 I think, your workflow could profit from something like autoclassify 18:59:10 bmwiedemann: as in the concept? 19:00:07 basically performing a build while varying one thing at a time ... so you know weather it's a build path, timestamp, timezone, locale, etc. 19:00:11 something that reduces certain variations to find out if they matter. e.g. setarch -R to disable ASLR and if it becomes reproducible, that narrows down the class of issues to look for 19:00:15 Off topic has anyone checked out the new time namespace in Linux containers 19:00:34 have not, sounds tasty 19:01:15 so, we're a bit over time ... do we want to wrap up? 19:01:38 bmwiedemann: Hmm, I like it. Since we use BUILDINFO to reproduce we a slightly more limited set of issues (i think) 19:01:38 I'm using kvm -rtc base=$later 19:01:42 i mean, i'm fine with continuing on 19:01:43 (given the tooling works) 19:02:22 Yeah we have, kernel, time, file order hmmm 19:03:26 I'm fine continuing 19:03:38 Anyone ever tried to classify based on diffoscope output 19:04:07 jelle: I sometimes grep diffs for certain patterns, so I can fix multiple similar issues 19:04:09 jelle: it struck me when bmwiedemann mentioned it :) 19:04:12 Foxboron: thanks for sharing about Arch Linux :) 19:04:19 #topic miscelaneous tips and tricks 19:04:21 vagrantc: nps :D I hope it gave some insight 19:04:33 bmwiedemann: or did you want to present? 19:05:07 I think, my writeup (linked in the etherpad) is already very comprehensive 19:05:28 jelle: i had actually thought about finding some university students who needed a project to work on to do classification based on diffoscope output 19:05:39 though some shorthands like 'rbkt' for "rebuild with kvm+tweaks" are not so obvious 19:05:43 vagrantc: I like it 19:05:59 #link https://github.com/bmwiedemann/reproducibleopensuse/blob/devel/howtodebug 19:06:08 vagrantc: Might be a nice GSoC project 19:06:10 vagrantc: although if building is cheap that can be done as well :) 19:06:16 Oh yeah! 19:06:31 bmwiedemann: ah yes, if you can spell out some of those notations, that would be great :) 19:07:15 Foxboron: indeed 19:08:36 vagrantc: I vaguely remember we once had research of chinese researchers in our weekly reports that used heuristics to detect+fix rb-issues 19:09:07 bmwiedemann: Debian's i386 builds do one build with a 686-pae kernel and one with an amd64 kernel, without using linux32 to set the personality ... finds some bugs that way ... 19:09:24 bmwiedemann: it rings some bells 19:09:46 faintly 19:10:04 in #167 19:10:59 so maybe we could try to apply that first 19:15:17 vagrantc: the 'noarch' test I meant was different - If you build something that is not arch-specific like docs, and do it once on i386 and x86_64 - it should still produce the same docs 19:17:00 bmwiedemann: ah, yes! we do build arch:all packages on all the architectures we test, amd64, i386, arm64, armhf ... but do not do any comparison of the results 19:17:12 at least, not automatically ... i've done it manually here and there 19:17:25 i would like to do such a test 19:18:21 #link https://blog.acolyer.org/2018/06/22/automated-localization-for-unreproducible-builds/ 19:18:44 wow, why do we not have that integrated already? 19:18:46 :) 19:22:18 integration can be hard 19:23:54 do we want to end for today? 19:25:03 we can end the "meeting" and carry on like always :) 19:25:18 oh, i had another quick point on guix i'll dump in the notes 19:25:24 #topic debugging guix 19:25:35 #info guix challenge PACKAGE 19:26:12 #info guix build --keep-failed --no-grafts --check --rounds=2 PACKAGE 19:26:18 #topic thanks all 19:26:22 thanks everyone! 19:26:28 #endmeeting