* make pdfdocs fails with v4.9-rc3 @ 2016-10-31 18:51 Jim Davis 2016-10-31 19:15 ` Jonathan Corbet 0 siblings, 1 reply; 11+ messages in thread From: Jim Davis @ 2016-10-31 18:51 UTC (permalink / raw) To: Jonathan Corbet, linux-doc, linux-kernel Running make pdfdocs on a Ubuntu 16.04 system fails with Makefile:58: recipe for target 'media.pdf' failed make[2]: *** [media.pdf] Error 1 Documentation/Makefile.sphinx:79: recipe for target 'pdfdocs' failed make[1]: *** [pdfdocs] Error 2 Makefile:1442: recipe for target 'pdfdocs' failed make: *** [pdfdocs] Error 2 It's not clear from the voluminous (>5MB) output from make pdfdocs exactly which stage is failing, and there are some pdf files produced in output/latex. This is with sphinx, rst2pdf, and texlive installed from the Ubuntu repositories. -- Jim ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: make pdfdocs fails with v4.9-rc3 2016-10-31 18:51 make pdfdocs fails with v4.9-rc3 Jim Davis @ 2016-10-31 19:15 ` Jonathan Corbet 2016-10-31 20:17 ` Mauro Carvalho Chehab 0 siblings, 1 reply; 11+ messages in thread From: Jonathan Corbet @ 2016-10-31 19:15 UTC (permalink / raw) To: Jim Davis; +Cc: linux-doc, linux-kernel, Mauro Carvalho Chehab On Mon, 31 Oct 2016 11:51:20 -0700 Jim Davis <jim.epost@gmail.com> wrote: > Running make pdfdocs on a Ubuntu 16.04 system fails with > > Makefile:58: recipe for target 'media.pdf' failed > make[2]: *** [media.pdf] Error 1 > Documentation/Makefile.sphinx:79: recipe for target 'pdfdocs' failed > make[1]: *** [pdfdocs] Error 2 > Makefile:1442: recipe for target 'pdfdocs' failed > make: *** [pdfdocs] Error 2 > > It's not clear from the voluminous (>5MB) output from make pdfdocs > exactly which stage is failing, and there are some pdf files produced > in output/latex. Hmm, so it does. It comes down to this: ! LaTeX Error: \DUrole undefined. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.195 \renewcommand*{\DUrole} [2]{ #2 } Where the offending command is in Documentation/media/index.rst. Mauro, got an idea for what's going on there? jon ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: make pdfdocs fails with v4.9-rc3 2016-10-31 19:15 ` Jonathan Corbet @ 2016-10-31 20:17 ` Mauro Carvalho Chehab 2016-10-31 20:58 ` Mauro Carvalho Chehab 0 siblings, 1 reply; 11+ messages in thread From: Mauro Carvalho Chehab @ 2016-10-31 20:17 UTC (permalink / raw) To: Jonathan Corbet; +Cc: Jim Davis, linux-doc, linux-kernel Em Mon, 31 Oct 2016 13:15:24 -0600 Jonathan Corbet <corbet@lwn.net> escreveu: > On Mon, 31 Oct 2016 11:51:20 -0700 > Jim Davis <jim.epost@gmail.com> wrote: > > > Running make pdfdocs on a Ubuntu 16.04 system fails with > > > > Makefile:58: recipe for target 'media.pdf' failed > > make[2]: *** [media.pdf] Error 1 > > Documentation/Makefile.sphinx:79: recipe for target 'pdfdocs' failed > > make[1]: *** [pdfdocs] Error 2 > > Makefile:1442: recipe for target 'pdfdocs' failed > > make: *** [pdfdocs] Error 2 > > > > It's not clear from the voluminous (>5MB) output from make pdfdocs > > exactly which stage is failing, and there are some pdf files produced > > in output/latex. > > Hmm, so it does. It comes down to this: > > ! LaTeX Error: \DUrole undefined. > > See the LaTeX manual or LaTeX Companion for explanation. > Type H <return> for immediate help. > ... > > l.195 \renewcommand*{\DUrole} > [2]{ #2 } > > Where the offending command is in Documentation/media/index.rst. Mauro, > got an idea for what's going on there? Sphinx is really a poor solution when it comes to PDF output. In this specific case, this is meant to fix a problem with cross-references. What happens is that Sphinx 1.4.6 (and later?) define reference names without being properly escaped. So, for some references, it causes the PDF output to crash. That happens at one of the DVB header files, if I remember well. This commit restores the sphinx 1.2.x behavior: commit e61a39baf74dddb6cd236147bd19b55c10188d78 Author: Mauro Carvalho Chehab <mchehab@s-opensource.com> Date: Sun Aug 21 15:14:57 2016 -0300 [media] index.rst: Fix LaTeX error in interactive mode on Sphinx 1.4.x The Sphinx 1.4.x definition for \DUrole is: \providecommand*{\DUrole}[2]{% \ifcsname DUrole#1\endcsname% \csname DUrole#1\endcsname{#2}% \else% backwards compatibility: try \docutilsrole#1{#2} \ifcsname docutilsrole#1\endcsname% \csname docutilsrole#1\endcsname{#2}% \else% #2% \fi% \fi% } This is broken when it is used inside a \begin{alltt} block. So, replace it by just "#2", as this won't cause troubles, and it is one of the fallback methods for it. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> At the time I tested, it worked fine, but maybe it is redefining the \DUrole too late. Maybe we could move it to LaTeX preamble instead. Please check if this untested patch fixes the issue. diff --git a/Documentation/conf.py b/Documentation/conf.py index d9bad21dd427..ae7450c0a6e0 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -329,6 +329,9 @@ latex_elements = { % To allow adjusting table sizes \\usepackage{adjustbox} + % Fix reference escape troubles with Sphinx 1.4.x + \renewcommand*{\DUrole}[2]{ #2 } + ''' } diff --git a/Documentation/media/index.rst b/Documentation/media/index.rst index e347a3e7bdef..7f8f0af620ce 100644 --- a/Documentation/media/index.rst +++ b/Documentation/media/index.rst @@ -1,11 +1,6 @@ Linux Media Subsystem Documentation =================================== -.. Sphinx 1.4.x has a definition for DUrole that doesn't work on alltt blocks -.. raw:: latex - - \renewcommand*{\DUrole}[2]{ #2 } - Contents: .. toctree:: Cheers, Mauro ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: make pdfdocs fails with v4.9-rc3 2016-10-31 20:17 ` Mauro Carvalho Chehab @ 2016-10-31 20:58 ` Mauro Carvalho Chehab 2016-10-31 22:04 ` Jim Davis 0 siblings, 1 reply; 11+ messages in thread From: Mauro Carvalho Chehab @ 2016-10-31 20:58 UTC (permalink / raw) To: Jonathan Corbet; +Cc: Jim Davis, linux-doc, linux-kernel Em Mon, 31 Oct 2016 14:17:59 -0600 Mauro Carvalho Chehab <mchehab@infradead.org> escreveu: > Em Mon, 31 Oct 2016 13:15:24 -0600 > Jonathan Corbet <corbet@lwn.net> escreveu: > > > On Mon, 31 Oct 2016 11:51:20 -0700 > > Jim Davis <jim.epost@gmail.com> wrote: > > > > > Running make pdfdocs on a Ubuntu 16.04 system fails with > > > > > > Makefile:58: recipe for target 'media.pdf' failed > > > make[2]: *** [media.pdf] Error 1 > > > Documentation/Makefile.sphinx:79: recipe for target 'pdfdocs' failed > > > make[1]: *** [pdfdocs] Error 2 > > > Makefile:1442: recipe for target 'pdfdocs' failed > > > make: *** [pdfdocs] Error 2 > > > > > > It's not clear from the voluminous (>5MB) output from make pdfdocs > > > exactly which stage is failing, and there are some pdf files produced > > > in output/latex. > > > > Hmm, so it does. It comes down to this: > > > > ! LaTeX Error: \DUrole undefined. > > > > See the LaTeX manual or LaTeX Companion for explanation. > > Type H <return> for immediate help. > > ... > > > > l.195 \renewcommand*{\DUrole} > > [2]{ #2 } > > > > Where the offending command is in Documentation/media/index.rst. Mauro, > > got an idea for what's going on there? > > Sphinx is really a poor solution when it comes to PDF output. In this > specific case, this is meant to fix a problem with cross-references. > > What happens is that Sphinx 1.4.6 (and later?) define reference names without > being properly escaped. So, for some references, it causes the PDF output > to crash. That happens at one of the DVB header files, if I remember well. > > This commit restores the sphinx 1.2.x behavior: > > commit e61a39baf74dddb6cd236147bd19b55c10188d78 > Author: Mauro Carvalho Chehab <mchehab@s-opensource.com> > Date: Sun Aug 21 15:14:57 2016 -0300 > > [media] index.rst: Fix LaTeX error in interactive mode on Sphinx 1.4.x > > The Sphinx 1.4.x definition for \DUrole is: > > \providecommand*{\DUrole}[2]{% > \ifcsname DUrole#1\endcsname% > \csname DUrole#1\endcsname{#2}% > \else% backwards compatibility: try \docutilsrole#1{#2} > \ifcsname docutilsrole#1\endcsname% > \csname docutilsrole#1\endcsname{#2}% > \else% > #2% > \fi% > \fi% > } > > This is broken when it is used inside a \begin{alltt} block. > So, replace it by just "#2", as this won't cause troubles, and > it is one of the fallback methods for it. > > Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> > > At the time I tested, it worked fine, but maybe it is redefining the > \DUrole too late. > > Maybe we could move it to LaTeX preamble instead. Please check if this > untested patch fixes the issue. Yes, this seems to be the case. The patch below should fix it. [PATCH] docs-rst: fix PDF build errors PDF build on Kernel 4.9-rc? returns an error. This is because we're re-defining a command too late. Move such redefinition to LaTeX preamble. Tested by building the documentation on interactive mode: make PDFLATEX=xelatex -C Documentation/output/./latex Fixes: e61a39baf74d ("[media] index.rst: Fix LaTeX error in interactive mode on Sphinx 1.4.x") Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> diff --git a/Documentation/conf.py b/Documentation/conf.py index d9bad21dd427..d9ebfeb431a9 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -329,6 +329,9 @@ latex_elements = { % To allow adjusting table sizes \\usepackage{adjustbox} + % Fix reference escape troubles with Sphinx 1.4.x + \\renewcommand*{\\DUrole}[2]{ #2 } + ''' } diff --git a/Documentation/media/index.rst b/Documentation/media/index.rst index e347a3e7bdef..7f8f0af620ce 100644 --- a/Documentation/media/index.rst +++ b/Documentation/media/index.rst @@ -1,11 +1,6 @@ Linux Media Subsystem Documentation =================================== -.. Sphinx 1.4.x has a definition for DUrole that doesn't work on alltt blocks -.. raw:: latex - - \renewcommand*{\DUrole}[2]{ #2 } - Contents: .. toctree:: Cheers, Mauro ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: make pdfdocs fails with v4.9-rc3 2016-10-31 20:58 ` Mauro Carvalho Chehab @ 2016-10-31 22:04 ` Jim Davis 2016-10-31 22:40 ` Mauro Carvalho Chehab 0 siblings, 1 reply; 11+ messages in thread From: Jim Davis @ 2016-10-31 22:04 UTC (permalink / raw) To: Mauro Carvalho Chehab; +Cc: Jonathan Corbet, linux-doc, linux-kernel On Mon, Oct 31, 2016 at 1:58 PM, Mauro Carvalho Chehab <mchehab@infradead.org> wrote: > Em Mon, 31 Oct 2016 14:17:59 -0600 > Mauro Carvalho Chehab <mchehab@infradead.org> escreveu: > >> Em Mon, 31 Oct 2016 13:15:24 -0600 >> Jonathan Corbet <corbet@lwn.net> escreveu: >> >> > On Mon, 31 Oct 2016 11:51:20 -0700 >> > Jim Davis <jim.epost@gmail.com> wrote: >> > >> > > Running make pdfdocs on a Ubuntu 16.04 system fails with >> > > >> > > Makefile:58: recipe for target 'media.pdf' failed >> > > make[2]: *** [media.pdf] Error 1 >> > > Documentation/Makefile.sphinx:79: recipe for target 'pdfdocs' failed >> > > make[1]: *** [pdfdocs] Error 2 >> > > Makefile:1442: recipe for target 'pdfdocs' failed >> > > make: *** [pdfdocs] Error 2 >> > > >> > > It's not clear from the voluminous (>5MB) output from make pdfdocs >> > > exactly which stage is failing, and there are some pdf files produced >> > > in output/latex. >> > >> > Hmm, so it does. It comes down to this: >> > >> > ! LaTeX Error: \DUrole undefined. >> > >> > See the LaTeX manual or LaTeX Companion for explanation. >> > Type H <return> for immediate help. >> > ... >> > >> > l.195 \renewcommand*{\DUrole} >> > [2]{ #2 } >> > >> > Where the offending command is in Documentation/media/index.rst. Mauro, >> > got an idea for what's going on there? >> >> Sphinx is really a poor solution when it comes to PDF output. In this >> specific case, this is meant to fix a problem with cross-references. >> >> What happens is that Sphinx 1.4.6 (and later?) define reference names without >> being properly escaped. So, for some references, it causes the PDF output >> to crash. That happens at one of the DVB header files, if I remember well. >> >> This commit restores the sphinx 1.2.x behavior: >> >> commit e61a39baf74dddb6cd236147bd19b55c10188d78 >> Author: Mauro Carvalho Chehab <mchehab@s-opensource.com> >> Date: Sun Aug 21 15:14:57 2016 -0300 >> >> [media] index.rst: Fix LaTeX error in interactive mode on Sphinx 1.4.x >> >> The Sphinx 1.4.x definition for \DUrole is: >> >> \providecommand*{\DUrole}[2]{% >> \ifcsname DUrole#1\endcsname% >> \csname DUrole#1\endcsname{#2}% >> \else% backwards compatibility: try \docutilsrole#1{#2} >> \ifcsname docutilsrole#1\endcsname% >> \csname docutilsrole#1\endcsname{#2}% >> \else% >> #2% >> \fi% >> \fi% >> } >> >> This is broken when it is used inside a \begin{alltt} block. >> So, replace it by just "#2", as this won't cause troubles, and >> it is one of the fallback methods for it. >> >> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> >> >> At the time I tested, it worked fine, but maybe it is redefining the >> \DUrole too late. >> >> Maybe we could move it to LaTeX preamble instead. Please check if this >> untested patch fixes the issue. > > Yes, this seems to be the case. The patch below should fix it. > > [PATCH] docs-rst: fix PDF build errors > > PDF build on Kernel 4.9-rc? returns an error. This is > because we're re-defining a command too late. Move > such redefinition to LaTeX preamble. > > Tested by building the documentation on interactive mode: > make PDFLATEX=xelatex -C Documentation/output/./latex > > Fixes: e61a39baf74d ("[media] index.rst: Fix LaTeX error in interactive mode on Sphinx 1.4.x") > > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> > > diff --git a/Documentation/conf.py b/Documentation/conf.py > index d9bad21dd427..d9ebfeb431a9 100644 > --- a/Documentation/conf.py > +++ b/Documentation/conf.py > @@ -329,6 +329,9 @@ latex_elements = { > % To allow adjusting table sizes > \\usepackage{adjustbox} > > + % Fix reference escape troubles with Sphinx 1.4.x > + \\renewcommand*{\\DUrole}[2]{ #2 } > + > ''' > } > > diff --git a/Documentation/media/index.rst b/Documentation/media/index.rst > index e347a3e7bdef..7f8f0af620ce 100644 > --- a/Documentation/media/index.rst > +++ b/Documentation/media/index.rst > @@ -1,11 +1,6 @@ > Linux Media Subsystem Documentation > =================================== > > -.. Sphinx 1.4.x has a definition for DUrole that doesn't work on alltt blocks > -.. raw:: latex > - > - \renewcommand*{\DUrole}[2]{ #2 } > - > Contents: > > .. toctree:: > > > > > Cheers, > Mauro After applying the patch I'm seeing a similar error message [...] Running Sphinx v1.3.1 [...] ! LaTeX Error: \DUrole undefined. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.79 ^^I\renewcommand*{\DUrole} [2]{ #2 } but in a different place Makefile:58: recipe for target 'development-process.pdf' failed make[2]: *** [development-process.pdf] Error 1 Documentation/Makefile.sphinx:79: recipe for target 'pdfdocs' failed It was failing with the media.pdf target before. And there was a development-process.pdf file created; it doesn't have the table of contents but from a quick look the actual text looks reasonable. -- Jim ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: make pdfdocs fails with v4.9-rc3 2016-10-31 22:04 ` Jim Davis @ 2016-10-31 22:40 ` Mauro Carvalho Chehab 2016-10-31 22:41 ` Mauro Carvalho Chehab 0 siblings, 1 reply; 11+ messages in thread From: Mauro Carvalho Chehab @ 2016-10-31 22:40 UTC (permalink / raw) To: Jim Davis; +Cc: Jonathan Corbet, linux-doc, linux-kernel Em Mon, 31 Oct 2016 15:04:42 -0700 Jim Davis <jim.epost@gmail.com> escreveu: > On Mon, Oct 31, 2016 at 1:58 PM, Mauro Carvalho Chehab > <mchehab@infradead.org> wrote: > > Em Mon, 31 Oct 2016 14:17:59 -0600 > > Mauro Carvalho Chehab <mchehab@infradead.org> escreveu: > > > >> Em Mon, 31 Oct 2016 13:15:24 -0600 > >> Jonathan Corbet <corbet@lwn.net> escreveu: > >> > >> > On Mon, 31 Oct 2016 11:51:20 -0700 > >> > Jim Davis <jim.epost@gmail.com> wrote: > >> > > >> > > Running make pdfdocs on a Ubuntu 16.04 system fails with > >> > > > >> > > Makefile:58: recipe for target 'media.pdf' failed > >> > > make[2]: *** [media.pdf] Error 1 > >> > > Documentation/Makefile.sphinx:79: recipe for target 'pdfdocs' failed > >> > > make[1]: *** [pdfdocs] Error 2 > >> > > Makefile:1442: recipe for target 'pdfdocs' failed > >> > > make: *** [pdfdocs] Error 2 > >> > > > >> > > It's not clear from the voluminous (>5MB) output from make pdfdocs > >> > > exactly which stage is failing, and there are some pdf files produced > >> > > in output/latex. > >> > > >> > Hmm, so it does. It comes down to this: > >> > > >> > ! LaTeX Error: \DUrole undefined. > >> > > >> > See the LaTeX manual or LaTeX Companion for explanation. > >> > Type H <return> for immediate help. > >> > ... > >> > > >> > l.195 \renewcommand*{\DUrole} > >> > [2]{ #2 } > >> > > >> > Where the offending command is in Documentation/media/index.rst. Mauro, > >> > got an idea for what's going on there? > >> > >> Sphinx is really a poor solution when it comes to PDF output. In this > >> specific case, this is meant to fix a problem with cross-references. > >> > >> What happens is that Sphinx 1.4.6 (and later?) define reference names without > >> being properly escaped. So, for some references, it causes the PDF output > >> to crash. That happens at one of the DVB header files, if I remember well. > >> > >> This commit restores the sphinx 1.2.x behavior: > >> > >> commit e61a39baf74dddb6cd236147bd19b55c10188d78 > >> Author: Mauro Carvalho Chehab <mchehab@s-opensource.com> > >> Date: Sun Aug 21 15:14:57 2016 -0300 > >> > >> [media] index.rst: Fix LaTeX error in interactive mode on Sphinx 1.4.x > >> > >> The Sphinx 1.4.x definition for \DUrole is: > >> > >> \providecommand*{\DUrole}[2]{% > >> \ifcsname DUrole#1\endcsname% > >> \csname DUrole#1\endcsname{#2}% > >> \else% backwards compatibility: try \docutilsrole#1{#2} > >> \ifcsname docutilsrole#1\endcsname% > >> \csname docutilsrole#1\endcsname{#2}% > >> \else% > >> #2% > >> \fi% > >> \fi% > >> } > >> > >> This is broken when it is used inside a \begin{alltt} block. > >> So, replace it by just "#2", as this won't cause troubles, and > >> it is one of the fallback methods for it. > >> > >> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> > >> > >> At the time I tested, it worked fine, but maybe it is redefining the > >> \DUrole too late. > >> > >> Maybe we could move it to LaTeX preamble instead. Please check if this > >> untested patch fixes the issue. > > > > Yes, this seems to be the case. The patch below should fix it. > > > > [PATCH] docs-rst: fix PDF build errors > > > > PDF build on Kernel 4.9-rc? returns an error. This is > > because we're re-defining a command too late. Move > > such redefinition to LaTeX preamble. > > > > Tested by building the documentation on interactive mode: > > make PDFLATEX=xelatex -C Documentation/output/./latex > > > > Fixes: e61a39baf74d ("[media] index.rst: Fix LaTeX error in interactive mode on Sphinx 1.4.x") > > > > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> > > > > diff --git a/Documentation/conf.py b/Documentation/conf.py > > index d9bad21dd427..d9ebfeb431a9 100644 > > --- a/Documentation/conf.py > > +++ b/Documentation/conf.py > > @@ -329,6 +329,9 @@ latex_elements = { > > % To allow adjusting table sizes > > \\usepackage{adjustbox} > > > > + % Fix reference escape troubles with Sphinx 1.4.x > > + \\renewcommand*{\\DUrole}[2]{ #2 } > > + > > ''' > > } > > > > diff --git a/Documentation/media/index.rst b/Documentation/media/index.rst > > index e347a3e7bdef..7f8f0af620ce 100644 > > --- a/Documentation/media/index.rst > > +++ b/Documentation/media/index.rst > > @@ -1,11 +1,6 @@ > > Linux Media Subsystem Documentation > > =================================== > > > > -.. Sphinx 1.4.x has a definition for DUrole that doesn't work on alltt blocks > > -.. raw:: latex > > - > > - \renewcommand*{\DUrole}[2]{ #2 } > > - > > Contents: > > > > .. toctree:: > > > > > > > > > > Cheers, > > Mauro > > After applying the patch I'm seeing a similar error message > > [...] > Running Sphinx v1.3.1 > [...] Ah! you're running version 1.3.1... We should likely add some logic at conf.py to only enable this on Sphinx 1.4.x... Cheers, Mauro ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: make pdfdocs fails with v4.9-rc3 2016-10-31 22:40 ` Mauro Carvalho Chehab @ 2016-10-31 22:41 ` Mauro Carvalho Chehab 2016-11-01 4:51 ` Mauro Carvalho Chehab 2016-11-01 22:11 ` Jim Davis 0 siblings, 2 replies; 11+ messages in thread From: Mauro Carvalho Chehab @ 2016-10-31 22:41 UTC (permalink / raw) To: Jim Davis; +Cc: Jonathan Corbet, linux-doc, linux-kernel Em Mon, 31 Oct 2016 16:40:02 -0600 Mauro Carvalho Chehab <mchehab@infradead.org> escreveu: > Em Mon, 31 Oct 2016 15:04:42 -0700 > Jim Davis <jim.epost@gmail.com> escreveu: > > > On Mon, Oct 31, 2016 at 1:58 PM, Mauro Carvalho Chehab > > <mchehab@infradead.org> wrote: > > > Em Mon, 31 Oct 2016 14:17:59 -0600 > > > Mauro Carvalho Chehab <mchehab@infradead.org> escreveu: > > > > > >> Em Mon, 31 Oct 2016 13:15:24 -0600 > > >> Jonathan Corbet <corbet@lwn.net> escreveu: > > >> > > >> > On Mon, 31 Oct 2016 11:51:20 -0700 > > >> > Jim Davis <jim.epost@gmail.com> wrote: > > >> > > > >> > > Running make pdfdocs on a Ubuntu 16.04 system fails with > > >> > > > > >> > > Makefile:58: recipe for target 'media.pdf' failed > > >> > > make[2]: *** [media.pdf] Error 1 > > >> > > Documentation/Makefile.sphinx:79: recipe for target 'pdfdocs' failed > > >> > > make[1]: *** [pdfdocs] Error 2 > > >> > > Makefile:1442: recipe for target 'pdfdocs' failed > > >> > > make: *** [pdfdocs] Error 2 > > >> > > > > >> > > It's not clear from the voluminous (>5MB) output from make pdfdocs > > >> > > exactly which stage is failing, and there are some pdf files produced > > >> > > in output/latex. > > >> > > > >> > Hmm, so it does. It comes down to this: > > >> > > > >> > ! LaTeX Error: \DUrole undefined. > > >> > > > >> > See the LaTeX manual or LaTeX Companion for explanation. > > >> > Type H <return> for immediate help. > > >> > ... > > >> > > > >> > l.195 \renewcommand*{\DUrole} > > >> > [2]{ #2 } > > >> > > > >> > Where the offending command is in Documentation/media/index.rst. Mauro, > > >> > got an idea for what's going on there? > > >> > > >> Sphinx is really a poor solution when it comes to PDF output. In this > > >> specific case, this is meant to fix a problem with cross-references. > > >> > > >> What happens is that Sphinx 1.4.6 (and later?) define reference names without > > >> being properly escaped. So, for some references, it causes the PDF output > > >> to crash. That happens at one of the DVB header files, if I remember well. > > >> > > >> This commit restores the sphinx 1.2.x behavior: > > >> > > >> commit e61a39baf74dddb6cd236147bd19b55c10188d78 > > >> Author: Mauro Carvalho Chehab <mchehab@s-opensource.com> > > >> Date: Sun Aug 21 15:14:57 2016 -0300 > > >> > > >> [media] index.rst: Fix LaTeX error in interactive mode on Sphinx 1.4.x > > >> > > >> The Sphinx 1.4.x definition for \DUrole is: > > >> > > >> \providecommand*{\DUrole}[2]{% > > >> \ifcsname DUrole#1\endcsname% > > >> \csname DUrole#1\endcsname{#2}% > > >> \else% backwards compatibility: try \docutilsrole#1{#2} > > >> \ifcsname docutilsrole#1\endcsname% > > >> \csname docutilsrole#1\endcsname{#2}% > > >> \else% > > >> #2% > > >> \fi% > > >> \fi% > > >> } > > >> > > >> This is broken when it is used inside a \begin{alltt} block. > > >> So, replace it by just "#2", as this won't cause troubles, and > > >> it is one of the fallback methods for it. > > >> > > >> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> > > >> > > >> At the time I tested, it worked fine, but maybe it is redefining the > > >> \DUrole too late. > > >> > > >> Maybe we could move it to LaTeX preamble instead. Please check if this > > >> untested patch fixes the issue. > > > > > > Yes, this seems to be the case. The patch below should fix it. > > > > > > [PATCH] docs-rst: fix PDF build errors > > > > > > PDF build on Kernel 4.9-rc? returns an error. This is > > > because we're re-defining a command too late. Move > > > such redefinition to LaTeX preamble. > > > > > > Tested by building the documentation on interactive mode: > > > make PDFLATEX=xelatex -C Documentation/output/./latex > > > > > > Fixes: e61a39baf74d ("[media] index.rst: Fix LaTeX error in interactive mode on Sphinx 1.4.x") > > > > > > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> > > > > > > diff --git a/Documentation/conf.py b/Documentation/conf.py > > > index d9bad21dd427..d9ebfeb431a9 100644 > > > --- a/Documentation/conf.py > > > +++ b/Documentation/conf.py > > > @@ -329,6 +329,9 @@ latex_elements = { > > > % To allow adjusting table sizes > > > \\usepackage{adjustbox} > > > > > > + % Fix reference escape troubles with Sphinx 1.4.x > > > + \\renewcommand*{\\DUrole}[2]{ #2 } > > > + > > > ''' > > > } > > > > > > diff --git a/Documentation/media/index.rst b/Documentation/media/index.rst > > > index e347a3e7bdef..7f8f0af620ce 100644 > > > --- a/Documentation/media/index.rst > > > +++ b/Documentation/media/index.rst > > > @@ -1,11 +1,6 @@ > > > Linux Media Subsystem Documentation > > > =================================== > > > > > > -.. Sphinx 1.4.x has a definition for DUrole that doesn't work on alltt blocks > > > -.. raw:: latex > > > - > > > - \renewcommand*{\DUrole}[2]{ #2 } > > > - > > > Contents: > > > > > > .. toctree:: > > > > > > > > > > > > > > > Cheers, > > > Mauro > > > > After applying the patch I'm seeing a similar error message > > > > [...] > > Running Sphinx v1.3.1 > > [...] > > Ah! you're running version 1.3.1... > > We should likely add some logic at conf.py to only enable this on > Sphinx 1.4.x... Could you please apply just the hook that remove the index.rst raw LaTeX command and see if it will build fine in interactive mode? Cheers, Mauro ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: make pdfdocs fails with v4.9-rc3 2016-10-31 22:41 ` Mauro Carvalho Chehab @ 2016-11-01 4:51 ` Mauro Carvalho Chehab 2016-11-01 22:11 ` Jim Davis 1 sibling, 0 replies; 11+ messages in thread From: Mauro Carvalho Chehab @ 2016-11-01 4:51 UTC (permalink / raw) To: Jim Davis; +Cc: Jonathan Corbet, linux-doc, linux-kernel Em Mon, 31 Oct 2016 16:41:48 -0600 Mauro Carvalho Chehab <mchehab@infradead.org> escreveu: > Em Mon, 31 Oct 2016 16:40:02 -0600 > Mauro Carvalho Chehab <mchehab@infradead.org> escreveu: > > > Em Mon, 31 Oct 2016 15:04:42 -0700 > > Jim Davis <jim.epost@gmail.com> escreveu: > > > > > On Mon, Oct 31, 2016 at 1:58 PM, Mauro Carvalho Chehab > > > <mchehab@infradead.org> wrote: > > > > Em Mon, 31 Oct 2016 14:17:59 -0600 > > > > Mauro Carvalho Chehab <mchehab@infradead.org> escreveu: > > > > > > > >> Em Mon, 31 Oct 2016 13:15:24 -0600 > > > >> Jonathan Corbet <corbet@lwn.net> escreveu: > > > >> > > > >> > On Mon, 31 Oct 2016 11:51:20 -0700 > > > >> > Jim Davis <jim.epost@gmail.com> wrote: > > > >> > > > > >> > > Running make pdfdocs on a Ubuntu 16.04 system fails with > > > >> > > > > > >> > > Makefile:58: recipe for target 'media.pdf' failed > > > >> > > make[2]: *** [media.pdf] Error 1 > > > >> > > Documentation/Makefile.sphinx:79: recipe for target 'pdfdocs' failed > > > >> > > make[1]: *** [pdfdocs] Error 2 > > > >> > > Makefile:1442: recipe for target 'pdfdocs' failed > > > >> > > make: *** [pdfdocs] Error 2 > > > >> > > > > > >> > > It's not clear from the voluminous (>5MB) output from make pdfdocs > > > >> > > exactly which stage is failing, and there are some pdf files produced > > > >> > > in output/latex. > > > >> > > > > >> > Hmm, so it does. It comes down to this: > > > >> > > > > >> > ! LaTeX Error: \DUrole undefined. > > > >> > > > > >> > See the LaTeX manual or LaTeX Companion for explanation. > > > >> > Type H <return> for immediate help. > > > >> > ... > > > >> > > > > >> > l.195 \renewcommand*{\DUrole} > > > >> > [2]{ #2 } > > > >> > > > > >> > Where the offending command is in Documentation/media/index.rst. Mauro, > > > >> > got an idea for what's going on there? > > > >> > > > >> Sphinx is really a poor solution when it comes to PDF output. In this > > > >> specific case, this is meant to fix a problem with cross-references. > > > >> > > > >> What happens is that Sphinx 1.4.6 (and later?) define reference names without > > > >> being properly escaped. So, for some references, it causes the PDF output > > > >> to crash. That happens at one of the DVB header files, if I remember well. > > > >> > > > >> This commit restores the sphinx 1.2.x behavior: > > > >> > > > >> commit e61a39baf74dddb6cd236147bd19b55c10188d78 > > > >> Author: Mauro Carvalho Chehab <mchehab@s-opensource.com> > > > >> Date: Sun Aug 21 15:14:57 2016 -0300 > > > >> > > > >> [media] index.rst: Fix LaTeX error in interactive mode on Sphinx 1.4.x > > > >> > > > >> The Sphinx 1.4.x definition for \DUrole is: > > > >> > > > >> \providecommand*{\DUrole}[2]{% > > > >> \ifcsname DUrole#1\endcsname% > > > >> \csname DUrole#1\endcsname{#2}% > > > >> \else% backwards compatibility: try \docutilsrole#1{#2} > > > >> \ifcsname docutilsrole#1\endcsname% > > > >> \csname docutilsrole#1\endcsname{#2}% > > > >> \else% > > > >> #2% > > > >> \fi% > > > >> \fi% > > > >> } > > > >> > > > >> This is broken when it is used inside a \begin{alltt} block. > > > >> So, replace it by just "#2", as this won't cause troubles, and > > > >> it is one of the fallback methods for it. > > > >> > > > >> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> > > > >> > > > >> At the time I tested, it worked fine, but maybe it is redefining the > > > >> \DUrole too late. > > > >> > > > >> Maybe we could move it to LaTeX preamble instead. Please check if this > > > >> untested patch fixes the issue. > > > > > > > > Yes, this seems to be the case. The patch below should fix it. > > > > > > > > [PATCH] docs-rst: fix PDF build errors > > > > > > > > PDF build on Kernel 4.9-rc? returns an error. This is > > > > because we're re-defining a command too late. Move > > > > such redefinition to LaTeX preamble. > > > > > > > > Tested by building the documentation on interactive mode: > > > > make PDFLATEX=xelatex -C Documentation/output/./latex > > > > > > > > Fixes: e61a39baf74d ("[media] index.rst: Fix LaTeX error in interactive mode on Sphinx 1.4.x") > > > > > > > > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> > > > > > > > > diff --git a/Documentation/conf.py b/Documentation/conf.py > > > > index d9bad21dd427..d9ebfeb431a9 100644 > > > > --- a/Documentation/conf.py > > > > +++ b/Documentation/conf.py > > > > @@ -329,6 +329,9 @@ latex_elements = { > > > > % To allow adjusting table sizes > > > > \\usepackage{adjustbox} > > > > > > > > + % Fix reference escape troubles with Sphinx 1.4.x > > > > + \\renewcommand*{\\DUrole}[2]{ #2 } > > > > + > > > > ''' > > > > } > > > > > > > > diff --git a/Documentation/media/index.rst b/Documentation/media/index.rst > > > > index e347a3e7bdef..7f8f0af620ce 100644 > > > > --- a/Documentation/media/index.rst > > > > +++ b/Documentation/media/index.rst > > > > @@ -1,11 +1,6 @@ > > > > Linux Media Subsystem Documentation > > > > =================================== > > > > > > > > -.. Sphinx 1.4.x has a definition for DUrole that doesn't work on alltt blocks > > > > -.. raw:: latex > > > > - > > > > - \renewcommand*{\DUrole}[2]{ #2 } > > > > - > > > > Contents: > > > > > > > > .. toctree:: > > > > > > > > > > > > > > > > > > > > Cheers, > > > > Mauro > > > > > > After applying the patch I'm seeing a similar error message > > > > > > [...] > > > Running Sphinx v1.3.1 > > > [...] > > > > Ah! you're running version 1.3.1... > > > > We should likely add some logic at conf.py to only enable this on > > Sphinx 1.4.x... > > Could you please apply just the hook that remove the index.rst > raw LaTeX command and see if it will build fine in interactive > mode? > > Cheers, > Mauro I'm not a python programmer, but, after playing with conf.py for a while, I guess that the following patch should do the right thing applying the LaTeX fix only for Sphinx 1.4.x. --- [PATCH v2] docs-rst: fix PDF build errors PDF build on Kernel 4.9-rc? returns an error. This is because we're re-defining a command too late. Move such redefinition to LaTeX preamble. Tested by building the documentation on interactive mode: make PDFLATEX=xelatex -C Documentation/output/./latex Fixes: e61a39baf74d ("[media] index.rst: Fix LaTeX error in interactive mode on Sphinx 1.4.x") Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> diff --git a/Documentation/conf.py b/Documentation/conf.py index d9bad21dd427..375b61c25df2 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -332,6 +332,10 @@ latex_elements = { ''' } +# Fix reference escape troubles with Sphinx 1.4.x +if minor > 3: + latex_elements['preamble'] += '\\renewcommand*{\\DUrole}[2]{ #2 }' + # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). diff --git a/Documentation/media/index.rst b/Documentation/media/index.rst index e347a3e7bdef..7f8f0af620ce 100644 --- a/Documentation/media/index.rst +++ b/Documentation/media/index.rst @@ -1,11 +1,6 @@ Linux Media Subsystem Documentation =================================== -.. Sphinx 1.4.x has a definition for DUrole that doesn't work on alltt blocks -.. raw:: latex - - \renewcommand*{\DUrole}[2]{ #2 } - Contents: .. toctree:: Cheers, Mauro ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: make pdfdocs fails with v4.9-rc3 2016-10-31 22:41 ` Mauro Carvalho Chehab 2016-11-01 4:51 ` Mauro Carvalho Chehab @ 2016-11-01 22:11 ` Jim Davis 2016-11-01 22:49 ` Mauro Carvalho Chehab 2016-11-02 14:42 ` Markus Heiser 1 sibling, 2 replies; 11+ messages in thread From: Jim Davis @ 2016-11-01 22:11 UTC (permalink / raw) To: Mauro Carvalho Chehab; +Cc: Jonathan Corbet, linux-doc, linux-kernel On Mon, Oct 31, 2016 at 3:41 PM, Mauro Carvalho Chehab <mchehab@infradead.org> wrote: > Em Mon, 31 Oct 2016 16:40:02 -0600 > Mauro Carvalho Chehab <mchehab@infradead.org> escreveu: > >> Em Mon, 31 Oct 2016 15:04:42 -0700 >> Jim Davis <jim.epost@gmail.com> escreveu: >> >> > On Mon, Oct 31, 2016 at 1:58 PM, Mauro Carvalho Chehab >> > <mchehab@infradead.org> wrote: >> > > Em Mon, 31 Oct 2016 14:17:59 -0600 >> > > Mauro Carvalho Chehab <mchehab@infradead.org> escreveu: >> > > >> > >> Em Mon, 31 Oct 2016 13:15:24 -0600 >> > >> Jonathan Corbet <corbet@lwn.net> escreveu: >> > >> >> > >> > On Mon, 31 Oct 2016 11:51:20 -0700 >> > >> > Jim Davis <jim.epost@gmail.com> wrote: >> > >> > >> > >> > > Running make pdfdocs on a Ubuntu 16.04 system fails with >> > >> > > >> > >> > > Makefile:58: recipe for target 'media.pdf' failed >> > >> > > make[2]: *** [media.pdf] Error 1 >> > >> > > Documentation/Makefile.sphinx:79: recipe for target 'pdfdocs' failed >> > >> > > make[1]: *** [pdfdocs] Error 2 >> > >> > > Makefile:1442: recipe for target 'pdfdocs' failed >> > >> > > make: *** [pdfdocs] Error 2 >> > >> > > >> > >> > > It's not clear from the voluminous (>5MB) output from make pdfdocs >> > >> > > exactly which stage is failing, and there are some pdf files produced >> > >> > > in output/latex. >> > >> > >> > >> > Hmm, so it does. It comes down to this: >> > >> > >> > >> > ! LaTeX Error: \DUrole undefined. >> > >> > >> > >> > See the LaTeX manual or LaTeX Companion for explanation. >> > >> > Type H <return> for immediate help. >> > >> > ... >> > >> > >> > >> > l.195 \renewcommand*{\DUrole} >> > >> > [2]{ #2 } >> > >> > >> > >> > Where the offending command is in Documentation/media/index.rst. Mauro, >> > >> > got an idea for what's going on there? >> > >> >> > >> Sphinx is really a poor solution when it comes to PDF output. In this >> > >> specific case, this is meant to fix a problem with cross-references. >> > >> >> > >> What happens is that Sphinx 1.4.6 (and later?) define reference names without >> > >> being properly escaped. So, for some references, it causes the PDF output >> > >> to crash. That happens at one of the DVB header files, if I remember well. >> > >> >> > >> This commit restores the sphinx 1.2.x behavior: >> > >> >> > >> commit e61a39baf74dddb6cd236147bd19b55c10188d78 >> > >> Author: Mauro Carvalho Chehab <mchehab@s-opensource.com> >> > >> Date: Sun Aug 21 15:14:57 2016 -0300 >> > >> >> > >> [media] index.rst: Fix LaTeX error in interactive mode on Sphinx 1.4.x >> > >> >> > >> The Sphinx 1.4.x definition for \DUrole is: >> > >> >> > >> \providecommand*{\DUrole}[2]{% >> > >> \ifcsname DUrole#1\endcsname% >> > >> \csname DUrole#1\endcsname{#2}% >> > >> \else% backwards compatibility: try \docutilsrole#1{#2} >> > >> \ifcsname docutilsrole#1\endcsname% >> > >> \csname docutilsrole#1\endcsname{#2}% >> > >> \else% >> > >> #2% >> > >> \fi% >> > >> \fi% >> > >> } >> > >> >> > >> This is broken when it is used inside a \begin{alltt} block. >> > >> So, replace it by just "#2", as this won't cause troubles, and >> > >> it is one of the fallback methods for it. >> > >> >> > >> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> >> > >> >> > >> At the time I tested, it worked fine, but maybe it is redefining the >> > >> \DUrole too late. >> > >> >> > >> Maybe we could move it to LaTeX preamble instead. Please check if this >> > >> untested patch fixes the issue. >> > > >> > > Yes, this seems to be the case. The patch below should fix it. >> > > >> > > [PATCH] docs-rst: fix PDF build errors >> > > >> > > PDF build on Kernel 4.9-rc? returns an error. This is >> > > because we're re-defining a command too late. Move >> > > such redefinition to LaTeX preamble. >> > > >> > > Tested by building the documentation on interactive mode: >> > > make PDFLATEX=xelatex -C Documentation/output/./latex >> > > >> > > Fixes: e61a39baf74d ("[media] index.rst: Fix LaTeX error in interactive mode on Sphinx 1.4.x") >> > > >> > > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> >> > > >> > > diff --git a/Documentation/conf.py b/Documentation/conf.py >> > > index d9bad21dd427..d9ebfeb431a9 100644 >> > > --- a/Documentation/conf.py >> > > +++ b/Documentation/conf.py >> > > @@ -329,6 +329,9 @@ latex_elements = { >> > > % To allow adjusting table sizes >> > > \\usepackage{adjustbox} >> > > >> > > + % Fix reference escape troubles with Sphinx 1.4.x >> > > + \\renewcommand*{\\DUrole}[2]{ #2 } >> > > + >> > > ''' >> > > } >> > > >> > > diff --git a/Documentation/media/index.rst b/Documentation/media/index.rst >> > > index e347a3e7bdef..7f8f0af620ce 100644 >> > > --- a/Documentation/media/index.rst >> > > +++ b/Documentation/media/index.rst >> > > @@ -1,11 +1,6 @@ >> > > Linux Media Subsystem Documentation >> > > =================================== >> > > >> > > -.. Sphinx 1.4.x has a definition for DUrole that doesn't work on alltt blocks >> > > -.. raw:: latex >> > > - >> > > - \renewcommand*{\DUrole}[2]{ #2 } >> > > - >> > > Contents: >> > > >> > > .. toctree:: >> > > >> > > >> > > >> > > >> > > Cheers, >> > > Mauro >> > >> > After applying the patch I'm seeing a similar error message >> > >> > [...] >> > Running Sphinx v1.3.1 >> > [...] >> >> Ah! you're running version 1.3.1... >> >> We should likely add some logic at conf.py to only enable this on >> Sphinx 1.4.x... > > Could you please apply just the hook that remove the index.rst > raw LaTeX command and see if it will build fine in interactive > mode? With jim@krebstar:~/linux-rc/Documentation/media$ git diff diff --git a/Documentation/media/index.rst b/Documentation/media/index.rst index e347a3e7bdef..7f8f0af620ce 100644 --- a/Documentation/media/index.rst +++ b/Documentation/media/index.rst @@ -1,11 +1,6 @@ Linux Media Subsystem Documentation =================================== -.. Sphinx 1.4.x has a definition for DUrole that doesn't work on alltt bloc ks -.. raw:: latex - - \renewcommand*{\DUrole}[2]{ #2 } - Contents: .. toctree:: I'm still getting Makefile:58: recipe for target 'media.pdf' failed make[2]: *** [media.pdf] Error 1 Documentation/Makefile.sphinx:79: recipe for target 'pdfdocs' failed make[1]: *** [pdfdocs] Error 2 Makefile:1442: recipe for target 'pdfdocs' failed make: *** [pdfdocs] Error 2 after running make pdfdocs. Sorry, I don't quite understand what running interactively means in this case, though from the log of make pdfdocs's output there's make PDFLATEX=xelatex LATEXOPTS="-interaction=nonstopmode" -C Documentation/output/./latex which looks similar to something you mentioned above. I've no idea where's it's going astray, though there are a number of errors: jim@krebstar:~$ grep '^!' /tmp/make-pdfdocs.txt | sort -u ! Argument of \LT@max@sel has an extra }. ! Extra alignment tab has been changed to \cr. ! Extra \endcsname. ! Extra \endgroup. ! Illegal unit of measure (pt inserted). ! Improper alphabetic constant. ! LaTeX Error: \begin{document} ended by \end{adjustbox}. ! LaTeX Error: \begin{document} ended by \end{longtable}. ! LaTeX Error: Something's wrong--perhaps a missing \item. ! LaTeX Error: There's no line here to end. ! Misplaced \noalign. ! Missing \endcsname inserted. ! Missing \endgroup inserted. ! Missing { inserted. ! Missing } inserted. ! Missing # inserted in alignment preamble. ! Missing number, treated as zero. ! Paragraph ended before \LT@entry was complete. ! Paragraph ended before \LT@max@sel was complete. ! Paragraph ended before \multicolumn was complete. ! Undefined control sequence. ! You can't use `\hrule' here except wi -- Jim ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: make pdfdocs fails with v4.9-rc3 2016-11-01 22:11 ` Jim Davis @ 2016-11-01 22:49 ` Mauro Carvalho Chehab 2016-11-02 14:42 ` Markus Heiser 1 sibling, 0 replies; 11+ messages in thread From: Mauro Carvalho Chehab @ 2016-11-01 22:49 UTC (permalink / raw) To: Jim Davis; +Cc: Jonathan Corbet, linux-doc, linux-kernel Em Tue, 1 Nov 2016 15:11:55 -0700 Jim Davis <jim.epost@gmail.com> escreveu: > On Mon, Oct 31, 2016 at 3:41 PM, Mauro Carvalho Chehab > <mchehab@infradead.org> wrote: > > Em Mon, 31 Oct 2016 16:40:02 -0600 > > Mauro Carvalho Chehab <mchehab@infradead.org> escreveu: > > > >> Em Mon, 31 Oct 2016 15:04:42 -0700 > >> Jim Davis <jim.epost@gmail.com> escreveu: > >> > >> > On Mon, Oct 31, 2016 at 1:58 PM, Mauro Carvalho Chehab > >> > <mchehab@infradead.org> wrote: > >> > > Em Mon, 31 Oct 2016 14:17:59 -0600 > >> > > Mauro Carvalho Chehab <mchehab@infradead.org> escreveu: > >> > > > >> > >> Em Mon, 31 Oct 2016 13:15:24 -0600 > >> > >> Jonathan Corbet <corbet@lwn.net> escreveu: > >> > >> > >> > >> > On Mon, 31 Oct 2016 11:51:20 -0700 > >> > >> > Jim Davis <jim.epost@gmail.com> wrote: > >> > >> > > >> > >> > > Running make pdfdocs on a Ubuntu 16.04 system fails with > >> > >> > > > >> > >> > > Makefile:58: recipe for target 'media.pdf' failed > >> > >> > > make[2]: *** [media.pdf] Error 1 > >> > >> > > Documentation/Makefile.sphinx:79: recipe for target 'pdfdocs' failed > >> > >> > > make[1]: *** [pdfdocs] Error 2 > >> > >> > > Makefile:1442: recipe for target 'pdfdocs' failed > >> > >> > > make: *** [pdfdocs] Error 2 > >> > >> > > > >> > >> > > It's not clear from the voluminous (>5MB) output from make pdfdocs > >> > >> > > exactly which stage is failing, and there are some pdf files produced > >> > >> > > in output/latex. > >> > >> > > >> > >> > Hmm, so it does. It comes down to this: > >> > >> > > >> > >> > ! LaTeX Error: \DUrole undefined. > >> > >> > > >> > >> > See the LaTeX manual or LaTeX Companion for explanation. > >> > >> > Type H <return> for immediate help. > >> > >> > ... > >> > >> > > >> > >> > l.195 \renewcommand*{\DUrole} > >> > >> > [2]{ #2 } > >> > >> > > >> > >> > Where the offending command is in Documentation/media/index.rst. Mauro, > >> > >> > got an idea for what's going on there? > >> > >> > >> > >> Sphinx is really a poor solution when it comes to PDF output. In this > >> > >> specific case, this is meant to fix a problem with cross-references. > >> > >> > >> > >> What happens is that Sphinx 1.4.6 (and later?) define reference names without > >> > >> being properly escaped. So, for some references, it causes the PDF output > >> > >> to crash. That happens at one of the DVB header files, if I remember well. > >> > >> > >> > >> This commit restores the sphinx 1.2.x behavior: > >> > >> > >> > >> commit e61a39baf74dddb6cd236147bd19b55c10188d78 > >> > >> Author: Mauro Carvalho Chehab <mchehab@s-opensource.com> > >> > >> Date: Sun Aug 21 15:14:57 2016 -0300 > >> > >> > >> > >> [media] index.rst: Fix LaTeX error in interactive mode on Sphinx 1.4.x > >> > >> > >> > >> The Sphinx 1.4.x definition for \DUrole is: > >> > >> > >> > >> \providecommand*{\DUrole}[2]{% > >> > >> \ifcsname DUrole#1\endcsname% > >> > >> \csname DUrole#1\endcsname{#2}% > >> > >> \else% backwards compatibility: try \docutilsrole#1{#2} > >> > >> \ifcsname docutilsrole#1\endcsname% > >> > >> \csname docutilsrole#1\endcsname{#2}% > >> > >> \else% > >> > >> #2% > >> > >> \fi% > >> > >> \fi% > >> > >> } > >> > >> > >> > >> This is broken when it is used inside a \begin{alltt} block. > >> > >> So, replace it by just "#2", as this won't cause troubles, and > >> > >> it is one of the fallback methods for it. > >> > >> > >> > >> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> > >> > >> > >> > >> At the time I tested, it worked fine, but maybe it is redefining the > >> > >> \DUrole too late. > >> > >> > >> > >> Maybe we could move it to LaTeX preamble instead. Please check if this > >> > >> untested patch fixes the issue. > >> > > > >> > > Yes, this seems to be the case. The patch below should fix it. > >> > > > >> > > [PATCH] docs-rst: fix PDF build errors > >> > > > >> > > PDF build on Kernel 4.9-rc? returns an error. This is > >> > > because we're re-defining a command too late. Move > >> > > such redefinition to LaTeX preamble. > >> > > > >> > > Tested by building the documentation on interactive mode: > >> > > make PDFLATEX=xelatex -C Documentation/output/./latex > >> > > > >> > > Fixes: e61a39baf74d ("[media] index.rst: Fix LaTeX error in interactive mode on Sphinx 1.4.x") > >> > > > >> > > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> > >> > > > >> > > diff --git a/Documentation/conf.py b/Documentation/conf.py > >> > > index d9bad21dd427..d9ebfeb431a9 100644 > >> > > --- a/Documentation/conf.py > >> > > +++ b/Documentation/conf.py > >> > > @@ -329,6 +329,9 @@ latex_elements = { > >> > > % To allow adjusting table sizes > >> > > \\usepackage{adjustbox} > >> > > > >> > > + % Fix reference escape troubles with Sphinx 1.4.x > >> > > + \\renewcommand*{\\DUrole}[2]{ #2 } > >> > > + > >> > > ''' > >> > > } > >> > > > >> > > diff --git a/Documentation/media/index.rst b/Documentation/media/index.rst > >> > > index e347a3e7bdef..7f8f0af620ce 100644 > >> > > --- a/Documentation/media/index.rst > >> > > +++ b/Documentation/media/index.rst > >> > > @@ -1,11 +1,6 @@ > >> > > Linux Media Subsystem Documentation > >> > > =================================== > >> > > > >> > > -.. Sphinx 1.4.x has a definition for DUrole that doesn't work on alltt blocks > >> > > -.. raw:: latex > >> > > - > >> > > - \renewcommand*{\DUrole}[2]{ #2 } > >> > > - > >> > > Contents: > >> > > > >> > > .. toctree:: > >> > > > >> > > > >> > > > >> > > > >> > > Cheers, > >> > > Mauro > >> > > >> > After applying the patch I'm seeing a similar error message > >> > > >> > [...] > >> > Running Sphinx v1.3.1 > >> > [...] > >> > >> Ah! you're running version 1.3.1... > >> > >> We should likely add some logic at conf.py to only enable this on > >> Sphinx 1.4.x... > > > > Could you please apply just the hook that remove the index.rst > > raw LaTeX command and see if it will build fine in interactive > > mode? > > With > > jim@krebstar:~/linux-rc/Documentation/media$ git diff > diff --git a/Documentation/media/index.rst b/Documentation/media/index.rst > index e347a3e7bdef..7f8f0af620ce 100644 > --- a/Documentation/media/index.rst > +++ b/Documentation/media/index.rst > @@ -1,11 +1,6 @@ > Linux Media Subsystem Documentation > =================================== > > -.. Sphinx 1.4.x has a definition for DUrole that doesn't work on alltt bloc > ks > -.. raw:: latex > - > - \renewcommand*{\DUrole}[2]{ #2 } > - > Contents: > > .. toctree:: > > I'm still getting > > Makefile:58: recipe for target 'media.pdf' failed > make[2]: *** [media.pdf] Error 1 > Documentation/Makefile.sphinx:79: recipe for target 'pdfdocs' failed > make[1]: *** [pdfdocs] Error 2 > Makefile:1442: recipe for target 'pdfdocs' failed > make: *** [pdfdocs] Error 2 > > after running make pdfdocs. Sorry, I don't quite understand what > running interactively means in this case, though from the log of make > pdfdocs's output there's Well, xelatex has a few modes of operation: -interaction=STRING set interaction mode (STRING=batchmode/nonstopmode/ scrollmode/errorstopmode) on batchmode, it doesn't complain about any errors, but doesn't produce any error. On the default mode (errorstopmode), it will stop on the first error. > > make PDFLATEX=xelatex LATEXOPTS="-interaction=nonstopmode" -C > Documentation/output/./latex > > which looks similar to something you mentioned above. > > I've no idea where's it's going astray, though there are a number of errors: > > jim@krebstar:~$ grep '^!' /tmp/make-pdfdocs.txt | sort -u > ! Argument of \LT@max@sel has an extra }. > ! Extra alignment tab has been changed to \cr. Ok, but this one is on another place ;) If it is the same issue that happened on Sphinx 1.4.x, it is due to the lack of some column specification on a .. tabularcolumn markup. I have already a series fixing all errors with PDF on 1.4.x. Just submitted. Please check it it makes ok on Sphinx 1.3.x. Cheers, Mauro ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: make pdfdocs fails with v4.9-rc3 2016-11-01 22:11 ` Jim Davis 2016-11-01 22:49 ` Mauro Carvalho Chehab @ 2016-11-02 14:42 ` Markus Heiser 1 sibling, 0 replies; 11+ messages in thread From: Markus Heiser @ 2016-11-02 14:42 UTC (permalink / raw) To: Jim Davis Cc: Mauro Carvalho Chehab, Jonathan Corbet, linux-doc List, linux-kernel List, Jani Nikula Am 01.11.2016 um 23:11 schrieb Jim Davis <jim.epost@gmail.com>: > On Mon, Oct 31, 2016 at 3:41 PM, Mauro Carvalho Chehab > <mchehab@infradead.org> wrote: >> Em Mon, 31 Oct 2016 16:40:02 -0600 >> Mauro Carvalho Chehab <mchehab@infradead.org> escreveu: >> >>> Em Mon, 31 Oct 2016 15:04:42 -0700 >>> Jim Davis <jim.epost@gmail.com> escreveu: > > I've no idea where's it's going astray, though there are a number of errors: > > jim@krebstar:~$ grep '^!' /tmp/make-pdfdocs.txt | sort -u > ! Argument of \LT@max@sel has an extra }. > ! Extra alignment tab has been changed to \cr. > ! Extra \endcsname. > ! Extra \endgroup. > ! Illegal unit of measure (pt inserted). > ! Improper alphabetic constant. > ! LaTeX Error: \begin{document} ended by \end{adjustbox}. > ! LaTeX Error: \begin{document} ended by \end{longtable}. > ! LaTeX Error: Something's wrong--perhaps a missing \item. > ! LaTeX Error: There's no line here to end. > ! Misplaced \noalign. > ! Missing \endcsname inserted. > ! Missing \endgroup inserted. > ! Missing { inserted. > ! Missing } inserted. > ! Missing # inserted in alignment preamble. > ! Missing number, treated as zero. > ! Paragraph ended before \LT@entry was complete. > ! Paragraph ended before \LT@max@sel was complete. > ! Paragraph ended before \multicolumn was complete. > ! Undefined control sequence. > ! You can't use `\hrule' here except wi > FYI: as far as I know those "!LaTeX Error" messages cause TeX to end with an error code which stops the make build. Since we are not in an interactive mode, xelatex continues after each "!LaTeX Error" messages and builds the pdf to its end (even if the content might be broken).. and then, it ends with exit status !=0. In those cases (make build stops), we have to study the log file. BTW: I prefer Jani's solution, using the "batchmode" [1] and if a pdf build fails, I have to read the *.log file in the latex output folder searching for those "!LaTeX Error". [1] https://www.mail-archive.com/linux-doc@vger.kernel.org/msg07462.html --Markus-- ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2016-11-02 14:42 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-10-31 18:51 make pdfdocs fails with v4.9-rc3 Jim Davis 2016-10-31 19:15 ` Jonathan Corbet 2016-10-31 20:17 ` Mauro Carvalho Chehab 2016-10-31 20:58 ` Mauro Carvalho Chehab 2016-10-31 22:04 ` Jim Davis 2016-10-31 22:40 ` Mauro Carvalho Chehab 2016-10-31 22:41 ` Mauro Carvalho Chehab 2016-11-01 4:51 ` Mauro Carvalho Chehab 2016-11-01 22:11 ` Jim Davis 2016-11-01 22:49 ` Mauro Carvalho Chehab 2016-11-02 14:42 ` Markus Heiser
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.