git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Solaris and sed: Too many commands, last: s/\n//

From
JWJeffrey Walton <noloader@gmail.com>
Date
Mar 12, 2019, 03:57 UTC
Message-ID
<CAH8yC8=gsuknMOAYyjVDyZENDiJoRia+MnwhsMhZdcnfuO=cbw@mail.gmail.com>
In-Reply-To
<20190312024542.GA7411@flurp.local>
On Mon, Mar 11, 2019 at 10:45 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 49 quoted lines
>
> On Mon, Mar 11, 2019 at 10:11:41PM -0400, Jeffrey Walton wrote:
> > On Mon, Mar 11, 2019 at 9:55 PM Jeffrey Walton <noloader@gmail.com> wrote:
> > > Oh man, you're using GNU make. I thought Git was using that anemic
> > > Posix Make. See attached.
> > >
> > > I think Solaris provides an older gawk. Is this an easier problem:
> > >
> > >     awk: chainlint.sed:88: :squash
> > >     awk: chainlint.sed:88: ^ syntax error
> > >     awk: chainlint.sed:91:  s/\\\n//
> > >     awk: chainlint.sed:91:    ^ backslash not last character on line
> > >     Usage: awk [POSIX or GNU style options] -f progfile [--] file ...
> > >     Usage: awk [POSIX or GNU style options] [--] 'program' file ...
> >
> > My bad , there was a typo... 'awk' got assigned to SED variable.
> >
> > This patch works as expected.
> >
> > diff --git a/t/Makefile b/t/Makefile
> > @@ -11,11 +11,25 @@ SHELL_PATH ?= $(SHELL)
> >  TAR ?= $(TAR)
> > +AWK ?= $(AWK)
> > +SED ?= $(SED)
> > +GREP ?= $(GREP)
> >
> > +# Fix Solaris tools. These are Posix. GNU tools located at /usr/gnu/bin.
> > +ifneq ($(wildcard /usr/gnu/bin/grep),)
> > +  GREP := /usr/gnu/bin/grep
> > +endif
> > +ifneq ($(wildcard /usr/gnu/bin/sed),)
> > +  SED := /usr/gnu/bin/sed
> > +endif
> > +ifneq ($(wildcard /usr/gnu/bin/awk),)
> > +  SED := /usr/gnu/bin/awk
> > +endif
>
> I think the last assignment ought to be "AWK := ...".
>
> Anyhow, this sort of platform-specific tool customization is typically done by config.mak.uname in the top-level Git directory. In fact, there's already a section for SunOS:
>
>     ifeq ($(uname_S),SunOS)
>         ...
>         SANE_TOOL_PATH = /usr/xpg6/bin:/usr/xpg4/bin
>         ...
>
> Prepending /usr/gnu/bin to SANE_TOOL_PATH might be a good idea as a first step toward fixing the problem you're seeing on Solaris, however, as Ćvar mentioned in [1], SANE_TOOL_PATH isn't presently consulted when running tests. But, as he suggested, fixing the tests to respect SANE_TOOL_PATH might be a good solution overall.
>
> So, rather than making platform-specific customizations to t/Makefile, an arguably better solution would be to update config.mak.uname to add /usr/gnu/bin to SANE_TOOL_PATH and then update the test system to respect that value (thus, these GREP, SED, AWK specializations can be avoided).
I may have been blowing away SANE_BUILD_PATH.
My build script calls:
   SANE_BUILD_PATH="<my updated tool path> \
   PKG_CONFIG_PATH="..." \
   ... \
./configure \
    --prefix=<my new tool location> \
    --libdir="..." \
    ...

I set SANE_BUILD_PATH in the environment because I want Git to use the new tools being built for testing.

Or, if Git is blowing away my SANE_BUILD_PATH , then that might explain the encoding failures. The updated tools, like new iConv and Unistring, are not on PATH. The updated tools are located at /var/sanitize/bin, and are passed through SANE_BUILD_PATH .

This might also explain the intermittent crashes I see. Old tools from /usr/bin are used, but new libraries from /var/sanitize/lib are used because of LD_LIBRARY_PATH. Gotta love those fucking path problems that have plagued Linux for the last 30 years. The idiot who figured it was a good idea to compile and link against one library, and then load the wrong library at runtime, should get a platinum Darwin award.

It may be better to set SANE_TOOL_PATH something like:
    SANE_TOOL_PATH = "$SANE_TOOL_PATH:/usr/xpg6/bin:/usr/xpg4/bin"
Jeff
Previous: Eric SunshineNext: Jeffrey Walton
Message 10 of 13 in “Solaris and sed: Too many commands, last: s/\n//”
  1. Jeffrey WaltonMar 11, 2019
  2. Eric SunshineMar 11, 2019
  3. Jeffrey WaltonMar 11, 2019
  4. Eric SunshineMar 11, 2019
  5. Jeffrey WaltonMar 12, 2019
  6. Jeffrey WaltonMar 12, 2019
  7. Jeffrey WaltonMar 12, 2019
  8. Jeffrey WaltonMar 12, 2019
  9. Eric SunshineMar 12, 2019
  10. Jeffrey WaltonMar 12, 2019
  11. Jeffrey WaltonMar 11, 2019
  12. Jeffrey WaltonMar 12, 2019
  13. Ævar Arnfjörð BjarmasonMar 12, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.