7 ms·
Generally, yes: https://reproducible-builds.org/docs/timestamps/ https://reproducible-builds.org/docs/timestamps/ Since the build is reproducible, it should no
by purkka 2y ago
Generally, yes: https://reproducible-builds.org/docs/timestamps/ https://reproducible-builds.org/docs/timestamps/
Since the build is reproducible, it should not matter when it was built. If you want to trace a build back to its source, there are much better ways than a timestamp.
- ryandrake 2y agoC compilers offer __DATE__ and __TIME__ macros, which expand to string constants that describe the date and time that the preprocessor was invoked. Any code using these would have different strings each time it was built, and would need to be modified. I can't think of a good reason for them to be used in an actual production program, but for whatever reason, they exist.
- fmbb 2y agoToolchains for reproducible software likely let you set these values, or ensure they are 1970-01-01 00:00:00
- mikepurvis 2y agoNix sets everything to the epoch, although I believe Debian's approach is to just use the date of the newest file in the dsc tarballs.
- yjftsjthsd-h 2y agoNix can also set it to things other than 0; I think my favorite is to set it by the time of the commit from which you're building.
- deleted 2y ago[deleted]
- terinjokes 2y agoWhich is also used when the contents of a derivation will be included in a zip file. The Unix epoch is about a decade older than the zip epoch.
- lamby 2y agoDebian's approach is actually to use the date specified in the top entry in the debian/changelog file. That's more transparent and resilient than any mtime.
- lamby 2y agoStrangely enough, sometimes using the epoch can expose bugs in libraries (etc.) when running or building in a timezone west of Greenwich due to the negative time offset taking time "below" zero.
- mananaysiempre 2y agoAnd that’s why GCC (among others) accepts SOURCE_DATE_EPOCH from the environment, and also has -Wdate-time. As for using __DATE__ or __TIME__ in code, I suspect that was more helpful in the age before ubiquitous source control and build IDs.
- cperciva 2y agoSource control only helps you if everything is committed. If you're, say, working on changes to the FreeBSD boot loader, you're probably not committing those changes every time you test something but it's very useful to know "this is the version I built ten minutes ago" vs "I just booted yesterday's version because I forgot to install the new code after I built it".
- lmm 2y ago> If you're, say, working on changes to the FreeBSD boot loader, you're probably not committing those changes every time you test something Whyever not? Does the FreeBSD boot loader not have a VCS or something?
- cperciva 2y agoIt's in the FreeBSD src tree. But we usually commit code once it's working...
- lmm 2y agoHuh. If I was confident enough in a change to consider it worth doing an actual boot to test I'd certainly want to have it committed, to be able to track and go back to it. Even the broken parts of history are valuable IME.
- steveklabnik 2y agoA subtlety that may be lost: FreeBSD uses CVS, and so there isn't a way to commit locally while you're working, like with a DVCS.
- repiret 2y ago> I can't think of a good reason for them I work on a product whose user interface in one place says something like “Copyright 2004-2025”. The second year there is generated from __DATE__, that way nobody has to do anything to keep it up to date.
- Arelius 2y agoI mean, you could do that, it's sort-of a lie though, maybe something better would be using the date of the most recent commit, which would be both more accurate, as far as authorship goes, and actually deterministic.. Pipe something like this into your build system: date --date "$(git log HEAD --author-date-order --pretty=format:"%ad" --date=iso | head -n1)" +"%Y"
- rtpg 2y agoIt's super nice to have timestamps as a quick way to know what program you're looking at. Sticking it into --version output is helpful to know if, for example, the Python binary you're looking at is actually the one you just built rather than something shadowing that
- izacus 2y agoThe whole point or reproducible builds is that you don't need to rely on timestamps and similar information to know which binary you're looking at.