Date and time embedded into header file causes problem for reproducible builds in Linux distributions
Closed this issue · 1 comments
lbeltrame commented
Hello,
I'm a volounteer packager for openSUSE and we noticed that there are a few lines that embed date and time when compiling:
std::fprintf(cimg::output()," (%s, %s)\n\n",__DATE__,__TIME__);
This causes the issue of having builds non-reproducible (https://wiki.debian.org/ReproducibleBuilds), because of the embedded timestamp. Notice this issue affects all Linux distributions and every package in said distribution that uses CImg (Krita comes to mind).
CC @boudewijnrempt
dtschump commented
Hello.
So would this be a solution:
#ifndef cimg_date
#define cimg_date __DATE__
#endif
#ifndef cimg_time
#define cimg_time __TIME__
#endif
then using cimg_date
and cimg_time
in the code afterwards.
So, you can set it to whatever you want and still get unique binaries.
This has been done in commit 9fdafcf