Skip to content

Makefile: Fix indeterministic sorting order of Git patches

With 3f6d4ca0 (Makefile: Group Git patches by version, 2022-03-31) we have started to collect Git patches we want to apply by using the wildcard function. This has broken compilation downstream though in both CNG and Omnibus, where patches seemingly don't apply correctly anymore.

The root cause of this may be an incompatibility in GNU Make: I'm using GNU Make 4.3 on my system, which is sorting files returned by wildcard 1. Reversely, any systems which use older versions do not sort them, and thus the order in which we apply patches is indeterministic.

This has two consequences:

1. Applying patches may fail altogether because they are dependent
   on one another.

2. With intedeterministic sorting order we may repeatedly rebuild
   the Git versions because our `.version` file changes every time.

Fix this incompatibility by sorting the patches.

Changelog: fixed

Closes omnibus-gitlab#6761 (closed)

Edited by Patrick Steinhardt

Merge request reports