On Sat, Aug 08, 2026 at 12:56:35AM +0200, Patrice Dumas wrote:
> On Fri, Aug 07, 2026 at 11:51:46PM +0100, Gavin Smith wrote:
> > On Sat, Aug 08, 2026 at 12:24:14AM +0200, Patrice Dumas wrote:
> > > > I remember there was unresolved business with the TEXINFO_XS variable.
> > > 
> > > I think that it is resolved.  (Except for this new issue I describe
> > > above that popped up recently).
> > 
> > I'll try to replicate the problem.
> 
> To replicate, you need to undo this commit
> https://cgit.git.savannah.gnu.org/cgit/texinfo.git/commit/?id=514b6b209e66ef1c1a6c90dd8ecbcca1388286ab

I wanted to see how texinfo.info and info-stnd.info were built for "make dist",
as these are removed by "make maintainer-clean".  Building these files would
depend on running texi2any, which would use the XS modules, so I thought there
would potentially be the same problem as you found with the rule for
pod2texi.info.  Then I found these files weren't even in the distribution
archive.

I remembered that distributing these files was disabled specially.  From
doc/Makefile.am:

  # Do not create info files for distribution.
  dist-info:

Presumably the thinking here was that we are distributing the program
to build the Info files.  So this line of thought didn't get me anywhere.

The essence of the issue is that the XS modules are not built as a dependency
of any program.  They are listed as built targets to be built with "make all"
in tta/perl/XSTexinfo/Makefile.am, but not for "make dist".  "make dist" targets
depend on programs themselves existing, such as rules under man/Makefile.am
to get man pages with help2man by running the programs.  This works for
texi2any for printing the usage message, but not for actually using the
program to convert an input file.

I reversed the commit you listed, and then ran "make maintainer-clean",
"./configure" and "make dist".  Under "tta/perl" I ran "make texi2any" - this
does very little work, successfully.  "TEXINFO_DEV_SOURCE=1 texi2any --help"
then outputs the usage message (so there would no problem with running texi2any
with help2man), but trying to run it on an input file fails:

  $ TEXINFO_DEV_SOURCE=1 ../tta/perl/texi2any ../doc/texinfo.texi
  extension ManipulateTreeXS enabled required for Texinfo::ManipulateTree
  BEGIN failed--compilation aborted at 
../tta/perl//../perl/Texinfo/ManipulateTree.pm line 87.
  Compilation failed in require at ../tta/perl//../perl/Texinfo/Document.pm 
line 48.
  BEGIN failed--compilation aborted at ../tta/perl//../perl/Texinfo/Document.pm 
line 48.
  Compilation failed in require at ../tta/perl//../perl/Texinfo/Parser.pm line 
28.
  BEGIN failed--compilation aborted at ../tta/perl//../perl/Texinfo/Parser.pm 
line 28.
  Compilation failed in require at ../tta/perl/texi2any line 1535.

It's similar to the error message from "make dist" for texi2any.

I don't know a lot about how pod2texi works but from what I can tell it
loads Perl modules that are part of texi2any.  However, this is not for
conversion from Texinfo, but actually the other way around, converting
to Texinfo from another documentation format (POD).

I couldn't think of a simple way to get these modules built purely with
"make dist".  I came up with the following:

diff --git a/doc/Makefile.am b/doc/Makefile.am
index 5c124a6bc9..31d2a3dd09 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -44,7 +44,8 @@ if BUILD_PERL_API_TEXI
 # Since Pod::Simple::Texinfo is not in CPAN, the @url first argument
 # is post-processed by a sed one liner to point to the GNU web site. 
 $(srcdir)/pod2texi.texi: $(pod2texi_pl)
-       $(MAKEINFO_ENVIRONMENT) TEXINFO_XS=omit $(PERL) -I 
$(top_srcdir)/Pod-Simple-Texinfo/lib/ 
$(top_srcdir)/Pod-Simple-Texinfo/pod2texi.pl --base-level=subsubsection 
--no-section-nodes --headings-as-sections --subdir=$(srcdir) $(pod2texi_pl) > 
/dev/null
+       cd $(top_builddir)/tta && $(MAKE) $(AM_MAKEFLAGS)
+       $(MAKEINFO_ENVIRONMENT) $(PERL) -I 
$(top_srcdir)/Pod-Simple-Texinfo/lib/ 
$(top_srcdir)/Pod-Simple-Texinfo/pod2texi.pl --base-level=subsubsection 
--no-section-nodes --headings-as-sections --subdir=$(srcdir) $(pod2texi_pl) > 
/dev/null
        mv $(srcdir)/pod2texi.texi $(srcdir)/pod2texi_tmp.texi
        sed 
's;https://metacpan.org/pod/Pod::Simple::Texinfo;https://www.gnu.org/software/texinfo/manual/Pod/Simple/Texinfo.html;'
 $(srcdir)/pod2texi_tmp.texi > $(srcdir)/pod2texi.texi
        rm -f $(srcdir)/pod2texi_tmp.texi

Basically, hard code building in the tta/ directory in the rule (I tried
just tta/perl/XSTexinfo but this didn't work due to dependencies in e.g.
tta/gnulib).  "make dist" succeeded with this - but it's not necessarily
very easy to understand or maintainable going forward.

Nevertheless, I slightly prefer this solution to setting TEXINFO_XS=omit,
as we'd like to be building, running and testing the C code where possible.

The "Gordian knot" solution: remove pod2texi from Texinfo.  I don't think
anybody uses it and it doesn't need to be part of Texinfo.  The way
of pod2texi integrates with the internals of texi2any seems to force
texi2any to remain as a Perl program.  In theory, there might also be
ways to implement a pod2texi program that don't rely on using parts
of texi2any.

Reply via email to