Re: MacOS: xsltproc fails with "warning: failed to load external entity"
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Aleksander Alekseev <aleksander@timescale.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Date: 2023-01-30T21:01:51Z
Lists: pgsql-hackers
Aleksander Alekseev <aleksander@timescale.com> writes:
>> What we do actually have already is a recommendation to install
>> appropriate MacPorts or Homebrew packages:
>> https://www.postgresql.org/docs/devel/docguide-toolsets.html#DOCGUIDE-TOOLSETS-INST-MACOS
>> and it works okay for me as long as I use MacPorts' version of xsltproc.
> Unfortunately it doesn't work for Homebrew anymore and there seems to
> be only one xsltproc in the system.
Hmm. Seems unlikely that Homebrew would have dropped the package(s)
altogether. But ... poking at this, I discovered that there are
inaccuracies in our docs for MacPorts:
* /opt/local/bin/xsltproc is provided by libxslt, and
/opt/local/bin/xmllint is provided by libxml2, neither of which
will be installed by our recipe as given. You might have pulled
those ports in already to build Postgres with, but if you didn't, the
recipe will fail. I wonder if the Homebrew recipe has the same bug.
* At some point MacPorts renamed docbook-xsl to docbook-xsl-nons.
This is harmless at the moment, because if you ask for docbook-xsl
it will automatically install docbook-xsl-nons instead. I wonder
if that'll be true indefinitely, though.
I also wonder whether we shouldn't point at the meta-package docbook-xml
instead of naming a particular version here (and having to update
that from time to time). The extra disk space to install all the DTD
versions is entirely insignificant (< 2MB).
> Does your:
> xsltproc --help
> ... also say that it uses /etc/xml/catalog path by default?
Both /usr/bin/xsltproc and /opt/local/bin/xsltproc say
--catalogs : use SGML catalogs from $SGML_CATALOG_FILES
otherwise XML Catalogs starting from
file:///etc/xml/catalog are activated by default
However, this appears to be a lie for /opt/local/bin/xsltproc;
what it's apparently *actually* using is /opt/local/etc/xml/catalog,
which is what MacPorts provides.
I repeated the test I did this morning, and this time using --catalogs
with SGML_CATALOG_FILES set to /opt/local/etc/xml/catalog worked for me,
using either copy of xsltproc. I must've fat-fingered it somehow before.
Nonetheless, I doubt that that recipe is worth recommending to MacPorts
users: if they pull in the DTD packages they might as well pull in libxml2
and libxslt, and then they don't need to adjust anything.
In short, I think we need to update J.2.4 to say this for MacPorts:
sudo port install libxml2 libxslt docbook-xml docbook-xsl-nons fop
and I strongly suspect that the Homebrew recipe has a similar oversight.
regards, tom lane
Commits
-
docs: meson: Change what 'docs' target builds
- 9e5b2a091fd0 17.0 landed
-
doc: Fix XML_CATALOG_FILES env var for Apple Silicon machines
- 4257d34e310b 11.20 landed
- aad9a2ee7c2d 12.15 landed
- c6f1f4e443fb 14.8 landed
- 9850ef9fc123 13.11 landed
- 50792b155371 15.3 landed
-
doc: fix Apple Silicon Homebrew prefix change documentation
- 5a91c7975503 16.0 landed
-
doc: Fix XML_CATALOG_FILES env var for Apple M1 machines
- 4c8d65408470 16.0 landed
-
Stop recommending auto-download of DTD files, and indeed disable it.
- 36a646d99c3f 11.20 landed
- 11f1f9f4fa30 12.15 landed
- 969509c3f2e3 16.0 landed
- c7b608600547 13.11 landed
- 7f8778fcf342 14.8 landed
- 2ee703c9d1c6 15.3 landed