Re: Doc: typo in config.sgml - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Doc: typo in config.sgml
Date
Msg-id Z0X5xYJ_dvkREogb@momjian.us
Whole thread Raw
In response to Re: Doc: typo in config.sgml  (Tatsuo Ishii <ishii@postgresql.org>)
Responses Re: Doc: typo in config.sgml
List pgsql-hackers
On Tue, Nov 26, 2024 at 06:25:13PM +0900, Tatsuo Ishii wrote:
> I have looked into the patches.
> >  %.pdf: %.fo $(ALL_IMAGES)
> > -    $(FOP) -fo $< -pdf $@
> > +    CLANG=C $(FOP) -fo $< -pdf $@ 2>&1 | \
> 
> Shouldn't "CLANG" be "LANG"?

Yes, probably.

> > +    awk 'BEGIN{err=0}{print}/not available in font/{err=1}END{exit err}' 1>&2  || \
> > +    (echo "Found characters that cannot be displayed in PDF" 1>&2;  exit 1)
> 
> Currently "make postgres*.pdf" generates the pdf file even if there's
> a "not available in font" error while generating it. With the patch
> the pdf file is removed in this case. I'm not sure if this is an
> improvement because there's no way to generate such a pdf file if
> there's such a warning. Printing "Found characters that cannot be
> displayed in PDF" is good, but I'd prefer let users decide whether
> they retain or remove the pdf file.

Looking at the patch:

     %.pdf: %.fo $(ALL_IMAGES)
    -       $(FOP) -fo $< -pdf $@
    +       CLANG=C $(FOP) -fo $< -pdf $@ 2>&1 | \
    +       awk 'BEGIN{err=0}{print}/not available in font/{err=1}END{exit err}' 1>&2  || \
    +       (echo "Found characters that cannot be displayed in PDF" 1>&2;  exit 1)

it returns an error if it sees a "not available in font" error, and
since src/Makefile.global has .DELETE_ON_ERROR, and this is included in
doc/src/sgml/Makefile, the file is deleted on the awk 'exit' error.

If there are invalid characters in the PDF, shouldn't the PDF be
considered invalid and removed from the build?  To allow such builds to
keep those PDF files, we would need to probably override
.DELETE_ON_ERROR, but it would have to be done in a way that an error
exit from FOP would still remove the PDF file.  I think we would have to
have FOP write to a temporary file, and then override the
.DELETE_ON_ERROR just for the check for the string "not available in
font" text in the temporary file.

Do we want to add this complexity?

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  When a patient asks the doctor, "Am I going to die?", he means 
  "Am I going to die soon?"



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Misleading "epoll_create1 failed: Too many open files"
Next
From: Tom Lane
Date:
Subject: Re: Doc: typo in config.sgml