NetBSD Problem Report #23821

Received: (qmail 14482 invoked by uid 605); 21 Dec 2003 12:28:31 -0000
Message-Id: <200312211228.HAA08415@Sparkle.Rodents.Montreal.QC.CA>
Date: Sun, 21 Dec 2003 07:28:28 -0500 (EST)
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: mouse@Rodents.Montreal.QC.CA
To: gnats-bugs@gnats.netbsd.org
Subject: [dM] make's chdir("obj") undocumented
X-Send-Pr-Version: 3.95

>Number:         23821
>Category:       toolchain
>Synopsis:       make's chdir to ./obj is undocumented
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dholland
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 21 12:29:00 +0000 2003
>Closed-Date:    
>Last-Modified:  Sun Jun 17 17:06:58 +0000 2012
>Originator:     der Mouse
>Release:        1.4T, 1.6.1, probably -current
>Organization:
	Dis-
>Environment:
	Any
>Description:
	Under some circumstances, if ./obj exists, make(1) will
	silently chdir to it.  This is known to break ghostscript's
	build under at least two versions.  This is bad enough (there
	really is no reason "obj"'s mere existence should be magic when
	make is given no special options), but for the manpage to fail
	to mention it is inexcusable - especially when it is almost
	aggressively omitted; the manpage talks about MAKEOBJDIRPREFIX
	and MAKEOBJDIR, but fails to mention that if neither is set,
	./obj is used if it exists.  (If I hadn't seen the obj/
	semantics mentioned on-list, I would have been very
	hard-pressed to figure out why the build was so inexplicably
	breaking.  I probably would have had to throw a debugger at it;
	even as it was, I had to use the ktrace sledgehammer before I
	twigged to it.)

	I noticed this under 1.4T.  I confirmed its presence under
	1.6.1.  I read the code and it looks to me as though it will
	also be present in -current, though I haven't tried it there.
>How-To-Repeat:
	(This transcript from a 1.6.1 system.)
	$ cat Makefile
	foo: bar
	        mkdir -p obj
	        cp bar foo
	$ touch bar
	$ ls -ld foo bar obj
	ls: foo: No such file or directory
	ls: obj: No such file or directory
	-rw-r--r--  1 root  wheel  0 Dec 21 07:09 bar
	$ make foo
	mkdir -p obj
	cp bar foo
	$ rm foo
	$ make foo
	mkdir -p obj
	cp bar foo
	cp: bar: No such file or directory
	*** Error code 1

	Stop.
	make: stopped in /home/mouse
	$ 

	Then change the Makefile so the directory name is something
	else (and remove the obj/ that was created), and....

	$ cat Makefile
	foo: bar
	        mkdir -p objx
	        cp bar foo
	$ touch bar
	$ ls -ld foo bar obj objx
	ls: foo: No such file or directory
	ls: obj: No such file or directory
	ls: objx: No such file or directory
	-rw-r--r--  1 root  wheel  0 Dec 21 07:09 bar
	$ make foo
	mkdir -p objx
	cp bar foo
	$ rm foo
	$ make foo
	mkdir -p objx
	cp bar foo
	$ 

>Fix:
	Personally, I feel that for make to use ./obj in the absence of
	any explicit instruction to do so (such as an environment
	variable or a command-line flag) is a bug.  (It most certainly
	violates least surprise.)  Because I do not expect NetBSD to
	agree with this position, I have classed this as a doc-bug
	rather than a sw-bug, because the problem then becomes that
	this use of ./obj is not documented, with the fix being to
	describe the actual behaviour in the manpage.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: bin-bug-people->toolchain-manager
Responsible-Changed-By: jmc@netbsd.org
Responsible-Changed-When: Fri, 28 Jan 2005 05:30:02 +0000
Responsible-Changed-Why:
toolchain issue


Responsible-Changed-From-To: toolchain-manager->lukem
Responsible-Changed-By: lukem@netbsd.org
Responsible-Changed-When: Thu, 23 Jun 2005 02:41:25 +0000
Responsible-Changed-Why:
I dealt with it


