NetBSD Problem Report #55350

From www@netbsd.org  Fri Jun  5 21:24:23 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-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 444581A9219
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  5 Jun 2020 21:24:23 +0000 (UTC)
Message-Id: <20200605212422.5FEE91A921E@mollari.NetBSD.org>
Date: Fri,  5 Jun 2020 21:24:22 +0000 (UTC)
From: cmhanson@eschatologist.net
Reply-To: cmhanson@eschatologist.net
To: gnats-bugs@NetBSD.org
Subject: NetBSD does not have getopt_long_only(3)
X-Send-Pr-Version: www-1.0

>Number:         55350
>Category:       lib
>Synopsis:       NetBSD does not have getopt_long_only(3)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 05 21:25:00 +0000 2020
>Last-Modified:  Sat Jun 06 09:20:01 +0000 2020
>Originator:     Chris Hanson
>Release:        NetBSD 9.0
>Organization:
>Environment:
NetBSD core.eschatologist.net 9.0_STABLE NetBSD 9.0_STABLE (GENERIC) #2: Mon Jun  1 14:08:20 PDT 2020  cmh@core.eschatologist.net:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
>Description:
Linux and most other BSD systems, including macOS, support getopt_long_only(3). For straightforward compatibility with software written for these platforms, NetBSD should include it as well.
>How-To-Repeat:

>Fix:

>Audit-Trail:
From: Kamil Rytarowski <kamil@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: lib/55350: NetBSD does not have getopt_long_only(3)
Date: Sat, 6 Jun 2020 00:15:50 +0200

 On 05.06.2020 23:25, cmhanson@eschatologist.net wrote:
 >> Number:         55350
 >> Category:       lib
 >> Synopsis:       NetBSD does not have getopt_long_only(3)
 >> Confidential:   no
 >> Severity:       non-critical
 >> Priority:       medium
 >> Responsible:    lib-bug-people
 >> State:          open
 >> Class:          sw-bug
 >> Submitter-Id:   net
 >> Arrival-Date:   Fri Jun 05 21:25:00 +0000 2020
 >> Originator:     Chris Hanson
 >> Release:        NetBSD 9.0
 >> Organization:
 >> Environment:
 > NetBSD core.eschatologist.net 9.0_STABLE NetBSD 9.0_STABLE (GENERIC) #2: Mon Jun  1 14:08:20 PDT 2020  cmh@core.eschatologist.net:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
 >> Description:
 > Linux and most other BSD systems, including macOS, support getopt_long_only(3). For straightforward compatibility with software written for these platforms, NetBSD should include it as well.
 >> How-To-Repeat:
 > 
 >> Fix:
 > 

 Last time I worked on it, there was a decision to not implement it.

 Do you need for anything particular?

From: Jason Thorpe <thorpej@me.com>
To: gnats-bugs@netbsd.org
Cc: lib-bug-people@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org,
 cmhanson@eschatologist.net
Subject: Re: lib/55350: NetBSD does not have getopt_long_only(3)
Date: Fri, 5 Jun 2020 16:16:37 -0700

 > On Jun 5, 2020, at 3:20 PM, Kamil Rytarowski <kamil@netbsd.org> wrote:
 >=20
 > Last time I worked on it, there was a decision to not implement it.

 If it's for broader compatibility, why would we not provide it?  Seems =
 ridiculous.

 -- thorpej

From: Christos Zoulas <christos@zoulas.com>
To: Jason Thorpe <thorpej@me.com>
Cc: gnats-bugs@netbsd.org,
 lib-bug-people@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org,
 cmhanson@eschatologist.net
Subject: Re: lib/55350: NetBSD does not have getopt_long_only(3)
Date: Fri, 5 Jun 2020 19:19:06 -0400

 --Apple-Mail=_19A97EBC-6523-401F-A129-51186B2C87E9
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/plain;
 	charset=us-ascii

 I am torn on that one... It is an ugly interface... I am all for =
 compatibility but one can just do #define getopt_option_long_only =
 getopt_option_long with the only functional difference that -long-option =
 does not work and needs to be entered as --long-option.

 christos

 > On Jun 5, 2020, at 7:16 PM, Jason Thorpe <thorpej@me.com> wrote:
 >=20
 >=20
 >> On Jun 5, 2020, at 3:20 PM, Kamil Rytarowski <kamil@netbsd.org> =
 wrote:
 >>=20
 >> Last time I worked on it, there was a decision to not implement it.
 >=20
 > If it's for broader compatibility, why would we not provide it?  Seems =
 ridiculous.
 >=20
 > -- thorpej


 --Apple-Mail=_19A97EBC-6523-401F-A129-51186B2C87E9
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename=signature.asc
 Content-Type: application/pgp-signature;
 	name=signature.asc
 Content-Description: Message signed with OpenPGP

 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - http://gpgtools.org

 iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCXtrS6gAKCRBxESqxbLM7
 OjrDAJ9/dcJ62z1czwuzf6C2VwJXAyC1CwCg6/AbWTVdWXK8FvSZmh5Po7Nn0b0=
 =4waE
 -----END PGP SIGNATURE-----

 --Apple-Mail=_19A97EBC-6523-401F-A129-51186B2C87E9--

