Page MenuHome

Allow to override date with SOURCE_DATE_EPOCH
AbandonedPublic

Authored by Bernhard M. Wiedemann (bmwiedemann) on Wed, Sep 11, 2:15 PM.

Details

Summary

Allow to override date with SOURCE_DATE_EPOCH
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

Also use ISO 8601 date format for readability.

Diff Detail

Repository
rB Blender
Branch
date (branched from master)
Build Status
Buildable 4905
Build 4905: arc lint + arc unit

Event Timeline

Bastien Montagne (mont29) requested changes to this revision.Wed, Sep 11, 2:42 PM

I don’t see any reason to accept that patch tbh… I don’t see why that would matter, especially for the manpage.
If we were to do any change in that script, imho it would rather be to use the build timestamp stored in Blender app itself, instead of current time… Note that in our CMake config there are already options to define a fixed, static date/time stamps if desired. If we actually want to follow that new thing, then would make more sense to use SOURCE_DATE_EPOCH in that CMake config. But that should remain an option, even when that envvar is defined.

Unless am mistaken, this has not been discussed anywhere prior to that patch either?

This revision now requires changes to proceed.Wed, Sep 11, 2:42 PM

Indeed, it was not discussed for blender.

But that should remain an option, even when that envvar is defined.

No, I would prefer reproducible builds to be the default. Otherwise every distribution packager has to discover the details of how to enable it.

As you noticed, this is only about the man page date, which does not have much impact. If SOURCE_DATE_EPOCH is not set, it will still get the build date like it did before.

Do you have pointers to "our CMake config" or "the build timestamp stored in Blender app" ?

Build date/time in Blender is available from py API (bpy.app.build_date and bpy.app.build_time), or from the blender --version command (the one used here to retrieve Blender version already).

CMake options are simply named BUILDINFO_OVERRIDE_DATE and BUILDINFO_OVERRIDE_TIME. Their main use so far, afaik, was to avoid re-linking the whole app everytime (for devs, when building without actual changes to compiled code).

manpage generating script now uses blender's build date, i.e. the SOURCE_DATE_EPOCH thingy if that one is used to build blender.