Bug 102824 - building pdf/dvi documentation for libgccjit fails
Summary: building pdf/dvi documentation for libgccjit fails
Status: WAITING
Alias: None
Product: gcc
Classification: Unclassified
Component: jit (show other bugs)
Version: 12.0
: P3 normal
Target Milestone: ---
Assignee: David Malcolm
URL:
Keywords: documentation
Depends on:
Blocks:
 
Reported: 2021-10-19 01:43 UTC by Eric Gallager
Modified: 2024-03-27 15:47 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build: darwin, linux
Known to work:
Known to fail:
Last reconfirmed: 2021-10-19 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Gallager 2021-10-19 01:43:47 UTC
Running `make pdf` fails in gcc/jit for me with the following error:

!pdfTeX error: pdfetex: cannot find image file libgccjit-figures/sum-of-squares
1.
 ==> Fatal error occurred, no output PDF file produced!
/opt/iains/x86_64-apple-darwin19/gcc-7-5-toolchain/bin/texi2dvi: pdfetex exited with bad status, quitting.
make[2]: *** [../../gcc/jit/Make-lang.in:283: doc/libgccjit.pdf] Error 1
make[2]: Leaving directory '/Users/ericgallager/gcc_newgit/abcdefghijklmnopqrstuvwxyz_01234567890.build/gcc'
make[1]: *** [Makefile:5361: pdf-gcc] Error 1
make[1]: Leaving directory '/Users/ericgallager/gcc_newgit/abcdefghijklmnopqrstuvwxyz_01234567890.build'
make: *** [Makefile:1280: do-pdf] Error 2

I also got a similar error with `make dvi`, the full log for which can be found here: https://github.com/cooljeanius/gcc_bugs/blob/master/doc_logs/libgccjit.log

(I originally reported this on IRC while testing a patch for bug 102663)
Comment 1 Iain Sandoe 2021-10-19 06:49:49 UTC

On linux the make html target succeeds - but it seems to run sphinx - is that now a prerequisite? (running make dvi after make html did not seem to make any difference)
Comment 2 David Malcolm 2022-04-01 22:54:02 UTC
make pdf is looking for the images in:
  gcc/jit/docs/_build/texinfo/libgccjit-figures
but they're in the source tree in:
  gcc/jit/docs/_build/texinfo

I just tried:
  git mv gcc/jit/docs/_build/texinfo/*.png gcc/jit/docs/_build/texinfo/libgccjit-figures

and it seems to fix the "make pdf" for me.

Will test a bit more.
Comment 3 GCC Commits 2022-04-06 20:21:05 UTC
The master branch has been updated by David Malcolm <dmalcolm@gcc.gnu.org>:

https://gcc.gnu.org/g:790e9814454662b6cd51d2fce1aa022ef73fedb8

commit r12-8031-g790e9814454662b6cd51d2fce1aa022ef73fedb8
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Wed Apr 6 16:20:10 2022 -0400

    jit: fix location of .png files for "make jit.pdf" [PR102824]
    
    "make jit.pdf" seems to be looking in
      gcc/jit/docs/_build/texinfo/libgccjit-figures
    for the .png files, but they were in the source tree in:
      gcc/jit/docs/_build/texinfo
    
    Fix "make jit.pdf" via:
      git mv \
        gcc/jit/docs/_build/texinfo/*.png \
        gcc/jit/docs/_build/texinfo/libgccjit-figures
    
    gcc/jit/ChangeLog:
            PR jit/102824
            * docs/_build/texinfo/factorial.png: Move to...
            * docs/_build/texinfo/libgccjit-figures/factorial.png: ...here.
            * docs/_build/texinfo/factorial1.png: Move to...
            * docs/_build/texinfo/libgccjit-figures/factorial1.png: ...here.
            * docs/_build/texinfo/sum-of-squares.png: Move to...
            * docs/_build/texinfo/libgccjit-figures/sum-of-squares.png: ...here.
            * docs/_build/texinfo/sum-of-squares1.png: Move to...
            * docs/_build/texinfo/libgccjit-figures/sum-of-squares1.png: ...here.
    
    Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Comment 4 David Malcolm 2022-04-06 20:33:06 UTC
As noted in https://gcc.gnu.org/pipermail/gcc-patches/2022-April/592889.html the above patch seems to fix "make jit.pdf", but doesn't fix "make jit.dvi"; it seems to be looking for .eps files for the images.

I last used TeX roughly 3 decades ago, so help fixing this would be welcome :)
Comment 5 Eric Gallager 2022-04-08 22:48:38 UTC
(In reply to David Malcolm from comment #4)
> As noted in https://gcc.gnu.org/pipermail/gcc-patches/2022-April/592889.html
> the above patch seems to fix "make jit.pdf", but doesn't fix "make jit.dvi";
> it seems to be looking for .eps files for the images.
> 
> I last used TeX roughly 3 decades ago, so help fixing this would be welcome
> :)

yeah I'm not much of a TeX user myself, so... well, who around here *does* understand TeX?
Comment 6 Eric Gallager 2023-01-06 04:12:36 UTC
@marxin is this something you checked during the sphinx conversion and reversion at all?
Comment 7 Martin Liška 2023-01-06 08:19:40 UTC
Well, running 'make latexpdf' works if you jump into gcc/jit/docs folder. Do I miss something?
Comment 8 Iain Sandoe 2023-01-06 08:50:56 UTC
(In reply to Eric Gallager from comment #6)
> @marxin is this something you checked during the sphinx conversion and
> reversion at all?

(In reply to Martin Liška from comment #7)
> Well, running 'make latexpdf' works if you jump into gcc/jit/docs folder. Do
> I miss something?

last time I checked 'make dvi ' it was hanging in libgccjit ('make pdf' is OK - but in-tree gmp fails there).
Comment 9 Eric Gallager 2023-10-20 08:31:07 UTC
I've been testing this on the compile farm, and there seems to be a wide amount of variation between machines with regards to whether this fails or not; I think it might have to do with different machines having different sphinx versions... I'm wondering if the minimum sphinx version documented to work in https://gcc.gnu.org/install/prerequisites.html needs to be updated?
Comment 10 Eric Gallager 2023-10-20 08:34:14 UTC
I've been testing this on the compile farm, and there seems to be a wide amount of variation between machines with regards to whether this fails or not; I think it might have to do with different machines having different sphinx versions... I'm wondering if the minimum sphinx version documented to work in https://gcc.gnu.org/install/prerequisites.html needs to be updated?
Comment 11 Eric Gallager 2023-12-05 08:14:27 UTC
I'm wondering if it'd be possible to insert a line like:

\batchmode

into the tex files? 
Ref:
https://tex.stackexchange.com/questions/25267/what-reasons-if-any-are-there-for-compiling-in-interactive-mode
Comment 12 Iain Sandoe 2024-03-17 03:41:16 UTC
what input is this waiting for at the moment?
Comment 13 Eric Gallager 2024-03-27 15:47:45 UTC
(In reply to Iain Sandoe from comment #12)
> what input is this waiting for at the moment?

From checking the bug history, it looks like Martin Liška was the one to put this in the WAITING status, which came along with this comment:

(In reply to Martin Liška from comment #7)
> Well, running 'make latexpdf' works if you jump into gcc/jit/docs folder. Do
> I miss something?

...which I thought we'd answered, but to make it a bit more clear: we shouldn't have to do that to get the jit docs to build properly. They should build properly when doing `make dvi` and/or `make pdf` from the top-level, rather than requiring their own special procedures.