cschwan / sage-on-gentoo

(Unofficial) Gentoo Overlay for Sage- and Sage-related ebuilds
84 stars 26 forks source link

pdf-docs fail to build with sage-9999 (7.2.beta6) #418

Closed strogdon closed 8 years ago

strogdon commented 8 years ago

This is the first sage with sphinx-1.4.1. l have LINGUAS="en fr". Building the pdfs I get from the build.log

[190 <./graph_plot-16.pdf

pdfTeX warning: pdflatex (file ./graph_plot-16.pdf): PDF inclusion: invalid oth
er resource which is no dict (key 'XObject', type <null>); ignored.

pdfTeX warning: pdflatex (file ./graph_plot-16.pdf): PDF inclusion: invalid oth
er resource which is no dict (key 'Pattern', type <null>); ignored.

pdfTeX warning: pdflatex (file ./graph_plot-16.pdf): PDF inclusion: invalid oth
er resource which is no dict (key 'ExtGState', type <null>); ignored.

pdfTeX warning: pdflatex (file ./graph_plot-16.pdf): ][parallel ] writing... done

Underfull \hbox (badness 10000) in paragraph at lines 16648--16652

Underfull \hbox (badness 10000) in paragraph at lines 16680--16684

[191] [41PDF inclusion: invalid oth
er resource which is no dict (key 'Shading', type <null>); ignored.

!pdfTeX error: pdflatex (file ./graph_plot-16.pdf): PDF inclusion: invalid font
 resources dict type <null>
 ==> Fatal error occurred, no output PDF file produced!
]Makefile:68: recipe for target 'graphs.pdf' failed
make: *** [graphs.pdf] Error 1

The graph_plot-16.pdf is from src-python2_7/build_doc/latex/en/reference/graphs and graphs.log has

pdfTeX warning: pdflatex (file ./graph_plot-16.pdf): PDF inclusion: invalid oth
er resource which is no dict (key 'XObject', type <null>); ignored.

pdfTeX warning: pdflatex (file ./graph_plot-16.pdf): PDF inclusion: invalid oth
er resource which is no dict (key 'Pattern', type <null>); ignored.

pdfTeX warning: pdflatex (file ./graph_plot-16.pdf): PDF inclusion: invalid oth
er resource which is no dict (key 'ExtGState', type <null>); ignored.

pdfTeX warning: pdflatex (file ./graph_plot-16.pdf): PDF inclusion: invalid oth
er resource which is no dict (key 'Shading', type <null>); ignored.

!pdfTeX error: pdflatex (file ./graph_plot-16.pdf): PDF inclusion: invalid font
 resources dict type <null>
 ==> Fatal error occurred, no output PDF file produced!
kiwifb commented 8 years ago

OK so presumably you would be hit just with LINGUAS=en.

strogdon commented 8 years ago

There are several graph_plot-16.pdf files available - I presume they should be the same file. From src-python2_7/build_doc

ls -al `find ./ | grep graph_plot-16.pdf`
-rw-r--r-- 1 portage portage 90917 May  2 23:00 ./doctrees/en/reference/plot_directive/sage/graphs/graph_plot-16.pdf
-rw-r--r-- 1 portage portage 80502 May  2 22:29 ./html/en/reference/graphs/sage/graphs/graph_plot-16.pdf
-rw-r--r-- 1 portage portage 80502 May  2 22:32 ./html/en/reference/plotting/sage/graphs/graph_plot-16.pdf
-rw-r--r-- 1 portage portage 90917 May  2 23:00 ./inventory/en/reference/graphs/sage/graphs/graph_plot-16.pdf
-rw-r--r-- 1 portage portage 90917 May  2 23:00 ./inventory/en/reference/plotting/sage/graphs/graph_plot-16.pdf
-rw-r--r-- 1 portage portage 90917 May  2 23:00 ./latex/en/reference/graphs/graph_plot-16.pdf

