Repository navigation
Reproducible builds: skip test time report if SOURCE_DATE_EPOCH set - #2970
Conversation
The reproducible builds initiative (https://reproducible-builds.org/) aims for bit-by-bit identical rebuilds. This small patch suppresses the printout of the test time which, even when everything is numerically the same, may differ because of external factors such as machine load.
| // SOURCE_DATE_EPOCH is set by dpkg-buildpackage / the reproducible-builds | ||
| // infrastructure. The elapsed time is not deterministic, so skip the | ||
| // report to keep the packaged test-suite log bit-for-bit reproducible. | ||
| if (std::getenv("SOURCE_DATE_EPOCH") != nullptr) |
There was a problem hiding this comment.
Question: MSVC complains about this function being unsafe. Do we only need this to run on a Linux infrastructure (in which case I'll just skip this couple of lines for MSVC) or should this work with Windows as well (in which case we'll have to push and pop some pragma warning?)
There was a problem hiding this comment.
Yes I think wrapping an #if for an appropriate Linux define / 'not MSVC define' is totally fine.
These reproducible builds are (to me anyway) in a very loose sense another layer of continuous integration and coverage-alike tests: "are we set up in a solid way so that repeated attempts produce identical outcomes". And it fetches leaving build paths behind, or slipping current date / time in (hello swaptions!!). But I do not think anybody does this anywhere but on Linux so excluding Windows seems like a totally fine step to me.
There was a problem hiding this comment.
Test for _WIN32 should do. Do you want to quickly wrap that around?
Or maybe #if defined(__linux__) is cleaner. Can do either.
|
This is interesting too: So maybe b) or c) are attractive? Here c) tells MSVC to not worry, b) uses a stricter form. But as stated, I am fairly certain this is a leeenucks-only thing. |
|
Ok, let's go with your pushed change, thanks. |
The reproducible builds initiative aims for bit-by-bit identical rebuilds. This small patch suppresses the printout of the test time which, even when everything is numerically the same, may differ because of external factors such as machine load.
I have another 'open puzzle' related to this and will send you email about it.