Hi Bruno,

At 2026-08-03T20:14:24+0200, Bruno Haible wrote:
> On Solaris 11.4, 203 tests fail.
> 
> All of them because they use 'grep' and the Solaris /usr/bin/grep is
> old.  But there is also /usr/bin/ggrep, which is GNU grep version 3.1.
> In fact, config.status contains two AC_SUBSTed variables:
>   grep -> "/usr/bin/ggrep"
>   egrep -> "/usr/bin/ggrep -E"
> But the test suite appears to not use these variables.

Right.  I have not been in the habit of generating test scripts at
configuration time from '*.in' files that we ship.

The better part of a decade ago when I started establishing patterns for
myself in writing test scripts for groff, I underestimated just how
poor Solaris's POSIX conformance was/is.

> If I place a symlink <somedir>/grep -> /usr/bin/ggrep in a directory
> in $PATH, the build succeeds with no test failures.

It's a big lift to migrate 200+ test scripts to configure-time
generation process--obviously we'll want to do it in a mostly automated
manner--so I propose to document this issue in the release notes, where
we already caution the reader about Solaris.

Caveats
=======

*  GNU tools, or otherwise POSIX-conforming ones, are generally required
   to build on Solaris 10 or 11.  See the "PROBLEMS" file in the
   distribution archive.

*  Solaris 10 has known problems with automated tests; see the
   "PROBLEMS" file in the distribution archive.

The PROBLEMS file says this:

----------------------------------------------------------------------

* I get a make(1) failure involving grep and the groff_man.7.man.in file
  on Solaris 11.

Solaris make(1) has a bug easily exhibited by the following Makefile.

all:
        ! false

Use GNU make instead; it may be available in /opt/csw/bin/gmake.

----------------------------------------------------------------------

* Tests fail when I run "make check" on Solaris 10 or 11.

The test suite expects a POSIX-conforming shell and utilities.  Solaris
10 does not offer these in the default $PATH.  We try to use features
standardized no later than POSIX Issue 4 (1994).  Unfortunately even
that is too recent for some implementations.  Solaris 11 has a (mostly)
conforming shell.  It may help to ensure that "/usr/xpg6/bin" and
"/usr/xpg4/bin" precede "/usr/bin" in the $PATH when building groff.

For Solaris 10, it is necessary to modify the shell-based test scripts
in place to use a conforming shell.  Here is an example.

  $ gsed -i -e '1s@#!/bin/sh@#!/usr/xpg4/bin/sh@' \
      `find . -name '*.sh' | egrep '/(examples|tests)/'`
  $ gsed -i -e '1s@#!/bin/sh@#!/usr/xpg4/bin/sh@' \
      `find . -name '*.sh.in' | egrep '/(examples|tests)/'`
  $ PATH=/usr/xpg4/bin:$PATH gmake check

[POSIX.1-2024 has withdrawn specification of egrep(1) but Solaris 10
doesn't support `grep -E`.  --GBR in 2026]

----------------------------------------------------------------------

The issue you've reported sounds like it could feature in an expansion
of the last item above.

I have access to only one Solaris 11 system, that being the FSF Europe's
compiler farm.  Not sure why I didn't notice before.  Maybe that system
takes steps to protect the user from Solaris 11's crappy grep.

Or maybe my tip about the $PATH makes the difference?

Regards,
Branden

Attachment: signature.asc
Description: PGP signature

  • ... G. Branden Robinson
    • ... Bruno Haible via discussion of the GNU roff typesetting system and related software
      • ... G. Branden Robinson
      • ... Bruno Haible via discussion of the GNU roff typesetting system and related software
        • ... G. Branden Robinson
    • ... Bruno Haible via discussion of the GNU roff typesetting system and related software
    • ... Bruno Haible via discussion of the GNU roff typesetting system and related software
    • ... Bruno Haible via discussion of the GNU roff typesetting system and related software
    • ... Bruno Haible via discussion of the GNU roff typesetting system and related software
    • ... Bruno Haible via discussion of the GNU roff typesetting system and related software
      • ... G. Branden Robinson
        • ... Bruno Haible via discussion of the GNU roff typesetting system and related software
          • ... G. Branden Robinson
            • ... Bruno Haible via discussion of the GNU roff typesetting system and related software

Reply via email to