Bug#881094: nbsphinx: please make the build reproducible

Chris Lamb lamby at debian.org
Tue Nov 7 16:50:15 UTC 2017


Source: nbsphinx
Version: 0.2.14+ds-2
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that nbsphinx could not be built reproducibly.

Patch attached that uses different Javascript to get the sibling
<div/> element instead of generating a (random) UUID and putting
that in the DOM.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
--- a/debian/patches/reproducible-build.patch	1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/reproducible-build.patch	2017-11-07 16:41:02.718541350 +0000
@@ -0,0 +1,22 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2017-11-07
+
+--- nbsphinx-0.2.14+ds.orig/nbsphinx.py
++++ nbsphinx-0.2.14+ds/nbsphinx.py
+@@ -150,13 +150,12 @@ RST_TEMPLATE = """
+ 
+ {{ output.data['text/html'] | indent | indent }}
+ {%- elif datatype == 'application/javascript' %}
+-{% set div_id = uuid4() %}
+ 
+     .. raw:: html
+ 
+-        <div id="{{ div_id }}"></div>
++        <div></div>
+         <script type="text/javascript">
+-        var element = document.getElementById('{{ div_id }}');
++        var element = document.currentScript.previousSibling.previousSibling;
+ {{ output.data['application/javascript'] | indent | indent }}
+         </script>
+ {%- elif datatype.startswith('application') and datatype.endswith('+json') %}
--- a/debian/patches/series	2017-11-07 16:08:32.862051001 +0000
--- b/debian/patches/series	2017-11-07 16:40:20.470183875 +0000
@@ -1 +1,2 @@
 debianization-documentation.patch
+reproducible-build.patch


More information about the Reproducible-bugs mailing list