NetBSD Problem Report #57970

From www@netbsd.org  Wed Feb 28 18:07:47 2024
Return-Path: <www@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 5D0591A9239
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 28 Feb 2024 18:07:47 +0000 (UTC)
Message-Id: <20240228180745.EF0831A923A@mollari.NetBSD.org>
Date: Wed, 28 Feb 2024 18:07:45 +0000 (UTC)
From: thorpej@me.com
Reply-To: thorpej@me.com
To: gnats-bugs@NetBSD.org
Subject: pkgsrc textproc/nbsed is super old and doesn't support some things that modern seds support
X-Send-Pr-Version: www-1.0

>Number:         57970
>Category:       pkg
>Synopsis:       pkgsrc textproc/nbsed is super old and doesn't support some things that modern seds support
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 28 18:10:00 +0000 2024
>Closed-Date:    Fri Apr 12 01:34:17 +0000 2024
>Last-Modified:  Fri Apr 12 01:34:17 +0000 2024
>Originator:     Jason Thorpe
>Release:        pkgsrc trunk as of 20240228
>Organization:
LUTs-R-Us
>Environment:
Darwin Jasons-MacBook-Air.local 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct  9 21:28:31 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T8112 arm64

>Description:
On pkgsrc platforms that end up using nbsed (like, apparently, macOS), package builds that use the "in-place" options to sed (either -i or -I) lose out because textproc/nbsed is ancient (nbsed-20120308).  devel/icestorm is one such example, which fails to build on macOS due to this (ironically, macOS's system sed supports the "in-place" options, pkgsrc's macOS configuration apparently feels that it's better to use nbsed instead, *shrug*).

The "in-place" options were added to mainline NetBSD sed in June 2014.  Perhaps textproc/nbsed should be updated.
>How-To-Repeat:
See above.
>Fix:
That would be super-cool, yes.

>Release-Note:

>Audit-Trail:
From: Jonathan Perkin <jperkin@mnx.io>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/57970: pkgsrc textproc/nbsed is super old and doesn't
 support some things that modern seds support
Date: Wed, 28 Feb 2024 20:07:15 +0000

 > (ironically, macOS's system sed supports the "in-place" options, pkgsrc's macOS configuration apparently feels that it's better to use nbsed instead, *shrug*).

 We've had to use pkgsrc sed on macOS since Mountain Lion, as the native
 sed is broken with binary files or UTF-8 locales.  It would be great if 
 we had a contact at Apple who could fix this, so we no longer need to 
 bootstrap nbsed ;-)

 -- 
 Jonathan Perkin   -   mnx.io   -   pkgsrc.smartos.org
 Open Source Complete Cloud   www.tritondatacenter.com

From: Jonathan Perkin <jperkin@mnx.io>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/57970: pkgsrc textproc/nbsed is super old and doesn't
 support some things that modern seds support
Date: Wed, 28 Feb 2024 21:06:20 +0000

 * On 2024-02-28 at 20:07 GMT, Jonathan Perkin wrote:

 >>(ironically, macOS's system sed supports the "in-place" options, pkgsrc's macOS configuration apparently feels that it's better to use nbsed instead, *shrug*).
 >
 >We've had to use pkgsrc sed on macOS since Mountain Lion, as the native
 >sed is broken with binary files or UTF-8 locales.  It would be great 
 >if we had a contact at Apple who could fix this, so we no longer need 
 >to bootstrap nbsed ;-)

 That said, I just retried a fresh bootstrap on Sonoma and I'm not 
 immediately seeing any fallout, so perhaps the bugs have finally been 
 fixed.

 You can switch to native either by amending pkgsrc/bootstrap/bootstrap 
 around the "Since 10.9, native sed exits when ..." section and perform a 
 fresh bootstrap, or modify an existing install by editing mk.conf to 
 comment out the

    TOOLS_PLATFORM.awk=     /opt/pkg/bin/nawk
    TOOLS_PLATFORM.sed=     /opt/pkg/bin/nbsed

 lines.

 -- 
 Jonathan Perkin   -   mnx.io   -   pkgsrc.smartos.org
 Open Source Complete Cloud   www.tritondatacenter.com

From: "Jason R Thorpe" <thorpej@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57970 CVS commit: pkgsrc/devel/icestorm
Date: Thu, 29 Feb 2024 02:03:20 +0000

 Module Name:	pkgsrc
 Committed By:	thorpej
 Date:		Thu Feb 29 02:03:20 UTC 2024

 Modified Files:
 	pkgsrc/devel/icestorm: Makefile distinfo
 Added Files:
 	pkgsrc/devel/icestorm/patches: patch-icebox_Makefile

 Log Message:
 On Darwin, add gsed to USE_TOOLS and patch the icestorm Makefile to
 stop working around a behavioral difference in the Darwin sed(1) -i
 option relative to other sed implementations.

 If textproc/nbsed supported the -i option, the USE_TOOLS change would
 not be necessary.  But since the Darwin system sed(1) is not used in
 pkgsrc at the moment, the Makefile patch would still be required.

 See also PR pkg/57970.


 To generate a diff of this commit:
 cvs rdiff -u -r1.1 -r1.2 pkgsrc/devel/icestorm/Makefile \
     pkgsrc/devel/icestorm/distinfo
 cvs rdiff -u -r0 -r1.1 pkgsrc/devel/icestorm/patches/patch-icebox_Makefile

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

State-Changed-From-To: open->closed
State-Changed-By: gutteridge@NetBSD.org
State-Changed-When: Wed, 13 Mar 2024 01:26:35 +0000
State-Changed-Why:
christos@ updated it. (Probably not realistic to pull up to 2023Q4 branch.)

From: Jonathan Perkin <jperkin@mnx.io>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org,
	gutteridge@NetBSD.org, thorpej@me.com
Subject: Re: pkg/57970 (pkgsrc textproc/nbsed is super old and doesn't
 support some things that modern seds support)
Date: Wed, 13 Mar 2024 08:23:11 +0000

 I wouldn't close this just yet, the code christos committed doesn't even 
 build.

 -- 
 Jonathan Perkin   -   mnx.io   -   pkgsrc.smartos.org
 Open Source Complete Cloud   www.tritondatacenter.com

From: Thomas Klausner <wiz@NetBSD.org>
To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: pkg/57970 (pkgsrc textproc/nbsed is super old and doesn't
 support some things that modern seds support)
Date: Wed, 13 Mar 2024 10:15:15 +0100

 On Wed, Mar 13, 2024 at 08:23:11AM +0000, Jonathan Perkin wrote:
 > I wouldn't close this just yet, the code christos committed doesn't even
 > build.

 Builds for me on NetBSD-current/amd64:

 => Creating binary package /packages/All/nbsed-20240312.tgz

  Thomas

From: Jonathan Perkin <jperkin@mnx.io>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	thorpej@me.com
Subject: Re: pkg/57970 (pkgsrc textproc/nbsed is super old and doesn't
 support some things that modern seds support)
Date: Wed, 13 Mar 2024 10:06:24 +0000

 * On 2024-03-13 at 09:20 GMT, Thomas Klausner wrote:

 > Builds for me on NetBSD-current/amd64:

 I'm sure it does, given it uses a feature only available on newer NetBSD 
 (REG_GNU).  It's just every other platform, where it is a critical 
 bootstrap package, that is now broken.

 I didn't get time to clean up this mess yesterday, I'll see if I can 
 carve out some time today.

 -- 
 Jonathan Perkin   -   mnx.io   -   pkgsrc.smartos.org
 Open Source Complete Cloud   www.tritondatacenter.com

State-Changed-From-To: closed->open
State-Changed-By: gutteridge@NetBSD.org
State-Changed-When: Wed, 13 Mar 2024 13:50:49 +0000
State-Changed-Why:
Reopening, to reflect build breakages (this being a core bootstrap tool).

From: "David H. Gutteridge" <david@gutteridge.ca>
To: Gnats Bugs <gnats-bugs@netbsd.org>
Cc: 
Subject: Re: pkg/57970: pkgsrc textproc/nbsed is super old and doesn't support
 some things that modern seds support
Date: Wed, 13 Mar 2024 19:21:19 -0400

 It seems errc(3), and so also verrc(3), need to be added to
 libnbcompat, since the former is now used in compile.c. Or we just open
 code the equivalent in those two places instead.

 That issue brushed aside, it then compiles for me on Fedora 39.

 Dave

From: Rose <renegade6969666@gmail.com>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org, 
	thorpej@me.com
Subject: Re: pkg/57970: pkgsrc textproc/nbsed is super old and doesn't support
 some things that modern seds support
Date: Thu, 14 Mar 2024 10:48:34 -0400

 --000000000000f8447f06139ffcd8
 Content-Type: text/plain; charset="UTF-8"
 Content-Transfer-Encoding: quoted-printable

 That's probably the original.

 Something of a Relic.

 On Wed, Mar 13, 2024 at 7:25=E2=80=AFPM David H. Gutteridge <david@gutterid=
 ge.ca>
 wrote:

 > The following reply was made to PR pkg/57970; it has been noted by GNATS.
 >
 > From: "David H. Gutteridge" <david@gutteridge.ca>
 > To: Gnats Bugs <gnats-bugs@netbsd.org>
 > Cc:
 > Subject: Re: pkg/57970: pkgsrc textproc/nbsed is super old and doesn't
 > support
 >  some things that modern seds support
 > Date: Wed, 13 Mar 2024 19:21:19 -0400
 >
 >  It seems errc(3), and so also verrc(3), need to be added to
 >  libnbcompat, since the former is now used in compile.c. Or we just open
 >  code the equivalent in those two places instead.
 >
 >  That issue brushed aside, it then compiles for me on Fedora 39.
 >
 >  Dave
 >
 >

 --=20
 Justin Allen Parrott
 The Renegade of Fairfax, Va

 United, We are None.
 Divided, We are One.

 --000000000000f8447f06139ffcd8
 Content-Type: text/html; charset="UTF-8"
 Content-Transfer-Encoding: quoted-printable

 <div dir=3D"ltr">That&#39;s probably the original.<div><br></div><div>Somet=
 hing of a Relic.</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr"=
  class=3D"gmail_attr">On Wed, Mar 13, 2024 at 7:25=E2=80=AFPM David H. Gutt=
 eridge &lt;<a href=3D"mailto:david@gutteridge.ca">david@gutteridge.ca</a>&g=
 t; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0p=
 x 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The fo=
 llowing reply was made to PR pkg/57970; it has been noted by GNATS.<br>
 <br>
 From: &quot;David H. Gutteridge&quot; &lt;<a href=3D"mailto:david@gutteridg=
 e.ca" target=3D"_blank">david@gutteridge.ca</a>&gt;<br>
 To: Gnats Bugs &lt;<a href=3D"mailto:gnats-bugs@netbsd.org" target=3D"_blan=
 k">gnats-bugs@netbsd.org</a>&gt;<br>
 Cc: <br>
 Subject: Re: pkg/57970: pkgsrc textproc/nbsed is super old and doesn&#39;t =
 support<br>
 =C2=A0some things that modern seds support<br>
 Date: Wed, 13 Mar 2024 19:21:19 -0400<br>
 <br>
 =C2=A0It seems errc(3), and so also verrc(3), need to be added to<br>
 =C2=A0libnbcompat, since the former is now used in compile.c. Or we just op=
 en<br>
 =C2=A0code the equivalent in those two places instead.<br>
 <br>
 =C2=A0That issue brushed aside, it then compiles for me on Fedora 39.<br>
 <br>
 =C2=A0Dave<br>
 <br>
 </blockquote></div><br clear=3D"all"><div><br></div><span class=3D"gmail_si=
 gnature_prefix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><d=
 iv dir=3D"ltr">Justin Allen Parrott<div>The Renegade of Fairfax, Va</div><d=
 iv><br></div><div>United, We are None.</div><div>Divided, We are One.</div>=
 </div></div>

 --000000000000f8447f06139ffcd8--

From: Jonathan Perkin <jperkin@mnx.io>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	thorpej@me.com
Subject: Re: pkg/57970: pkgsrc textproc/nbsed is super old and doesn't
 support some things that modern seds support
Date: Wed, 20 Mar 2024 15:33:23 +0000

 * On 2024-03-13 at 23:25 GMT, David H. Gutteridge wrote:

 > It seems errc(3), and so also verrc(3), need to be added to
 > libnbcompat, since the former is now used in compile.c. Or we just open
 > code the equivalent in those two places instead.

 Yes, to confirm, this is broken on older illumos and Solaris platforms, 
 as errc(3C) was only added to illumos in 2022.  Bootstrap will likely be 
 broken for a number of users.

 The daily bulk builds won't show this as the platform is recent, but you 
 can see it in e.g.

    https://us-central.manta.mnx.io/pkgsrc/public/reports/trunk/tools/20240320.1010/nbsed-20240312nb1/build.log

 as my release builds are still performed on a 20210824 platform, though 
 thankfully I switched to our native sed a while back so we are at least 
 shielded from this.

 It would be nice if someone could take responsibility for fixing this, 
 I'm probably not going to get time this week.

 -- 
 Jonathan Perkin   -   mnx.io   -   pkgsrc.smartos.org
 Open Source Complete Cloud   www.tritondatacenter.com

From: "David H. Gutteridge" <gutteridge@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57970 CVS commit: pkgsrc/textproc/nbsed
Date: Wed, 20 Mar 2024 20:37:28 +0000

 Module Name:	pkgsrc
 Committed By:	gutteridge
 Date:		Wed Mar 20 20:37:28 UTC 2024

 Modified Files:
 	pkgsrc/textproc/nbsed: Makefile
 	pkgsrc/textproc/nbsed/files: compile.c

 Log Message:
 nbsed: fix building on operating systems that don't have errc(3)

 One of the simplest ways of addressing this is to switch to errx(3). It
 seems unclear what the absolute minimums are for C compilers required
 for bootstrap, and EILSEQ wasn't codified until the 1994 Normative
 Amendment 1 to C89, so its value (per NetBSD) is hard-coded here, too.

 This introduces a small diff to upstream, but seems safer than altering
 libnbcompat this close to a quarterly branch freeze. (There are also
 some questions about libnbcompat's current state to be added to a PR.)

 Relates to PR pkg/57970.

 Tested on Fedora Linux 39, which was previously broken.


 To generate a diff of this commit:
 cvs rdiff -u -r1.27 -r1.28 pkgsrc/textproc/nbsed/Makefile
 cvs rdiff -u -r1.8 -r1.9 pkgsrc/textproc/nbsed/files/compile.c

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

From: "David H. Gutteridge" <david@gutteridge.ca>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/57970: pkgsrc textproc/nbsed is super old and doesn't support
 some things that modern seds support
Date: Thu, 11 Apr 2024 21:25:46 -0400

 Another change set was pushed to fix QNX builds.
 http://mail-index.netbsd.org/pkgsrc-changes/2024/03/31/msg296128.html

 I guess we can close this now. Deal with things if they come up.

 Dave

State-Changed-From-To: open->closed
State-Changed-By: gutteridge@NetBSD.org
State-Changed-When: Fri, 12 Apr 2024 01:34:17 +0000
State-Changed-Why:
Closing, we'll deal with things if they come up.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.