Bug#1042955: zzzeeksphinx: please make the output reproducible
Chris Lamb
lamby at debian.org
Thu Aug 3 10:18:14 BST 2023
Source: zzzeeksphinx
Version: 1.4.0-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: toolchain timestamps
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org
Hi,
Whilst working on the Reproducible Builds effort [0], we noticed that
zzzeeksphinx was generating output that was not reproducible.
This is because the template includes:
% if show_sphinx:
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> ${sphinx_version|h}.
% endif
Documentation last generated: ${datetime.datetime.now().strftime("%c")}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This was affecting the reproduciblity of (at least) the mako in
Debian. A patch is attached that makes this use SOURCE_DATE_EPOCH
instead.
[0] https://reproducible-builds.org/
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` lamby at debian.org / chris-lamb.co.uk
`-
-------------- next part --------------
diff --git a/zzzeeksphinx/themes/zsbase/layout.mako b/zzzeeksphinx/themes/zsbase/layout.mako
index 969b6df..dfea0e1 100644
--- a/zzzeeksphinx/themes/zsbase/layout.mako
+++ b/zzzeeksphinx/themes/zsbase/layout.mako
@@ -1,8 +1,14 @@
## coding: utf-8
<%!
+ import os
+ import time
import datetime
+ now = datetime.datetime.utcfromtimestamp(
+ int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
+ )
+
local_script_files = []
default_css_files = [
@@ -307,7 +313,7 @@ withsidebar = bool(toc) and (
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> ${sphinx_version|h}.
% endif
- Documentation last generated: ${datetime.datetime.now().strftime("%c")}
+ Documentation last generated: ${now.strftime("%c")}
</div>
</div>
More information about the Reproducible-bugs
mailing list