Context

GNU Make now has a --shuffle option that simulates non-deterministic ordering of target prerequisites. See https://trofi.github.io/posts/238-new-make-shuffle-mode.html, and also previous work in Debian by Santiago Vila.

While make always processes prerequisites left-to-right when running sequentially, prerequisites can be evaluated in an arbitrary order when building in parallel (make -j). This option is thus useful to trigger and debug issues that occur when building in parallel.

The --shuffle option can take an optional parameter: --shuffle=reverse evaluates prerequisites in reverse order (which is useful when testing packages and reproducing failures); --shuffle=random (the default) uses a random order, that can later be forced using --shuffle=<seed>.

Mass bug filing

How to debug issues

GNUMAKEFLAGS='--shuffle --trace' dpkg-buildpackage

GNUMAKEFLAGS='--shuffle=reverse --trace' dpkg-buildpackage
GNUMAKEFLAGS='--shuffle=1847628928 --trace' dpkg-buildpackage

Note that --shuffle is passed to downstream make instances (through the MAKEFLAGS environment variables). It thus detects both bugs in debian/rules and in upstream Makefiles.

Example bugs with patches

Known issues

Some packages use bmake (BSD make), that is incompatible with setting GNUMAKEFLAGS to --shuffle. What happens is that GNU Make sets MAKEFLAGS to --shuffle, which bmake does not understand. Affected packages are:

bsdowl csh herisvm libmaa libnbcompat lowdown makefs mk-configure paexec runawk udfclient xidle