From: Kamil Rytarowski <kamil@netbsd.org>
To: Jason Thorpe <thorpej@me.com>, gnats-bugs@netbsd.org
Cc: lib-bug-people@netbsd.org, gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org, cmhanson@eschatologist.net
Subject: Re: lib/55350: NetBSD does not have getopt_long_only(3)
Date: Sat, 6 Jun 2020 01:32:23 +0200

 On 06.06.2020 01:16, Jason Thorpe wrote:
 > 
 >> On Jun 5, 2020, at 3:20 PM, Kamil Rytarowski <kamil@netbsd.org> wrote:
 >>
 >> Last time I worked on it, there was a decision to not implement it.
 > 
 > If it's for broader compatibility, why would we not provide it?  Seems ridiculous.
 > 
 > -- thorpej
 > 

 There is not a lot of software that really needs it and if so, there is
 usually provided as a fallback.

From: Joerg Sonnenberger <joerg@bec.de>
To: Jason Thorpe <thorpej@me.com>
Cc: gnats-bugs@netbsd.org, lib-bug-people@netbsd.org,
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,
	cmhanson@eschatologist.net
Subject: Re: lib/55350: NetBSD does not have getopt_long_only(3)
Date: Sat, 6 Jun 2020 02:24:27 +0200

 On Fri, Jun 05, 2020 at 04:16:37PM -0700, Jason Thorpe wrote:
 > 
 > > On Jun 5, 2020, at 3:20 PM, Kamil Rytarowski <kamil@netbsd.org> wrote:
 > > 
 > > Last time I worked on it, there was a decision to not implement it.
 > 
 > If it's for broader compatibility, why would we not provide it?  Seems ridiculous.

 It's only used by certain GNU programs with a horrible inconsistent CLI.
 Using it can be considered a huge bug in the program. It really
 shouldn't be added.

 Joerg

From: Chris Hanson <cmhanson@eschatologist.net>
To: Joerg Sonnenberger <joerg@bec.de>
Cc: Jason Thorpe <thorpej@me.com>,
 gnats-bugs@netbsd.org,
 lib-bug-people@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: lib/55350: NetBSD does not have getopt_long_only(3)
Date: Fri, 5 Jun 2020 17:29:11 -0700

 On Jun 5, 2020, at 5:24 PM, Joerg Sonnenberger <joerg@bec.de> wrote:
 >=20
 > On Fri, Jun 05, 2020 at 04:16:37PM -0700, Jason Thorpe wrote:
 >>=20
 >>> On Jun 5, 2020, at 3:20 PM, Kamil Rytarowski <kamil@netbsd.org> =
 wrote:
 >>>=20
 >>> Last time I worked on it, there was a decision to not implement it.
 >>=20
 >> If it's for broader compatibility, why would we not provide it?  =
 Seems ridiculous.
 >=20
 > It's only used by certain GNU programs with a horrible inconsistent =
 CLI.
 > Using it can be considered a huge bug in the program. It really
 > shouldn't be added.

 Not just GNU programs; I encountered the lack of this building SoapyDSR.

 Is it reasonable to demand these programs change in order to run? =
 FreeBSD and macOS don=E2=80=99t seem to think so.

From: Joerg Sonnenberger <joerg@bec.de>
To: Chris Hanson <cmhanson@eschatologist.net>
Cc: Jason Thorpe <thorpej@me.com>, gnats-bugs@netbsd.org,
	lib-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: lib/55350: NetBSD does not have getopt_long_only(3)
Date: Sat, 6 Jun 2020 02:45:58 +0200

 On Fri, Jun 05, 2020 at 05:29:11PM -0700, Chris Hanson wrote:
 > On Jun 5, 2020, at 5:24 PM, Joerg Sonnenberger <joerg@bec.de> wrote:
 > > 
 > > On Fri, Jun 05, 2020 at 04:16:37PM -0700, Jason Thorpe wrote:
 > >> 
 > >>> On Jun 5, 2020, at 3:20 PM, Kamil Rytarowski <kamil@netbsd.org> wrote:
 > >>> 
 > >>> Last time I worked on it, there was a decision to not implement it.
 > >> 
 > >> If it's for broader compatibility, why would we not provide it?  Seems ridiculous.
 > > 
 > > It's only used by certain GNU programs with a horrible inconsistent CLI.
 > > Using it can be considered a huge bug in the program. It really
 > > shouldn't be added.
 > 
 > Not just GNU programs; I encountered the lack of this building SoapyDSR.
 > 
 > Is it reasonable to demand these programs change in order to run? FreeBSD and macOS don’t seem to think so.

 Have you read what was said about it earlier? It's really completely
 f**ked up. In most cases, just -Dgetopt_long_only=getopt_long works well
 enough.

 Joerg

From: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: lib/55350: NetBSD does not have getopt_long_only(3)
Date: Sat, 6 Jun 2020 09:16:35 +0000

 It's worth noting there's a middle ground between "modify upstream
 program in a way that they won't like" and "add to libc", which is to
 add it as a local shim.

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.