cschwan / sage-on-gentoo

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

Unable to build pdf-docs - 8.3.beta7 #509

Closed strogdon closed 6 years ago

strogdon commented 6 years ago

The error

Error building the documentation.
Traceback (most recent call last):
  File "sage_setup/docbuild/__main__.py", line 2, in <module>
    main()
  File "/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/sage_setup/docbuild/__init__.py", line 1713, in main
    builder()
  File "/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/sage_setup/docbuild/__init__.py", line 344, in _wrapper
    getattr(get_builder(document), name)(*args, **kwds)
  File "/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/sage_setup/docbuild/__init__.py", line 535, in _wrapper
    build_many(build_ref_doc, L)
  File "/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/sage_setup/docbuild/__init__.py", line 276, in build_many
    ret = x.get(99999)
  File "/usr/lib64/python2.7/multiprocessing/pool.py", line 572, in get
    raise self._value
RuntimeError: failed to run $MAKE all-pdf in /var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/build_doc/latex/en/reference/polynomial_rings

From polynomial_rings.log

! Missing { inserted.
<to be read again>
                   \let
l.46941 ...e Polynomial Ring has generators \(x_\\
                                                  ast, y_\\ast,...\), so
?
! Emergency stop.
<to be read again>
                   \let
l.46941 ...e Polynomial Ring has generators \(x_\\
                                                  ast, y_\\ast,...\), so
End of file on the terminal!

Here is how much of TeX's memory you used:
 17487 strings out of 494823
 381714 string characters out of 6177323
 736544 words of memory out of 5000000
 18411 multiletter control sequences out of 15000+600000
 65202 words of font info for 109 fonts, out of 8000000 for 9000
 37 hyphenation exceptions out of 8191
 37i,21n,45p,6132b,683s stack positions out of 5000i,500n,10000p,200000b,80000s
!  ==> Fatal error occurred, no output PDF file produced!

And line 46941 from polynomial_rings.tex

An Infinite Polynomial Ring has generators \(x_\\ast, y_\\ast,...\), so

It appears as though there is and extra \ unless something else was meant to happen? I would think vanilla should suffer from this, but I don't usually build the pdf-docs for vanilla.

kiwifb commented 6 years ago

I confess I do not routinely build the pdf docs until the release, so this one is new to me. But yes, it looks like one \ too many - twice.

strogdon commented 6 years ago

I should note that pdf-docs built for 8.3.beta6

kiwifb commented 6 years ago

And beta6 is the sphinx upgrade, not beta7 - that being said someone could have had something in their pipeline before beta6 was released.

kiwifb commented 6 years ago

I can reproduce it.

strogdon commented 6 years ago

git blame ./src/sage/rings/polynomial/infinite_polynomial_ring.py gives

535c714b1c3 (Simon King        2010-06-02 11:57:48 +0100   13) An Infinite Polynomial Ring has finitely many generators `x_\\ast,
535c714b1c3 (Simon King        2010-06-02 11:57:48 +0100   14) y_\\ast,...` and infinitely many variables of the form `x_0, x_1, x_2,
535c714b1c3 (Simon King        2010-06-02 11:57:48 +0100   15) ..., y_0, y_1, y_2,...,...`.  We refer to the natural number `n` as
535c714b1c3 (Simon King        2010-06-02 11:57:48 +0100   16) the *index* of the variable `x_n`.

So why do we see it now? Isn't this the source of the problem?

kiwifb commented 6 years ago

Commit date is not merge date.

kiwifb commented 6 years ago

I did not read that properly I must say. I thought it was 2018-06-02 which would have made it a recent ticket. Obviously that's unlikely.

strogdon commented 6 years ago

This fails with vanilla. I'll see if I can get around to reporting it.

kiwifb commented 6 years ago

I am testing a "fix" privately right now. At least 3 files have the bad stuff.

kiwifb commented 6 years ago

Argh!! just found a_\\ast in coercion. I had only looked at x_\\ast.

kiwifb commented 6 years ago

I touched all instances of _\\ now. Testing again.

kiwifb commented 6 years ago

I have a fix but I need to sync my tree before committing it and it is competing with getting kids from school time.

strogdon commented 6 years ago

On vanilla changing x_\\ast to x_\ast did not work. I get and error now with x_^^Gst? Neither does delimiting the scope to x_{\ast} work. I'm wondering if there is an encoding issue.

strogdon commented 6 years ago

I think I was making changes in the wrong file. This seems to fix things with vanilla

diff --git a/src/sage/rings/polynomial/infinite_polynomial_element.py b/src/sage/rings/polynomial/infinite_polynomial_element.py
index 26e7e09528..d0a70b611a 100644
--- a/src/sage/rings/polynomial/infinite_polynomial_element.py
+++ b/src/sage/rings/polynomial/infinite_polynomial_element.py
@@ -6,7 +6,7 @@ AUTHORS:
 - Si
mon King <simon.king@nuigalway.ie>
 - Mike Hansen <mhansen@gmail.com>

-An Infinite Polynomial Ring has generators `x_\\ast, y_\\ast,...`, so
+An Infinite Polynomial Ring has generators `x_{\ast}, y_{\ast},...`, so
 that the variables are of the form `x_0, x_1, x_2, ..., y_0, y_1,
 y_2,...,...` (see :mod:`~sage.rings.polynomial.infinite_polynomial_ring`).
 Using the generators, we can create elements as follows::

and I believe this is the commit, https://github.com/sagemath/sage/commit/ffa068a1eab796e11c3c458ef89eb009c35eda7e#diff-88acc9fde65fcd3c267d9e7f90dd67c3 that's the cause.

strogdon commented 6 years ago

The above fixed the original error with vanilla but there is another unrelated failure

! Package babel Error: Unknown option `brazil'. Either you misspelled it
(babel)                or the language definition file brazil.ldf was not found
.

See the babel package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.310 \ProcessOptions*

?
! Emergency stop.
 ...

l.310 \ProcessOptions*

!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on tutorial-pt.log.
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 256
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs of latex/pdflatex.
Latexmk: Errors, so I did not complete making targets
make[2]: *** [Makefile:33: tutorial-pt.pdf] Error 12
make[2]: Leaving directory '/64bitdev/storage/sage-git_develop/sage/local/share/doc/sage/latex/pt/tutorial'
Error building the documentation.

which may be because of my texlive installation.

kiwifb commented 6 years ago

Just changing to _\ is not enough you have to make sure the block starts with r""" not just """ I'll post the fix in a few minutes.

kiwifb commented 6 years ago

For the other error it looks like you would need pt_BR which is strange. May be it is new.

kiwifb commented 6 years ago

I have to do a full language build to find out now.

kiwifb commented 6 years ago

I cannot reproduce the brazil.ldf issue. I don't have the file at all, I suspect a texlive mixup. I have

[I] app-text/texlive (2017@28/03/18): A complete TeX distribution
[I] app-text/texlive-core (2017-r4@25/06/18): A complete TeX distribution
[I] dev-texlive/texlive-basic (2017-r1@16/02/18): TeXLive Essential programs and files
[I] dev-texlive/texlive-bibtexextra (2017@16/02/18): TeXLive BibTeX additional styles
[I] dev-texlive/texlive-fontsextra (2017@16/02/18): TeXLive Additional fonts
[I] dev-texlive/texlive-fontsrecommended (2017@16/02/18): TeXLive Recommended fonts
[I] dev-texlive/texlive-fontutils (2017@16/02/18): TeXLive Graphics and font utilities
[I] dev-texlive/texlive-formatsextra (2017@16/02/18): TeXLive Additional formats
[I] dev-texlive/texlive-langcjk (2017@16/02/18): TeXLive Chinese/Japanese/Korean (base)
[I] dev-texlive/texlive-langcyrillic (2017@16/02/18): TeXLive Cyrillic
[I] dev-texlive/texlive-langenglish (2017@16/02/18): TeXLive US and UK English
[I] dev-texlive/texlive-langeuropean (2017@16/02/18): TeXLive Other European languages
[I] dev-texlive/texlive-langfrench (2017@16/02/18): TeXLive French
[I] dev-texlive/texlive-langgerman (2017@16/02/18): TeXLive German
[I] dev-texlive/texlive-langitalian (2017@16/02/18): TeXLive Italian
[I] dev-texlive/texlive-langjapanese (2017@16/02/18): TeXLive Japanese
[I] dev-texlive/texlive-langportuguese (2017@16/02/18): TeXLive Portuguese
[I] dev-texlive/texlive-langspanish (2017@16/02/18): TeXLive Spanish
[I] dev-texlive/texlive-latex (2017@16/02/18): TeXLive LaTeX fundamental packages
[I] dev-texlive/texlive-latexextra (2017@16/02/18): TeXLive LaTeX additional packages
[I] dev-texlive/texlive-latexrecommended (2017@16/02/18): TeXLive LaTeX recommended packages
[I] dev-texlive/texlive-luatex (2017@16/02/18): TeXLive LuaTeX packages
[I] dev-texlive/texlive-mathscience (2017@16/02/18): TeXLive Mathematics and science packages
[I] dev-texlive/texlive-pictures (2017@16/02/18): TeXLive Graphics, pictures, diagrams
[I] dev-texlive/texlive-plaingeneric (2017@16/02/18): TeXLive Plain (La)TeX packages
[I] dev-texlive/texlive-pstricks (2017@16/02/18): TeXLive PSTricks
[I] dev-texlive/texlive-xetex (2017@16/02/18): TeXLive XeTeX and packages
strogdon commented 6 years ago

I will check what I have here relative to Portuguese. With your recent commit I have problems installing

byte-compiling /var/tmp/portage/sci-mathematics/sage-9999/image/_python2.7/usr/lib64/python2.7/site-packages/sage/logic/booleval.py to booleval.pyc
writing byte-compilation script '/var/tmp/portage/sci-mathematics/sage-9999/temp/tmpDsKjZ4.py'
/usr/bin/python2.7 -OO /var/tmp/portage/sci-mathematics/sage-9999/temp/tmpDsKjZ4.py
removing /var/tmp/portage/sci-mathematics/sage-9999/temp/tmpDsKjZ4.py
running install_egg_info
Writing /var/tmp/portage/sci-mathematics/sage-9999/image/_python2.7/usr/lib64/python2.7/site-packages/sage-9999-py2.7.egg-info
error: [Errno 2] No such file or directory: '/usr/share/sage/ext/notebook-ipython'
 ^[[31;01m*^[[0m ERROR: sci-mathematics/sage-9999::sage-on-gentoo failed (install phase):
strogdon commented 6 years ago

I have dev-texlive/texlive-latex-2016 installed. Installing dev-texlive/texlive-langportuguese-2016 fixed building the Portuguese tutorial.

strogdon commented 6 years ago

Do you understand the source of the error in https://github.com/cschwan/sage-on-gentoo/issues/509#issuecomment-399940955? It would appear if I manually create /usr/share/sage/ext/notebook-ipython before the install then the install seems to work.

kiwifb commented 6 years ago

Hum, I made some changes after jupyter kernel was improved upstream and simplified a lot of things. I have a feeling it is related even though it should just work out of the box.

kiwifb commented 6 years ago

That location doesn't figure explicitly anywhere in the ebuild. There used to be link to that location. Time to experiment...

strogdon commented 6 years ago

It's almost as if that folder is hardcoded in something that's touched by the install.

kiwifb commented 6 years ago

OK, I can reproduce and I think I have some ideas. It may take 24hours before I have some proper fix.

kiwifb commented 6 years ago

Culprit https://github.com/sagemath/sage/blob/develop/src/sage/repl/ipython_kernel/install.py#L235

kiwifb commented 6 years ago

This is annoying. One of the clean thing to do would be to split the installation of extcode in its own ebuild, again. But even so it would really need to be converted to relative links instead of absolute one like right now.

strogdon commented 6 years ago

Is this issue https://github.com/cschwan/sage-on-gentoo/issues/376 appearing again? It's been a long time and I forgot about that.

kiwifb commented 6 years ago

It is related. The same code is involved. I wanted to benefit from some changes Jeroen did (and I had to adapt somewhat anyway) and jupyter kernel stuff install is now mostly handled by setup.py while in #376 I ended up doing it manually - letting setup.py do it was not going to cut it. Right now the main issues are

strogdon commented 6 years ago

With the present situation; if I understand things correctly, there are also some missing symlinks for the jupyter kernel (this is in prefix).

ls -alR ~/usr/share/jupyter/kernels/sagemath/
/storage/strogdon/gentoo-rap/usr/share/jupyter/kernels/sagemath/:
total 12
drwxr-xr-x 2 strogdon math 4096 Jul 10 00:45 .
drwxr-xr-x 4 strogdon math 4096 Jul 10 00:45 ..
lrwxrwxrwx 1 strogdon math   25 Jul 10 00:45 doc -> ../../../doc/sage/html/en
-rw-r--r-- 1 strogdon math  117 Jul 10 00:04 kernel.json

I think there should be links to logo.svg and logo-64x64.png.

kiwifb commented 6 years ago

They definitely should be there. I am currently working on these and it is quite annoying.

kiwifb commented 6 years ago

There may be no choice but to split extcode. Otherwise I have to somehow treat jsmol, mathjax and extcode stuff being linked differently. Or I take control of the links in the ebuild again.

kiwifb commented 6 years ago

I think I will use sage's mechanism as much as possible but revert to manual setting of the problematic links from inside the ebuild.

kiwifb commented 6 years ago

OK fix in overlay and look good to me. Re-open if there are further problems.

strogdon commented 6 years ago

looks good here.