file(ARCHIVE_CREATE): doesn't obey mtime
While compiling Qt and trying to reduce nondeterminism between builds, I've noticed a pain point is a gzip blob which is generated by cmake and then bin2c'd into a C++ file. The related cmake code can be seen here: https://github.com/qt/qtbase/blob/fb0c7a9956824fbc3e3a3ab70cf7e2e5a622e85d/src/corelib/CMakeLists.txt#L1237
In my case, ARCHIVE_CREATE
winds up getting called with FORMAT raw COMPRESSION GZip COMPRESSION_LEVEL 9
. The result is that the first 10 bytes of the output are a gzip header, 4bytes of which contain a dynamic filetime. I've tried setting MTIME
on the ARCHIVE_CREATE
to a constant value, as well as using FORMAT gnutar
, but neither resulted in the header bytes being a constant value. This seems to go against how I'm reading the documentation, and even if not, seems like it should be a feature :)
I'm using cmake version 3.22.22022201-MSVC_2