praiskup / argparse-manpage

Automatically build man-pages for your Python project
Apache License 2.0
40 stars 21 forks source link

Allow to override build date with SOURCE_DATE_EPOCH #76

Closed bmwiedemann closed 1 year ago

bmwiedemann commented 1 year ago

Allow to override build 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.

This patch was done while working on reproducible builds for openSUSE.

praiskup commented 1 year ago

Thank you for the patch. Note there's also the issue #75.

Since this patch is probably an RPM-only solution, I'd probably prefer having this date logic, note the latter detections should beat the former:

The first two are implemented by this PR. The third can be added later, As such, I like the PR. @ssbarnea can you take a look?

bmwiedemann commented 1 year ago

SOURCE_DATE_EPOCH is set by various package builds, e.g. in Debian, ArchLinux, NixOS, Guix - in addition to rpm.

If you have a .git tree instead of a release tarball, you can also extract %ct from it.

An explicit --date option is not as useful, because it requires us to patch an infinite number of callers.

praiskup commented 1 year ago

Ok, thank you again for the patch!