Hi, On Thu, 2 Oct 2025 at 21:43, Andrew Dunstan <[email protected]> wrote: > > On 2025-10-02 Th 8:52 AM, Nazir Bilal Yavuz wrote: > > I think there is one more problem that we need to think about. This > test runs when the xmllint is enabled but it also requires docbook > (docbook-xml on some OSes) to be installed, otherwise the test fails > with 'I/O error : Attempt to load network entity > http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd'. I think that > we need to skip this test if the docbook can not be found in the > system. Otherwise that would be a hassle for most of the people and > buildfarm members. What do you think about this? > > > Oops, missed seeing this earlier. Yes, I think we need to skip the test in > the meson case. Probably nothing more needed for the Makefile.
Here is the patch which does that. It has a basic check for the docbook and if the docbook can not be found, then meson skips the test. -- Regards, Nazir Bilal Yavuz Microsoft
From e18b5c4901d0e671017b58417b57d81a7ff4931a Mon Sep 17 00:00:00 2001 From: Nazir Bilal Yavuz <[email protected]> Date: Fri, 3 Oct 2025 12:56:58 +0300 Subject: [PATCH v4] meson: Skip sgml_syntax_check test if DocBook DTD can not be found Add a simple DocBook test file (docbook-test.sgml) and update sgml_syntax_check.pl to validate that the DocBook DTD is available. The script now runs xmllint on the test file and exits with code 77 if the DocBook DTD can not be found. This allows Meson to skip the syntax check gracefully instead of failing when DocBook is missing. Author: Nazir Bilal Yavuz <[email protected]> Discussion: https://postgr.es/m/CAN55FZ3BnM+0twT-ZWL8As9oBEte_b+SBU==cz6hk8jucm_...@mail.gmail.com --- doc/src/sgml/docbook-test.sgml | 9 +++++++++ doc/src/sgml/sgml_syntax_check.pl | 12 ++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 doc/src/sgml/docbook-test.sgml diff --git a/doc/src/sgml/docbook-test.sgml b/doc/src/sgml/docbook-test.sgml new file mode 100644 index 00000000000..242a52676e0 --- /dev/null +++ b/doc/src/sgml/docbook-test.sgml @@ -0,0 +1,9 @@ +<!-- doc/src/sgml/docbook-test.sgml --> + +<!-- This file is used to check if the DocBook can be found --> + +<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> +<book> + <title>DocBook Test</title> +</book> diff --git a/doc/src/sgml/sgml_syntax_check.pl b/doc/src/sgml/sgml_syntax_check.pl index 2264700a453..96b1c755bc5 100755 --- a/doc/src/sgml/sgml_syntax_check.pl +++ b/doc/src/sgml/sgml_syntax_check.pl @@ -73,5 +73,17 @@ sub run_xmllint system($cmd) == 0 or die "xmllint validation failed\n"; } +sub test_docbook +{ + my $cmd = "$xmllint $xmlinclude --noout --valid docbook-test.sgml"; + if (system($cmd) != 0) + { + print STDERR "DocBook DTD file can not be found\n"; + # Meson uses exit code 77 to skip the test instead of failing it + exit(77); + } +} + +test_docbook(); run_xmllint(); check_tabs_and_nbsp(); -- 2.51.0
