Bug 495483 - make dist BUILD_ALL_DOCS=no fails
Summary: make dist BUILD_ALL_DOCS=no fails
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-28 13:55 UTC by Florian Krohm
Modified: 2024-12-12 16:28 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Krohm 2024-10-28 13:55:36 UTC
README_DEVELOPERS suggests that   make dist BUILD_ALL_DOCS=no 
can be used to build a tarball without building documentation. 
That command fails like so:

make[5]: Entering directory '/home/whatever/valgrind/docs'
Generating the text version of the FAQ ...
export XML_CATALOG_FILES=/etc/xml/catalog && \
xsltproc --nonet --xinclude --path ../docs/xml -o ./FAQ.txt ../docs/lib/vg-faq2txt.xsl ../docs/xml/FAQ.xml
/bin/bash: line 2: xsltproc: command not found
make[5]: *** [Makefile:720: FAQ.txt] Error 127

Here's the patch to make it work:

diff --git a/docs/Makefile.am b/docs/Makefile.am
index f9ba4e395..0f2816b9a 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -292,10 +292,7 @@ dist-hook: FAQ.txt html-docs man-pages print-docs
        cp print/index.pdf $(distdir)
        cp print/index.ps $(distdir)
  else
-dist-hook: FAQ.txt html-docs man-pages
-       cp -r html $(distdir)
-       cp FAQ.txt $(distdir)/..
-       cp *.1 $(distdir)
+dist-hook:
  endif
 
 distclean-local:
Comment 1 Mark Wielaard 2024-10-31 22:58:32 UTC
I think the intention is/was to skip the building of the print-docs which require some pdf/ps generation tools which are not always available. I believe the rest can simply be build when xsltproc is installed.

Should we introduce some BUILD_NO_DOCS variant that doesn't build any documentation?
Comment 2 Florian Krohm 2024-11-01 08:31:00 UTC
(In reply to Mark Wielaard from comment #1)
> I think the intention is/was to skip the building of the print-docs which
> require some pdf/ps generation tools which are not always available. I
> believe the rest can simply be build when xsltproc is installed.
> 
> Should we introduce some BUILD_NO_DOCS variant that doesn't build any
> documentation?

I ran into this when I wanted to provide a patch for https://bugs.kde.org/show_bug.cgi?id=495470
and test whether the tarball in fact contained the missing file.  README_DEVELOPERS says:
<quote>
If you only want to test whether the generated tarball is complete and runs
regression tests successfully, building documentation is not needed.

  make dist BUILD_ALL_DOCS=no
</quote>

I run ubuntu 22.04 which does not install xsltproc by default. Not sure about other distros.
I think it should be possible to create a tarball without having xml machinery installed.
Building documentation is not a frequent use case because of the pain involved (at least it used to be).
Comment 3 Florian Krohm 2024-11-19 10:45:40 UTC
(In reply to Mark Wielaard from comment #1)
> I think the intention is/was to skip the building of the print-docs which
> require some pdf/ps generation tools which are not always available. I
> believe the rest can simply be build when xsltproc is installed.

Installing xsltproc does not help a bit:

Generating the text version of the FAQ ...
export XML_CATALOG_FILES=/etc/xml/catalog && \
xsltproc --nonet --xinclude --path ../docs/xml -o ./FAQ.txt ../docs/lib/vg-faq2txt.xsl ../docs/xml/FAQ.xml
I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl
warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"
compilation error: file ../docs/lib/vg-faq2txt.xsl line 10 element import
xsl:import : unable to load http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl

Not sure why this fails as I can wget that docbook file just fine.
Comment 4 Florian Krohm 2024-12-12 15:19:13 UTC
(In reply to Florian Krohm from comment #3)
>
> warning: failed to load external entity
> "http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"
> compilation error: file ../docs/lib/vg-faq2txt.xsl line 10 element import
> xsl:import : unable to load
> http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl
> 
> Not sure why this fails as I can wget that docbook file just fine.

strace -f tells me:
newfstatat(AT_FDCWD, "http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl", 0x7ffef39f1400, 0) = -1 ENOENT (No such file or directory)

Quick look at the manpage does not suggest newfstatat should work on URLs. Odd.
Comment 5 Mark Wielaard 2024-12-12 16:28:46 UTC
I think normally distros come with a package that has a local install of the validating documents.
e.g. on fedora you would install docbook-dtds so no outgoing network traffic is needed:

Name            : docbook-dtds
Epoch           : 0
Version         : 1.0
Release         : 87.fc41
Architecture    : noarch
Installed size  : 8.3 MiB
Source          : docbook-dtds-1.0-87.fc41.src.rpm
From repository : <unknown>
Summary         : SGML and XML document type definitions for DocBook
URL             : http://www.oasis-open.org/docbook/
License         : LicenseRef-docbook-dtds
Description     : The DocBook Document Type Definition (DTD) describes the syntax of
                : technical documentation texts (articles, books and manual pages).
                : This syntax is XML-compliant and is developed by the OASIS consortium.
                : This package contains SGML and XML versions of the DocBook DTD.