On Sat, Jun 14, 2025 at 03:17:09 -0600, Stan Marsh wrote:
> (Followup to my previous post)
> 
> To answer my own question, I guess it is pretty obvious that the answer to 
> "How to
> fix?" is "Install texinfo and re-run the make install", but it raises two 
> important
> questions:
>     1) Why is the error ignored, making it almost impossible to determine that
>       something went wrong?
> 
>     2) Shouldn't the problem (that texinfo isn't installed on the system) be 
> caught
>       earlier in the process (i.e., during the "configure" step) ?

A lot of people won't have the texinfo tools installed, and bash
itself builds just fine without them.  So, my understanding/guess is
that the documentation part is considered "optional", and will be
built if the tools are present, but skipped if they aren't.

Normally, this shouldn't be a problem, because the tarballs (including
5.3-rc2) ship with the documentation already built:

hobbit:/usr/local/src/bash/bash-5.3-rc2$ ls -l doc/bash.*
-rw-r--r-- 1 greg staff 516012 May  2 08:41 doc/bash.0
-rw-r--r-- 1 greg staff 392678 Apr 30 09:04 doc/bash.1
-rw-r--r-- 1 greg staff 426217 May  4 17:25 doc/bash.html
-rw-r--r-- 1 greg staff 639306 Apr 22 10:00 doc/bash.info
-rw-r--r-- 1 greg staff 439102 Apr 22 10:00 doc/bash.pdf

The timestamp on bash.0 is later than the timestamp on the sourcefile
bash.1 from which it's formatted, so presumably the build step wouldn't
actually have to do anything there, as long as I don't apply any
patch that updates bash.1.

However, the timestamp on bash.info is older, so it actually *would*
try to build that.

Looking at the top-level Makefile, the first target is

# Make sure the first target in the makefile is the right one
all: .made

And later:

.made: $(Program) bashbug $(SUPPORT_DIR)/man2html$(EXEEXT)
        @echo "$(Program) last made for a $(Machine) running $(OS)" >.made

$(Program): $(OBJECTS) $(BUILTINS_DEP) $(LIBDEP) .build
        $(RM) $@
        $(CC) $(BUILTINS_LDFLAGS) $(LIBRARY_LDFLAGS) $(LDFLAGS) -o $(Program) 
$(OBJECTS) $(LIBS)
        ls -l $(Program)
        -$(SIZE) $(Program)

And so on.  There's no mention of "doc" here, so it isn't part of
the default build.  It appears further down:

doc documentation:  force
        @(cd $(DOCDIR) ; $(MAKE) $(BASH_MAKEFLAGS) )

And...

install:        .made installdirs
        $(INSTALL_PROGRAM) $(INSTALLMODE) $(Program) 
$(DESTDIR)$(bindir)/$(Program)
        $(INSTALL_SCRIPT) $(INSTALLMODE2) bashbug $(DESTDIR)$(bindir)/bashbug
        $(INSTALL_DATA) $(OTHER_DOCS) $(DESTDIR)$(docdir)
        -( cd $(DOCDIR) ; $(MAKE) $(BASH_MAKEFLAGS) \
                man1dir=$(man1dir) man1ext=$(man1ext) \
                man3dir=$(man3dir) man3ext=$(man3ext) \
                infodir=$(infodir) htmldir=$(htmldir) DESTDIR=$(DESTDIR) $@ )
        -( cd $(DEFDIR) ; $(MAKE) $(BASH_MAKEFLAGS) DESTDIR=$(DESTDIR) $@ )
        -( cd $(PO_DIR) ; $(MAKE) $(BASH_MAKEFLAGS) DESTDIR=$(DESTDIR) $@ )
        -( cd $(LOADABLES_DIR) && $(MAKE) $(BASH_MAKEFLAGS) DESTDIR=$(DESTDIR) 
$@ )

For whatever reason (Chet may be the only person who knows), the default
build simply doesn't include the "doc" target.  I'm assuming this was an
intentional decision, perhaps to reduce the build tool dependencies for
people who don't actually care about the info pages.

However, the bigger issue is probably the timestamp on bash.info.
If the release tarballs are shipping a bash.info file at all, then it
should be one that's been updated since its source was last edited.
It's not immediately obvious what the bash.info target's source file
is.  I had to comb through the doc/Makefile multiple times to find it:

bash.info: $(BASHREF_FILES) $(HSUSER) $(RLUSER)
        $(RM) $@
        $(MAKEINFO) -o $@ --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi

So, it looks like bash.info and bashref.info *both* come from
bashref.texi.  And the timestamps:

hobbit:/usr/local/src/bash/bash-5.3-rc2/doc$ ls -l *.texi *.info
-rw-r--r-- 1 greg staff 639306 Apr 22 10:00 bash.info
-rw-r--r-- 1 greg staff 639705 Apr 22 10:00 bashref.info
-rw-r--r-- 1 greg staff 415804 May 27 11:56 bashref.texi
-rw-r--r-- 1 greg staff  23565 Mar 10  2009 fdl.texi
-rw-r--r-- 1 greg staff    210 May 18 13:42 version.texi

So, the bash.0 file that's shipped in the tarball is updated, but
the bash.info and bashref.info files are not.  That's why the
"make install" step tries to run makeinfo to refresh them.

Note that the (cd $(DOCDIR) ...) step in the install target begins with a
leading hyphen.  Web searching tells me that means ignore the exit status.
So, the documentation build step is allowed to fail.

My suggestion would be to included updated *.info files in the tarball.
That should allow the "make install" to work without having makeinfo
present, assuming none of the other doc steps fail for similar reasons.

Reply via email to