NetBSD Problem Report #35487

From www@NetBSD.org  Fri Jan 26 17:19:34 2007
Return-Path: <www@NetBSD.org>
Received: by narn.NetBSD.org (Postfix, from userid 31301)
	id D006763B8AD; Fri, 26 Jan 2007 17:19:34 +0000 (UTC)
Message-Id: <20070126171934.D006763B8AD@narn.NetBSD.org>
Date: Fri, 26 Jan 2007 17:19:34 +0000 (UTC)
From: mm_lists@pulsar-zone.net
Reply-To: mm_lists@pulsar-zone.net
To: gnats-bugs@NetBSD.org
Subject: pkgsrc-2006Q4: mkdir used instead of ${MKDIR} in toolchain wrapper script
X-Send-Pr-Version: www-1.0

>Number:         35487
>Category:       pkg
>Synopsis:       pkgsrc-2006Q4: mkdir used instead of ${MKDIR} in toolchain wrapper script
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    rillig
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 26 17:20:00 +0000 2007
>Closed-Date:    Mon Jun 18 07:36:37 +0000 2007
>Last-Modified:  Mon Jun 18 07:36:37 +0000 2007
>Originator:     Matthew Mondor
>Release:        3.1_STABLE
>Organization:
Pulsar-Zone
>Environment:
NetBSD hal.xisop 3.1_STABLE NetBSD 3.1_STABLE (GENERIC_MM) #6: Fri Dec 29 23:55:40 EST 2006  root@hal.xisop:/usr/src/sys/arch/i386/compile/GENERIC_MM i386
>Description:
pkgsrc/mk/bsd.wrapper.mk used mkdir instead of ${MKDIR} at one instance,
causing package builds to error.  An example:

===> Creating toolchain wrappers for digest-20060826
mkdir: /usr/pkgsrc/pkgtools/digest/work/.wrapper/tmp: File exists
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/pkgtools/digest
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/pkgtools/digest

The MKDIR wrapper appears to implicitely use -p.  A diff is provided.
>How-To-Repeat:
Attempt to create any package with a recent pkgsrc-2006Q4 on
NetBSD 3.1_STABLE.
>Fix:
cvs diff: Diffing .
Index: bsd.wrapper.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/wrapper/bsd.wrapper.mk,v
retrieving revision 1.60
diff -u -r1.60 bsd.wrapper.mk
--- bsd.wrapper.mk      26 Nov 2006 14:42:17 -0000      1.60
+++ bsd.wrapper.mk      26 Jan 2007 17:11:12 -0000
@@ -571,7 +571,7 @@

 .  if !target(${_WRAP_CACHE.${_wrappee_}})
 ${_WRAP_CACHE.${_wrappee_}}:
-       ${RUN} mkdir ${.TARGET:H}
+       ${RUN} ${MKDIR} ${.TARGET:H}
        ${RUN} echo "cachehit=no" > ${.TARGET}
 .  endif


>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->rillig
Responsible-Changed-By: rillig@netbsd.org
Responsible-Changed-When: Thu, 22 Feb 2007 23:44:16 +0000
Responsible-Changed-Why:
I broke it.


State-Changed-From-To: open->feedback
State-Changed-By: rillig@netbsd.org
State-Changed-When: Thu, 22 Feb 2007 23:44:16 +0000
State-Changed-Why:

Can you please insert the following lines before the mkdir line?

	echo "$$PATH"; type mkdir
	exit 1

To my knowledge, at this point, the tool wrapper directory should be very
early in the PATH, so I expect the wrapped mkdir to be called.

Roland


From: Matthew Mondor <mm_lists@pulsar-zone.net>
To: gnats-bugs@NetBSD.org
Cc: rillig@NetBSD.org, pkg-manager@NetBSD.org,
	pkgsrc-bugs@NetBSD.org, gnats-admin@NetBSD.org
Subject: Re: pkg/35487 (pkgsrc-2006Q4: mkdir used instead of ${MKDIR} in
 toolchain wrapper script)
Date: Sun, 25 Feb 2007 17:15:19 -0500

 On Thu, 22 Feb 2007 23:44:17 +0000 (UTC)
 rillig@netbsd.org wrote:

 > Can you please insert the following lines before the mkdir line?
 > 
 > 	echo "$$PATH"; type mkdir
 > 	exit 1
 > 
 > To my knowledge, at this point, the tool wrapper directory should be very
 > early in the PATH, so I expect the wrapped mkdir to be called.

 Results:

 echo "$PATH"; type mkdir
 /sbin:/usr/sbin:/bin:/usr/bin:/usr/pkg/sbin:/usr/pkg/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin:/usr/games:/usr/pkg/libexec/xscreensaver:/usr/local/spidermonkey/bin:/usr/pkg/java/sun-1.4/bin
 mkdir is /bin/mkdir
 exit 1
 make: exec(exit) failed (No such file or directory)

 I guess this could have to do with /etc/profile or ~/.shrc.  However,
 using ${MKDIR} like at every other instance in the script solves that
 problem.

 Thanks
 -- 
 Matt

From: Roland Illig <rillig@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/35487 (pkgsrc-2006Q4: mkdir used instead of ${MKDIR} in toolchain
 wrapper script)
Date: Mon, 05 Mar 2007 23:38:44 +0100

 Matthew Mondor wrote:
 > echo "$PATH"; type mkdir
 > /sbin:/usr/sbin:/bin:/usr/bin:/usr/pkg/sbin:/usr/pkg/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin:/usr/games:/usr/pkg/libexec/xscreensaver:/usr/local/spidermonkey/bin:/usr/pkg/java/sun-1.4/bin
 > mkdir is /bin/mkdir
 > exit 1
 > make: exec(exit) failed (No such file or directory)
 > 
 > I guess this could have to do with /etc/profile or ~/.shrc.  However,
 > using ${MKDIR} like at every other instance in the script solves that
 > problem.

 I know that this would solve the problem, but this is only a symptom for 
 a more severe bug in pkgsrc, and I would like to find and fix that real bug.

 Roland

From: Roland Illig <rillig@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/35487 CVS commit: pkgsrc/mk/wrapper
Date: Mon, 18 Jun 2007 07:33:35 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	rillig
 Date:		Mon Jun 18 07:33:35 UTC 2007

 Modified Files:
 	pkgsrc/mk/wrapper: bsd.wrapper.mk

 Log Message:
 Changed the plain "mkdir" into ${MKDIR}, like in all the other cases.
 Apparently, the tools directory isn't in the PATH at the point where
 this code is executed.

 Fixes PR 35487.


 To generate a diff of this commit:
 cvs rdiff -r1.69 -r1.70 pkgsrc/mk/wrapper/bsd.wrapper.mk

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

State-Changed-From-To: feedback->closed
State-Changed-By: rillig@netbsd.org
State-Changed-When: Mon, 18 Jun 2007 07:36:37 +0000
State-Changed-Why:
Feedback has been given a long time ago, and finally, in 2007Q2, the
bug will be fixed. Thanks for the PR, and sorry that this trivial thing
took so long.


>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.