NetBSD Problem Report #59595

From martin@aprisoft.de  Thu Aug 14 08:52:16 2025
Return-Path: <martin@aprisoft.de>
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)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 23EE81A923A
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 14 Aug 2025 08:52:16 +0000 (UTC)
Message-Id: <20250814085201.4103F5CC793@emmas.aprisoft.de>
Date: Thu, 14 Aug 2025 10:52:01 +0200 (CEST)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: sh(1) in -current breaks pkgsrc/net/libcmis configure
X-Send-Pr-Version: 3.95

>Number:         59595
>Notify-List:    kim
>Category:       pkg
>Synopsis:       sh(1) in -current breaks pkgsrc/net/libcmis configure
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 14 08:55:00 +0000 2025
>Closed-Date:    Sat Oct 04 14:06:03 +0000 2025
>Last-Modified:  Sat Oct 04 14:06:03 +0000 2025
>Originator:     Martin Husemann
>Release:        NetBSD 11.99.1
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD martins.aprisoft.de 11.99.1 NetBSD 11.99.1 (GENERIC) #280: Tue Aug 12 17:42:15 CEST 2025 martin@martins.aprisoft.de:/home/martin/current/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:

The /bin/sh in -current is unable to run the configure script in
pkgsrc/net/libcmis, it fails to detect boost headers.

>How-To-Repeat:

On an up to date -current amd64 machine, with up to date pkgsrc:

cd pkgsrc/net/libcmis && make

It fails very early in the configure script trying to detect boost headers.

>Fix:
Downgrading /bin/sh to cvs date D2025.06.30.22.00.00
works around the bug.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: bin-bug-people->kre
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Thu, 14 Aug 2025 08:56:46 +0000
Responsible-Changed-Why:
Robert, could you please have a look?
Thanks!


From: Kimmo Suominen <kim@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/59595: sh(1) in -current breaks pkgsrc/net/libcmis configure
Date: Thu, 14 Aug 2025 17:38:52 +0300

 On Thu, Aug 14, 2025 at 08:55:00AM +0000, martin@NetBSD.org wrote:
 > Downgrading /bin/sh to cvs date D2025.06.30.22.00.00
 > works around the bug.

 Using /bin/sh from 20250801170320Z also appears to run "make configure"
 in pkgsrc/net/libcmis without issues.  This would seem to indicate the
 `cd ""' changes as the culprit.

 I think the code in m4/boost.m4 (included in configure) ends up running
 "cd ''" and does not survive it.  I'm not sure why it does not survive it,
 but the following change would avoid the "cd" and appears to work.

 --- m4/boost.m4.orig	2023-10-09 12:06:53.000000000 +0000
 +++ m4/boost.m4	2025-08-14 14:33:06.230312344 +0000
 @@ -170,9 +170,8 @@
      # searching $boost_dir" itself.  Entries are whitespace separated.
      #
      # I didn't indent this loop on purpose (to avoid over-indented code)
 -    boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \
 -        && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \
 -        && echo .`
 +    boost_layout_system_search_list=`ls -1 "$boost_dir" 2> /dev/null \
 +        | "${GREP}" '^boost-' | sort -rn -t- -k2 && echo .`
      for boost_inc in $boost_layout_system_search_list
      do
        if test x"$boost_inc" != x.; then

 Kind regards,
 + Kimmo

Responsible-Changed-From-To: kre->pkg-manager
Responsible-Changed-By: kre@NetBSD.org
Responsible-Changed-When: Thu, 14 Aug 2025 21:04:16 +0000
Responsible-Changed-Why:
This is a pkg bug, not one in /bin/sh


From: Robert Elz <kre@munnari.OZ.AU>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/59595: sh(1) in -current breaks pkgsrc/net/libcmis configure
Date: Fri, 15 Aug 2025 04:01:50 +0700

     Date:        Thu, 14 Aug 2025 08:55:00 +0000 (UTC)
     From:        martin@NetBSD.org
     Message-ID:  <20250814085500.7FAC31A923E@mollari.NetBSD.org>

   | Downgrading /bin/sh to cvs date D2025.06.30.22.00.00
   | works around the bug.

 Anything which breaks because cd "" no longer works, is going
 to be broken all over the place now, or soon, most shells which
 used to turn that into "cd ." (which was very common) either have
 already (FreeBSD in early July, bash in 5.3, ...) or will soon
 remove that hack.   So an upstream fix is needed (and in the
 interim, in pkgsrc, a local patch perhaps, as Kimmo provided for
 this case - though that is probably not the correct way, as
 there's no guarantee that ls "" is going to work either.

 Rather, change

 	cd "$boost_dir" 2>/dev/null

 in that script into

 	cd "${boost_dir:-.}" 2>/dev/null

 so if boost_dir == "" it will "cd ." instead, which is what cd ''
 previously did.

 kre

 ps: it fails, as "cd ''" now exits with status != 0, which means none
 of the following '&&' commands in that cmdsub get run, the result from
 the cmdsub will be empty, resulting in the following for loop not executing
 its body at all.


From: Kimmo Suominen <kim@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/59595: sh(1) in -current breaks pkgsrc/net/libcmis configure
Date: Fri, 15 Aug 2025 00:48:51 +0300

 On Thu, Aug 14, 2025 at 09:05:01PM +0000, Robert Elz via gnats wrote:
 >  	cd "${boost_dir:-.}" 2>/dev/null

 Thanks -- I tried that in the "set" commands, but got confused about the
 script still not continuing.  But the reason for not continuing is, as
 you pointed out, the lack of output from the && commands not being run.

 The "cd" still seems unnecessary: you get the same output from just

     ls -1 "${boost_dir:-.}" 2> /dev/null | ...

 I don't think using "cd" to ensure that we are looking at a directory is
 important there.

 Kind regards,
 + Kimmo

State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Sat, 04 Oct 2025 14:06:03 +0000
State-Changed-Why:
no bug in sh(1), but in 3rd party scripts


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.