Backport: SVG output: incremental ID scheme for non-rectangular clip paths.
This backports an upstream patch to fix an output nondeterminism (e.g. build reproducibility) bug - it is available in v3.10 of matplotlib
upstream, but is relatively straightforward to backport to v3.8.3 also.
Closes #1065124.
Aside / Build-Dep modification explainer
The rendering of a TextPath
entity introduced by the determinism patch causes a subtle build-time bug during autopkgtests
: the fact that dvips
produces intermediate DVI files that include Encoding vector references for the tcss3583
font -- because that font appears in dvips-all.enc
as distributed in texlive-base
.matplotlib
produces and processes TeX that includes \usepackage{type1ec}
-- without specifying a 10-point font size! -- means that large-sized text may attempt to use fonts such as tcss3583
that are not available in cm-super-minimal
(the minimal variant of the package only contains 10*
font files).
However: we do not currently install the referenced font file itself during package build, and matplotlib
fails to render the PostScript version of the deterministic test diagram as a result of that.
In this merge request, commit 80b52c68 adds a workaround: it migrates the build-dep on cm-super-minimal
to cm-super
so that the TCSS3583 font is available when the test suite runs. However, I'll try to learn more about the problem and report it as a bug upstream in ; there may be a way to handle this condition as a non-fatal error.matplotlib
Edit: markup fixup for malformatted subheading in description
Edit 2: provide a more accurate problem description
Edit 3: improve the formatting of these edit footnotes
Edit 4: update a reference in the closing paragraph to commit 1375a4fa -- it has been superseded by 80b52c68 (with an explanatory commit message)
Merge request reports
Activity
The rendering of a
TextPath
entity introduced by the determinism patch causes a subtle build-time bug during autopkgtests:dvips
produces intermediate DVI files that include Encoding vector references for thetcss3583
font -- because that font appears indvips-all.enc
as distributed intexlive-base
.This appears to be inaccurate: in fact, the reference to
tcss3583
is introduced by amake_tex
method that writes TeX output including\usepackage{type1ec}
.There is a comment to mention that doing so pulls in
cm-super
: https://salsa.debian.org/python-team/packages/matplotlib/-/blob/2558456d2550629c34553ce256c6158d377b1b1a/lib/matplotlib/texmanager.py#L84-86...however: in the
cm-super
packageREADME.Debian
file, there is a note (well, a big warning actually) that font-size must be fixed to 10pt when usingcm-super-minimal
:https://sources.debian.org/src/cm-super/0.3.4-17/debian/README.Debian/#L13-L18
The intermediate
.tex
files do not do this; they currently emit content that looks like this:documentclass{article} ... \usepackage{type1cm} \usepackage{type1ec} \usepackage{type1ec} \usepackage{type1ec} ... {\sffamily °} \end{document}
added 1 commit
- 80b52c68 - Build-Deps: migrate to `cm-super` to provide `tcss3583` font
@detiste-guest @stuart could we include this for
trixie
? It's OK if not!We could even try to have 3.10 in trixie ...
...and that's appearing more likely, with the upload of 3.10 to experimental :) (thanks, @nilesh!)
I think that that could (and should) obsolete this 3.8 backporting approach, so I'll go ahead and close this.
(if for some unexpected reason we do want to backport this to earlier releases, that's fine by me - but I think it is probably simplest to await 3.10)