NetBSD Problem Report #56181

From cjep@netbsd.org  Sun May 16 12:50:47 2021
Return-Path: <cjep@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 561651A9287
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 16 May 2021 12:50:47 +0000 (UTC)
Message-Id: <20210516125045.B02671A928D@mollari.NetBSD.org>
Date: Sun, 16 May 2021 12:50:45 +0000 (UTC)
From: cjep@netbsd.org
Reply-To: cjep@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: build.sh fails on OpenBSD 6.9 #3 - sysinst fails to build due to counting error in msg_xlat.sh
X-Send-Pr-Version: 3.95

>Number:         56181
>Category:       toolchain
>Synopsis:       build.sh fails on OpenBSD 6.9 #3 - sysinst fails to build due to counting error in msg_xlat.sh
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    cjep
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 16 12:55:00 +0000 2021
>Closed-Date:    Tue Jun 29 08:03:39 +0000 2021
>Last-Modified:  Tue Jun 29 08:05:01 +0000 2021
>Originator:     Chris Pinnock
>Release:        NetBSD-current, recent sources as of 16/5/2021
>Organization:
>Environment:
OpenBSD blowfish.home 6.9 GENERIC.MP#473 amd64
OpenBSD clang version 10.0.1
Target: amd64-unknown-openbsd6.9
Thread model: posix

>Description:
cf PR#56179 & PR#56180

sysinst will not build due to the check for formatting in one of the 
German messages files. This looks like a bug/feature/characteristic of the 
OpenBSD sh running msg_xlat.sh in the count logic.  I was able to get 
past this by using bash as HOST_SH (which of course is not native 
to the build, but on Open sh == ksh leaving little other options).

msg_xlat.sh: ERROR Wrong number of format specifiers in "openfail", got 5, expected 4
*** Failed target:  sysinstmsgs.de
*** Failed command: /home/cjep/usr/src/obj/tooldir.OpenBSD-6.9-amd64/bin/nbsed "s/@@VERSION@@/9.99.82/" /home/cjep/usr/src/usr.sbin/sysinst/arch/amd64/.    ./../msg.mi.de /home/cjep/usr/src/usr.sbin/sysinst/arch/amd64/../i386/msg.md    .de /home/cjep/usr/src/usr.sbin/sysinst/arch/amd64/../../msg.mbr.de /home/cj    ep/usr/src/usr.sbin/sysinst/arch/amd64/../../msg.pm.de | /home/cjep/usr/src/    obj/tooldir.OpenBSD-6.9-amd64/bin/nbsed "s/@@MACHINE@@/amd64/" | /home/cjep/    usr/src/obj/tooldir.OpenBSD-6.9-amd64/bin/nbawk -f /home/cjep/usr/src/usr.sb    in/sysinst/arch/amd64/../../unif.awk -v defines="BOOTSEL AOUT2ELF HAVE_INSTA    LL_IMAGE" | /bin/sh /home/cjep/usr/src/usr.sbin/sysinst/arch/amd64/../../msg    _xlat.sh -f sysinstmsgs.fmtcnt > sysinstmsgs.de
>How-To-Repeat:
Install OpenBSD 6.9 
Grab src
./build.sh -U -m amd64 release
(Note that whilst PR#56179 & PR#56180 remain open you will need to apply the
workarounds their to be able to get to the sysinst problem.)


>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: toolchain-manager->cjep
Responsible-Changed-By: cjep@NetBSD.org
Responsible-Changed-When: Tue, 08 Jun 2021 07:34:00 +0000
Responsible-Changed-Why:
Will take this. Have found a potential issue in msg_xlat.sh
Discussing with martin & kre.



State-Changed-From-To: open->analyzed
State-Changed-By: cjep@NetBSD.org
State-Changed-When: Tue, 08 Jun 2021 07:34:00 +0000
State-Changed-Why:
Issue analysed, but still working on solution.


From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: toolchain/56181 (build.sh fails on OpenBSD 6.9 #3 - sysinst
 fails to build due to counting error in msg_xlat.sh)
Date: Wed, 9 Jun 2021 00:24:00 +0000

 On Tue, Jun 08, 2021 at 07:34:00AM +0000, cjep@NetBSD.org wrote:
  > Responsible-Changed-Why:
  > Will take this. Have found a potential issue in msg_xlat.sh
  > Discussing with martin & kre.
  > 
  > State-Changed-Why:
  > Issue analysed, but still working on solution.

 If you don't get it dealt with soon please dump what you do have in
 the PR so someone else doesn't have to redo that work five years from
 now :-|n

 -- 
 David A. Holland
 dholland@netbsd.org

State-Changed-From-To: analyzed->closed
State-Changed-By: cjep@NetBSD.org
State-Changed-When: Tue, 29 Jun 2021 08:03:39 +0000
State-Changed-Why:
kre provided a new version of msg_xlat.sh including a fix for the format
counting.


From: "Chris Pinnock" <cjep@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56181 CVS commit: src/usr.sbin/sysinst
Date: Tue, 29 Jun 2021 08:02:50 +0000

 Module Name:	src
 Committed By:	cjep
 Date:		Tue Jun 29 08:02:50 UTC 2021

 Modified Files:
 	src/usr.sbin/sysinst: msg_xlat.sh

 Log Message:
 1. Rework the IFS handling when checking consistency of formatting in
 sysinst messages. Closes PR toolchain/56181.
 2. Whilst here, change some shell clauses to be more portable.

 Patch developed by kre. Also reviewed by martin. Cross-builds tested
 on NetBSD, OpenBSD, FreeBSD and Darwin.


 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/msg_xlat.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

 This script shows the problem with OpenBSD sh:

 msg="x%s konnte nicht genet werden, die Fehlermeldung lautet: %s."
 msg1="%s konnte nicht genet werden, die Fehlermeldung lautet: %s."

 IFS="%"

 set -- $msg
 echo "Message: $msg" >&2
 echo "$#" >&2

 set -- x$msg1
 echo "Message: $msg1"
 echo " with x before" >&2
 echo "$#" >&2

 echo "--------" >&2 

 I've enquired on tech at openbsd.org. Still talking to kre about a
 workaround for our xlat script.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.