New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure the graphviz filenames are reproducible #6028
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6028 +/- ##
==========================================
+ Coverage 82.91% 82.93% +0.02%
==========================================
Files 271 269 -2
Lines 39086 39054 -32
Branches 5847 5844 -3
==========================================
- Hits 32408 32391 -17
+ Misses 5330 5318 -12
+ Partials 1348 1345 -3
Continue to review full report at Codecov.
|
Hmm, it seems the docname was wrong. |
Note: this is a bugfix. so please rebase this to 1.8 branch. then I will merge this to 1.8.5 release. |
f6196ea
to
9db1ac3
Compare
Whilst working on the Reproducible Builds effort [0], we noticed that sphinx could generate output that is not reproducible. In particular, the graphviz extension module would construct filenames based on, inter alia, the contents of the `options` dictionary. As this contained the absolute build path of the source file embedded in the `docname` variable this meant that builds of documentation were not independent of where on a filesystem they were built from. Example filenames might be: - html/_images/graphviz-9e71e0f9ba91d0842b51211b676ec4adb7e7afb8.png + html/_images/graphviz-6241bbfd7ac6bd4e2ad9af451ab0dfb8719988d2.png We fix this by limiting how much of the `docname` variable ends up in the final constructed filename; I assume there is a good reason for including the `options` dictionary in the first place, otherwise we could simply omit it. [0] https://reproducible-builds.org
9db1ac3
to
1a4362b
Compare
Rebased against |
@lamby Please also edit this pull request and change target branch from master to 1.8. |
Ah, thanks. No wonder it was still saying "conflict"... |
I want to note that your patch actually omits all options except the filename. Though in my opinion it is fine, as the resulting image depends only on source file name and graphviz arguments, which are present in the hash anyway. |
Nod. Note that it cannot include include the absolute path to the source file name, otherwise it would be unreproducible as before. ;-) |
As I commented above, the value of docname must be wrong. So this is not only "not reproducible", but also a bug. Lines 199 to 201 in 12c6149
|
Don't follow that, sorry... |
Fix #6028: graphviz: Ensure the graphviz filenames are reproducible
Merged #6111 instead. |
Whilst working on the Reproducible Builds effort, we noticed that sphinx could generate output that is not reproducible.
In particular, the graphviz extension module would construct filenames based on, inter alia, the contents of the
options
dictionary.As this contained the absolute build path of the source file embedded in the
docname
variable this meant that builds of documentation were not independent of where on a filesystem they were built fromExample filenames might be:
We fix this by limiting how much of the
docname
variable ends up in the final constructed filename; I assume there is a good reason for including theoptions
dictionary in the first place, otherwise we could simply omit it.This was originally filed in @Debian as #921513.