Preface: We have a complex build process and discovered it's working on one system and failing on another (unfortunally/Murphy it worked on the Jenkins build server, so the problem remained undiscovered for long). The error source turned out to be the order in which hard-linked files were put into a
tar file by some external component:
b were hard-linked and
tarred, while later, on extracting the tar file, only
a was extracted. Of course, when
a was the first to be archived, it worked, but if
b was the first in the tar, the typical
Cannot hard link error shows up.
Of course, we could
tar cf with
--hard-dereference, but this means changing a script in an external tool (which is to be avoided), so my question is different:
Question: Our basic goal is to have a reproducable result, independent of the system. Currently, the
tarring order is reproducable on one system, but can be randomly different on another system. Can we force a file order for
tar without giving options to
tar or splitting the
tar call into several calls?
The systems are all linux right now, but could as well be FreeBSD or MacOS some time.