State-Changed-From-To: open->closed
State-Changed-By: lukem@netbsd.org
State-Changed-When: Thu, 23 Jun 2005 02:41:25 +0000
State-Changed-Why:
I've excised the automagic support for setting .OBJDIR to
	./obj.${MACHINE}
	./obj
	/usr/obj/`pwd`
from make(1), so the problem shouldn't occur any more.

I've also improved the documentation for the existing .OBJDIR behaviour


State-Changed-From-To: closed->feedback
State-Changed-By: lukem@netbsd.org
State-Changed-When: Mon, 27 Jun 2005 01:04:38 +0000
State-Changed-Why:
I had to back out my removal of the "chdir to ./obj" feature for
the time being.
However, I have documented the semantics that make(1) currently uses;
see make.1 rev 1.117 for details.
Does that suffice, or would rather keep this PR in a non-closed state
until the "chdir to ./obj" semantics have been removed ?


From: der Mouse <mouse@Rodents.Montreal.QC.CA>
To: gnats-bugs@gnats.netbsd.org
Cc: 
Subject: Re: toolchain/23821
Date: Tue, 5 Feb 2008 00:17:50 -0500 (EST)

 (I'm not sure why it took so long for me to respond to this - have I
 really been getting these gnats reminders since July '05?!  I don't
 know why it took me until now to actually do anything about them.)

 > I had to back out my removal of the "chdir to ./obj" feature for the
 > time being.
 > However, I have documented the semantics that make(1) currently uses;
 > see make.1 rev 1.117 for details.
 > Does that suffice, or would rather keep this PR in a non-closed state
 > until the "chdir to ./obj" semantics have been removed ?

 Well, strictly, it suffices, but if the intent is to remove the ./obj
 semantics eventually (as your "for the time being" implies), I'd prefer
 to keep the PR open until that happens, if only as a reminder that the
 issue is pending.  But, on the other hand, I note that you wrote that
 in June '05 and the recently-released 4.0 still has the ./obj
 bu^Wmisfeature, so maybe it isn't all that temporary.

 /~\ The ASCII				der Mouse
 \ / Ribbon Campaign
  X  Against HTML	       mouse@rodents.montreal.qc.ca
 / \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

From: Luke Mewburn <lukem@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: lukem@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,
	mouse@Rodents.Montreal.QC.CA
Subject: Re: toolchain/23821
Date: Fri, 8 Feb 2008 14:50:26 +1100

 --lHle3uIue3i85Vco
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline

 On Tue, Feb 05, 2008 at 05:25:01AM +0000, der Mouse wrote:
   |  Well, strictly, it suffices, but if the intent is to remove the ./obj
   |  semantics eventually (as your "for the time being" implies), I'd prefer
   |  to keep the PR open until that happens, if only as a reminder that the
   |  issue is pending.

 That's fine with me.

 --lHle3uIue3i85Vco
 Content-Type: application/pgp-signature
 Content-Disposition: inline

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.7 (NetBSD)

 iD8DBQFHq9GCpBhtmn8zJHIRAgHdAKDRIo4fQ+/CWkWrLgHsxpp5asATFQCgnJre
 lN/tuhifLDMcVAFnT0PIvfg=
 =d5kK
 -----END PGP SIGNATURE-----

 --lHle3uIue3i85Vco--

State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 04 May 2008 02:15:02 +0000
State-Changed-Why:
This doesn't need to be in feedback any more.


Responsible-Changed-From-To: lukem->bin-bug-people
Responsible-Changed-By: lukem@NetBSD.org
Responsible-Changed-When: Sat, 16 Jun 2012 06:11:08 +0000
Responsible-Changed-Why:
Back to the pool for a make guru to look at


Responsible-Changed-From-To: bin-bug-people->dholland
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Sun, 17 Jun 2012 17:06:58 +0000
Responsible-Changed-Why:
this one is more or less my problem as things stand...


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.