Re: bizarre failures on NetBSD 9.3 x86_64

2023-05-09 Thread Bug reports, suggestions, general discussion for GNU patch.
On 5/9/23 23:36, Dennis Clarke via Bug reports, suggestions, general 
discussion for GNU patch. wrote:

On 5/9/23 11:00, Bruno Haible wrote:
 > Dennis Clarke wrote:
 >> Seems to be a problem where a trivial Bourne shell for the user is not
 >> good enough?
 >
 > What if you install GNU bash:
 >



After all that disaster I had a thought : what about that silly and
poorly documented env var CONFIG_SHELL ?

bash-5.1$ echo $CONFIG_SHELL
/usr/pkg/bin/bash
bash-5.1$

Guess what ?


Testsuite summary for GNU patch 2.7.6

# TOTAL: 44
# PASS:  42
# SKIP:  0
# XFAIL: 2
# FAIL:  0
# XPASS: 0
# ERROR: 0


Gotta love the need for GNU bash for this to work. Makes no sense at all
for "patch".




--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
Four decades in production systems.




Re: bizarre failures on NetBSD 9.3 x86_64

2023-05-09 Thread Bug reports, suggestions, general discussion for GNU patch.

On 5/9/23 11:00, Bruno Haible wrote:
> Dennis Clarke wrote:
>> Seems to be a problem where a trivial Bourne shell for the user is not
>> good enough?
>
> What if you install GNU bash:
>
># PKG_PATH=http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/`uname 
-m`/9.3/All

># export PKG_PATH
># pkg_add bash
>
> and then repeat the build attempt?
>

Bruno, thank you for the reply.

I was thinking that perhaps I fell onto a GNUism or bashism somewhere
and so yes, that is the very first thing I did :)

Same result.

Then I went looking around ...

I ssh into the server normally :

m$ echo $SHELL
/bin/sh

Then get bashed in the head

m$ which bash
/usr/pkg/bin/bash
m$ /usr/pkg/bin/bash --version
GNU bash, version 5.1.16(1)-release (x86_64--netbsd)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 



This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
m$
m$ /usr/pkg/bin/bash
bash-5.1$

OKay, let's extract a fresh tarball of patch-2.7.6

bash-5.1$
bash-5.1$ pwd
/opt/bw/build
bash-5.1$ ls /mnt/pluto/dclarke/src/patch*
/mnt/pluto/dclarke/src/patch-2.7.6.tar.gz
bash-5.1$
bash-5.1$ openssl dgst -sha256 -r /mnt/pluto/dclarke/src/patch-2.7.6.tar.gz
8cf86e00ad3aaa6d26aca30640e86b0e3e1f395ed99f189b06d4c9f74bc58a4e 
*/mnt/pluto/dclarke/src/patch-2.7.6.tar.gz

bash-5.1$
bash-5.1$ gzip -dc /mnt/pluto/dclarke/src/patch-2.7.6.tar.gz | tar -xf -
bash-5.1$ mv patch-2.7.6 patch-2.7.6_NetBSD_9.3_AMD64.004
bash-5.1$ cd patch-2.7.6_NetBSD_9.3_AMD64.004
bash-5.1$

Take a look at this :

bash-5.1$ ls tests/test-lib.sh
tests/test-lib.sh
bash-5.1$
bash-5.1$ nl -b a -n rz tests/test-lib.sh | head -20
01  # Library for simple test scripts
02  # Copyright (C) 2009, 2011-2012 Free Software Foundation, Inc.
03  #
04  # Copying and distribution of this file, with or without 
modification,
05  # in any medium, are permitted without royalty provided the 
copyright

06  # notice and this notice are preserved.
07
08  # FIXME: Requires a version of diff that understands "-u".
09
10  require_gnu_diff() {
11  case "`diff --version 2> /dev/null`" in
12  *GNU*)
13  ;;
14  *)
15  echo "This test requires GNU diff" >&2
16  exit 77
17  esac
18  }
19
20  require() {
bash-5.1$

There on line 8 it seems to say we need the GNU diff?

So that means diffutils or whatever it is called. Maybe ?

Regardless the diff that we get in NetBSD 9.3 seems just fine :

bash-5.1$
bash-5.1$ which diff
/usr/bin/diff
bash-5.1$
bash-5.1$ /usr/bin/printf "Here is line 1\nhere is line 2\nhere is 
another line\n" > /var/tmp/dclarke/foo
bash-5.1$ /usr/bin/printf "Here is line 1\nhere is line 2\nhere is a 
last line\n" > /var/tmp/dclarke/bar

bash-5.1$ diff -u /var/tmp/dclarke/foo /var/tmp/dclarke/bar
--- /var/tmp/dclarke/foo2023-05-10 02:36:33.650699736 +
+++ /var/tmp/dclarke/bar2023-05-10 02:36:49.654477281 +
@@ -1,3 +1,3 @@
 Here is line 1
 here is line 2
-here is another line
+here is a last line

Seems that "-u" works just fine to me.


Fine .. so setup a few env vars for a compile or at least a configure ?

bash-5.1$ env | sort | grep -v 'SSH'

CC=/opt/bw/gcc12/bin/gcc
CFLAGS=-Wl,-rpath=/opt/bw/lib,--enable-new-dtags -m64 -g -O0 
-fno-fast-math -fno-builtin -malign-double -march=k8 -mtune
=k8 -mieee-fp -mhard-float -mno-fancy-math-387 -m128bit-long-double 
-mlong-double-80 -mstackrealign -mpreferred-stack-bo

undary=8
COLUMNS=120
CPPFLAGS=-D_LARGEFILE64_SOURCE
CXX=/opt/bw/gcc12/bin/g++
CXXFLAGS=-g -m64 -O0 -L/opt/bw/lib -Wl,-rpath=/opt/bw/lib,--enable-new-dtags
DISPLAY=localhost:10.0
EDITOR=/usr/bin/vi
ENV=/home/dclarke/.shrc
HOME=/home/dclarke
LC_COLLATE=C
LC_CTYPE=C
LC_MESSAGES=C
LC_MONETARY=C
LC_NUMERIC=C
LC_TIME=C
LD_RUN_PATH=/opt/bw/lib
LINES=43
LOGNAME=dclarke
MAIL=/var/mail/dclarke
MAKE=/usr/pkg/bin/gmake
NICE=/usr/bin/nice
OLDPWD=/opt/bw/build
PAGER=/usr/bin/more
PATH=/opt/bw/bin:/opt/bw/gcc12/bin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R7/bin:/usr/pkg/
bin:/usr/pkg/sbin
PWD=/opt/bw/build/patch-2.7.6_NetBSD_9.3_AMD64.004
SHELL=/bin/sh
SHLVL=0
TERM=xterm
TIME=/usr/bin/time
TMPDIR=/var/tmp/dclarke
TMUX=/var/tmp/dclarke/tmux/default,29620,0
TMUX_PANE=%0
TZ=GMT0
USER=dclarke
VISUAL=/usr/bin/vi
XTERM_LOCALE=C
_=/usr/bin/env

I am looking at this inside a tmux session but I hardly doubt that means
anything.

Those CFLAGS are in place for the most minimal and "debuggable" result.
Is that even a word? Seem reasonable at the moment.

OKay so here in the configure stage of life I will watch closely for
"Thou Art in Sin and shall be cast into HELLFIRE" warnings. However I
just do not see why *everything* falls over and fails in flames and
smoke and ash.

Let's see :

bash-5.1$ 
 [547/1866]

bash-5.1$ pwd

Re: bizarre failures on NetBSD 9.3 x86_64

2023-05-09 Thread Bruno Haible
Dennis Clarke wrote:
> Seems to be a problem where a trivial Bourne shell for the user is not 
> good enough?

What if you install GNU bash:

  # PKG_PATH=http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/`uname -m`/9.3/All
  # export PKG_PATH
  # pkg_add bash

and then repeat the build attempt?

Bruno