groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [groff] 20/31: [nroff]: Improve portability.


From: G. Branden Robinson
Subject: Re: [groff] 20/31: [nroff]: Improve portability.
Date: Sat, 14 Aug 2021 02:09:42 +1000
User-agent: NeoMutt/20180716

Hi Ingo,

At 2021-08-13T15:19:02+0200, Ingo Schwarze wrote:
> Hi Branden,
> 
> G. Branden Robinson wrote on Sun, Jul 25, 2021 at 02:39:49AM -0400:
> 
> > commit 8ca88a9c72b59da7e8757b8f6012aef5947ef144
> > Author: G. Branden Robinson <g.branden.robinson@gmail.com>
> > AuthorDate: Sat Jul 24 12:17:32 2021 +1000
> > 
> >     [nroff]: Improve portability.
> >     
> >     * src/roff/nroff/nroff.sh: Use Version 7 Unix sh-compatible form
> >       of parameter expansion; per the GNU Autoconf manual[1], "[o]ld
> >       BSD shells, including the Ultrix sh, don't accept the colon
> >       for any shell substitution, and complain and die."  This is
> >       also the form of such substitutions used elsewhere in the
> >       script, so they should be mutually consistent.
> >     
> >     [1] https://www.gnu.org/software/autoconf/manual/autoconf-2.60/
> >         html_node/Shell-Substitutions.html
> 
> I don't object to the code change, it does not really matter in
> this case.  Arguably, groff=${GROFF_TEST_GROFF:-groff} is better
> than groff=${GROFF_TEST_GROFF-groff} because if GROFF_TEST_GROFF
> is defined but empty, POSIX specifies that the former results in
> groff=groff (which is more or less sane) while the latter results
> in groff="" (which is likely to cause very strange and confusing
> error messages).  Then again, it doesn't really matter, no real-world
> user sets GROFF_TEST_GROFF in the first place.

That was my thinking.  GROFF_TEST_GROFF is a back door so that we can
run tests on the nroff script.

> But if you care about portability, please stop reading the autoconf
> manual right now and start reading POSIX.  The autoconf manual is
> a giant pile of totally outdated, irrelevant, and generally
> exceedingly bad advice.  Following it usually spawns traditions of
> cargo cult programming and yields disgusting and hard-to-read code on
> top of that.  In any case, please do not misuse the autoconf manual as
> a rationale for any code change.

My rationale is that nroff, as a fairly high-profile program, might need
to run on busted old Unix systems.  I think we've discussed this before,
but I have no desire to expend any effort on making the groff _test
suite_ portable to POSIX-hostile shells.  That's too much to ask.

If asked by a porter to such a system who wants to know why the test
suite won't run, I think we have to tell them to acquire a reasonable
shell to run it with.

If I had some idea of what platforms it's practical to support groff on,
I might not care even about making the effort for nroff.sh.

Shortly before the groff 1.22.4 release someone spoke of maybe politely
approach Nelson H. F. Beebe for use of his massively parallel menagerie
of build systems.

> If you doubt my words, just go ahead and read any ./configure script
> produced by autoconf.

I do think we've had this conversation before.  I'll say again: I don't
prescribe Autoconf shell as a dialect for anything except very limited
purposes--I don't think it's a language a person can reasonably be
expected to keep in one's head.  Even POSIX shell is weird enough, and
the numerous exceptions one must keep in mind to write in Autoconf shell
makes the problem intractable.

I'm willing to flex on nroff.sh because, again, it's high-profile, and
also because it's _short_.

Regards,
Branden

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]