Hi,
On Tue, Aug 02, 2005 at 12:03:54AM +0200, Bas Kloet wrote:
> If you run "rubber --pdf" on a mailformed TeX file of the following shape:
> 'Text, "\newpage", optional text', then latex will fail, but a pdf will still
> be produced.
[...]
> This is partially latex's fault, since it creates a dvi file even though it
> couldn't compile the file (filed a bug already). But since latex exits with
> error code 1, rubber shouldn't create the pdf file.
Actually, as discussed in previous replies to your bug report, this is a
bug/feature of latex, not rubber. With --pdf the compiler used is pdflatex
instead of latex, which produces a pdf directly (even in case of errors)
without an intermediate dvi, so the behaviour of rubber is as expected: it
stops right after pdflatex failed.
> "rubber --ps" doesn't have this problem.
This is because --ps uses dvips to translate the dvi, when the latex
compilation went without errors. In the case of --ps you still en up with a
dvi file (but a valid one, AFAIK).
So I'm tempted to consider this particular bug closed, if that's right with
you, since it does not really concern rubber.
> On Tue, Aug 02, 2005 at 12:05:19PM +0200, Frank Küster wrote:
> > I suggest not to use scripts like rubber early in the development cycle,
> > but rather something that shows you the errors. This could be running
> > latex on the command line, or AUCTeX in Emacs. Both would have shown
> > you the error message "missing \begin{document}" even before you'd
> > removed "useless cruft" like \documentclass...
This is not directly related to the original issue but the point of rubber,
apart from running latex and companion programs, is also to report errors. In
the case of the example above, it does report the "Missing \begin{document}"
(as illustrated below).
> The main problem I have is that we use rubber in an automated build
> system, with LaTeX code provided by a large number of different authors.
> A lot of these LaTeX documents consist of a main file and a number of
> included files. It is our policy that included files end with .tex.inc to make
> sure our system doesn't try to build them, but sometimes people forget that
> and call the included file(s) something.tex as well. This is something
> that we'd of course like to detect and warn the author about.
>
> The current problem we have is that rubber will happily create a pdf
> file for this (included) LaTeX file (which of course misses
> \begin{document}, etc) if it contains a \newpage and exits with error
> code 0 even though there were a lot of LaTeX (not just TeX) errors and a
> completely useless pdf file was produced. This makes it (almost) impossible
> for our system to detect that something went wrong, so we can't inform the
> author of the problem.
This is really strange, I made rubber return meaningful exit codes a long time
ago. I would be interested in a minimal example of a source file with errors
where rubber terminates with exit code 0, this is definitely not supposed to
happen. I just tried with the case you were talking about, and here is what I
get (with rubber 1.0 as of Debian testing):
manu ~ > cat foo.tex
Foo.
\newpage
Bar.
manu ~ > rubber --pdf foo.tex
compiling foo.tex...
foo.tex:1: Missing \begin{document}.
foo.tex:1: leading text: F
foo.tex:2: The font size command \normalsize is not defined:
foo.tex:2: leading text: \newpage
foo.tex:3: Missing \begin{document}.
foo.tex:3: leading text: B
foo.tex: compilation aborted: Emergency stop. (job aborted, no legal \end found)
manu ~ > echo $?
1
This is the supposed result. And indeed this creates an invalid file
"foo.pdf", because that's what pdflatex does.
Regards,
--
Emmanuel Beffara