If I copy ./html/en/reference/graphs/sage/graphs/graph_plot-16.pdf over to build_doc/latex/en/reference/graphs and type make the build proceeds a bit further where I get a similar error for graph_plot-18.pdf

 [720 <./graph_plot-18.pdf

pdfTeX warning: pdflatex (file ./graph_plot-18.pdf): PDF inclusion: invalid oth
er resource which is no dict (key 'XObject', type <null>); ignored.

pdfTeX warning: pdflatex (file ./graph_plot-18.pdf): PDF inclusion: invalid oth
er resource which is no dict (key 'Pattern', type <null>); ignored.

pdfTeX warning: pdflatex (file ./graph_plot-18.pdf): PDF inclusion: invalid oth
er resource which is no dict (key 'ExtGState', type <null>); ignored.

pdfTeX warning: pdflatex (file ./graph_plot-18.pdf): PDF inclusion: invalid oth
er resource which is no dict (key 'Shading', type <null>); ignored.

!pdfTeX error: pdflatex (file ./graph_plot-18.pdf): PDF inclusion: invalid font
 resources dict type <null>
 ==> Fatal error occurred, no output PDF file produced!

Perhaps some of the pdfs are being corrupted?

strogdon commented 8 years ago

And if I correct graph_plot-18.pdf in the same way as graph_plot-16.pdf and type make the build completes for graph.pdf.

kiwifb commented 8 years ago

I have a feeling it is related to #402 all this was introduced with new graphing capabilities in the doc.

strogdon commented 8 years ago

When I try to open the offending graph_plot-16.pdf in a pdf viewer I get

"Error (442): Bad 'Length' attribute in stream" 
"Error (598): Missing 'endstream' or incorrect stream length" 
"Error: XObject 'I1' is unknown"
strogdon commented 8 years ago

Both graph_plot-16.pdf and graph_plot-18.pdf may be repaired with pdftk so that the make completes. I'm wondering if this is because of libpng warning: iTXt: bad compression info that appears frequently during building the html-docs.

kiwifb commented 8 years ago

No, in that I have those messages too and I don't suffer from that problem. I cannot reproduce this locally. So I think that is possibly a useflag problem. What are the useflag you have for matplotlib

strogdon commented 8 years ago

Slowly, over the years, I've been stripping away matplotlib useflags

[I] dev-python/matplotlib
     Available versions:  [m]~1.3.1^m[1] 1.4.3 (~)1.5.0 (~)1.5.1 **9999 {cairo doc examples excel fltk gtk gtk2 gtk3 latex pyside qt4 qt5 test tk wxwidgets PYTHON_TARGETS="python2_7 python3_3 python3_4 python3_5"}
     Installed versions:  1.5.1(07:21:16 PM 03/01/2016)(cairo qt4 tk -doc -examples -excel -fltk -gtk2 -gtk3 -latex -pyside -qt5 -test -wxwidgets PYTHON_TARGETS="python2_7 python3_3 -python3_4 -python3_5")
     Homepage:            http://matplotlib.org/
     Description:         Pure python plotting library with matlab like syntax

[1] "local-overlay" /usr/local/portage

In prefix I have stripped every useflag from matplotlib for various problems. If anything it's probably qt4.

kiwifb commented 8 years ago

I don't think so, I would like you to re-enable latex. It is a bit of a wild guess.

strogdon commented 8 years ago

This will take a while. Nothing extra was installed by adding the useflag.

kiwifb commented 8 years ago

I was fearing that, it can be an automagic runtime dependency which makes the useflag meaningless.

strogdon commented 8 years ago

Not surprising, the build failed in the same location.

kiwifb commented 8 years ago

Useflags for sphinx?

strogdon commented 8 years ago

sphinx useflags

[I] dev-python/sphinx
     Available versions:  1.1.3-r7 1.2.2 1.2.2[1] [m]~1.2.3 [m]~1.2.3[1] [m]~1.2.3[2] [m]1.3.1-r1 ~1.3.5 (~)1.4.1[1] {doc latex test PYTHON_TARGETS="pypy pypy3 python2_7 python3_3 python3_4 python3_5"}
     Installed versions:  1.4.1[1](08:02:52 PM 05/02/2016)(-doc -latex -test PYTHON_TARGETS="python2_7 python3_3 -python3_4 -python3_5")
     Homepage:            http://sphinx.pocoo.org/ https://pypi.python.org/pypi/Sphinx
     Description:         Python documentation generator

[1] "sage-on-gentoo" /var/lib/layman/sage-on-gentoo
[2] "local-overlay" /usr/local/portage

Adding latex pulls in nothing new. I do notice that installed dev-python/Babel is old, version 1.3-r1 which is no longer in the tree. Vanilla uses version 2.2. Let's try upgrading that.

strogdon commented 8 years ago

But Babel is probably not the issue.

strogdon commented 8 years ago

Well Babel was the issue. Who would have thought? So it must do lots of odd things. I'm not sure how the upgrade was skipped over here.

kiwifb commented 8 years ago

The sphinx ebuild only require an old version not in the tree anymore. I will bump it to 2.1.1 (what I have).

strogdon commented 8 years ago

So, I'll close this.

kiwifb commented 8 years ago

I am adding it to the stuff I need to communicate to sphinx upstream, from sphinx's own setup.py

requires = [
    'six>=1.4',
    'Jinja2>=2.3',
    'Pygments>=2.0',
    'docutils>=0.11',
    'snowballstemmer>=1.1',
    'babel>=1.3,!=2.0',
    'alabaster>=0.7,<0.8',
    'imagesize',
]

which is what is in the ebuild for a while.