DEBREPRO(1)

πŸ’– NAME πŸ’–

debrepro β€” the reproducibility tester for Debian packages. bestie. it builds ur stuff twice and checks if the vibes match. ✨


🌸 SYNOPSIS 🌸

debrepro [OPTIONS] [SOURCEDIR]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea: debrepro takes a source directory and builds it twice. not the same way twice, obviously β€” that would be pointless and also iconic of u to suggest. no, it builds it twice with a set of variations between the first and the second build, and then it compares the binary packages that came out. 🫢

if diffoscope is installed, it gets used to compare non-matching binaries (because staring at hex diffs manually is giving ✨suffering✨). and if disorderfs is installed, it gets used during the build to inject non-determinism into filesystem listing operations. chaotic? yes. on purpose? also yes. πŸ’…

SOURCEDIR has to be a directory containing an unpacked Debian source package. if u just don't pass SOURCEDIR at all, it assumes the current directory, no biggie. 🌈


πŸŽ€ OUTPUT DIRECTORY πŸŽ€

at the very end of a build, debrepro will tell u where the output directory is, so u can go look at the build artifacts urself. in that directory ur gonna find:

  • $OUTPUTDIR/first β€” the results of the first build, including a copy of the source tree and the resulting binary packages.
  • $OUTPUTDIR/first/build.sh β€” the exact build script that was used in the first build. literally, the receipts. 🧾
  • $OUTPUTDIR/second β€” the results of the second build, including a copy of the source tree and the resulting binary packages.
  • $OUTPUTDIR/second/build.sh β€” the exact build script that was used in the second build.
and listen β€” taking a diff(1) between $OUTPUTDIR/first/build.sh and $OUTPUTDIR/second/build.sh is an excellent way of figuring out exactly what changed between the two builds. like, chef's kiss, do it. πŸ˜­πŸ’–

⭐ SUPPORTED VARIATIONS ⭐

  • user β€” the $USER environment variable will contain different values between the first and second builds.
  • path β€” during the second build, a fake, non-existing directory will be appended to the $PATH environment variable. (yes, fake. yes, non-existing. it's fine. it's the point.) πŸ™ˆ
  • umask β€” the builds will use different umask settings.
  • locale β€” both $LC_ALL and $LANG will be different across the two builds.
  • timezone β€” $TZ will be different across builds.
  • filesystem-ordering β€” if disorderfs is installed, both builds will be done under a disorderfs overlay directory. this will cause filesystem listing operations to be return items in a non-deterministic order. (that's the original wording, bestie, i'm not touching it πŸ’€)
  • time β€” the second build will be executed 213 days, 7 hours and 13 minutes in the future with regards to the current time (using faketime(1)). yes, we're time travelling. yes, that's the exact number. no, i don't know why either. πŸ‘‘

πŸ’… OPTIONS πŸ’…

  • -s VARIATION, --skip VARIATION β€” don't perform the named VARIATION. variation names are the ones used in their description in the SUPPORTED VARIATIONS section, so scroll up if ur lost 🫢
  • -b COMMAND, --before-second-build COMMAND β€” run COMMAND before performing the second build. this is how u, for example, apply a patch to a source tree for the second build and check whether (or how) the resulting binaries are affected. so iconic of u to test that.
  • -B COMMAND, --build-command COMMAND β€” use a custom build command. default: dpkg-buildpackage -b -us -uc.

and lowkey this one is a whole portal: if u specify a custom build command, the restriction of only running against a Debian source tree is relaxed, and u can run debrepro against any source directory. freedom. 🌈

  • -a PATTERN, --artifact-pattern PATTERN β€” define a file glob pattern to determine which artifacts need to be compared across the builds. default: ../*.deb.
  • -n, --no-copy β€” do not copy the source directory to the temporary work directory before each build. use this to run debrepro against the source directory directly. (living dangerously, i respect it πŸ™ˆ)
  • -t TIME, --timeout TIME β€” apply a timeout to all builds. TIME must be a time specification compatible with GNU timeout(1).
  • -h, --help β€” display this help message and exit. classic. legendary. we love her. πŸ’–

examples for --before-second-build, since the original gives them and they eat:

$ debrepro --before-second-build "git checkout branch-with-changes"

$ debrepro --before-second-build "patch -p1 < /path/to/patch"

🌟 EXIT STATUS 🌟

  1. 0 β€” package is reproducible.

and "reproducible" here means that the two builds produced the exactly same binaries, under the set of variations that debrepro tests. important caveat bestie: other sources of non-determinism in builds that are not yet tested might still affect builds in the wild. so like, slay, but stay humble. πŸ’…

  1. 1 β€” package is not reproducible. 😭
  2. 2 β€” the given input is not a valid Debian source package. sir, this is not a source package. πŸ’€
  3. 3 β€” required programs are missing. go install ur friends. 🫢

πŸ‘‘ SEE ALSO πŸ‘‘

diffoscope (1), disorderfs (1), timeout(1)


πŸ“ AUTHOR πŸ“

Antonio Terceiro <terceiro@debian.org>.


and that's the whole page, bestie πŸ’œ this one shipped as part of Debian Utilities, dated 2026-09-21 β€” yes, the date is from the future, we're all very mysterious and cool here βœ¨πŸ’–πŸ¦‹

πŸ“¦ where this page comes from