From pavalos@theshell.com  Wed Aug 15 18:47:31 2001
Return-Path: <pavalos@theshell.com>
Received: from theshell.com (arsenic.theshell.com [63.236.138.5])
	by hub.freebsd.org (Postfix) with SMTP id 0973F37B409
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 15 Aug 2001 18:47:31 -0700 (PDT)
	(envelope-from pavalos@theshell.com)
Received: (qmail 95768 invoked from network); 16 Aug 2001 01:47:30 -0000
Received: from radium.theshell.com (root@63.236.138.3)
  by arsenic.theshell.com with SMTP; 16 Aug 2001 01:47:30 -0000
Received: (from pavalos@localhost)
	by radium.theshell.com (8.11.5/8.11.5) id f7G1lUE45587;
	Wed, 15 Aug 2001 18:47:30 -0700 (PDT)
	(envelope-from pavalos)
Message-Id: <200108160147.f7G1lUE45587@radium.theshell.com>
Date: Wed, 15 Aug 2001 18:47:30 -0700 (PDT)
From: Peter Avalos <pavalos@theshell.com>
Reply-To: Peter Avalos <pavalos@theshell.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] Setting WRKDIRPREFIX=/usr/obj is a bad idea, but not commented
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         29740
>Category:       docs
>Synopsis:       [PATCH] Setting WRKDIRPREFIX=/usr/obj is a bad idea, but not commented
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 15 18:50:01 PDT 2001
>Closed-Date:    Wed Sep 5 13:29:12 PDT 2001
>Last-Modified:  Wed Sep 05 13:29:56 PDT 2001
>Originator:     Peter Avalos
>Release:        FreeBSD 4.4-PRERELEASE i386
>Organization:
none
>Environment:
System: FreeBSD radium.theshell.com 4.4-PRERELEASE FreeBSD 4.4-PRERELEASE #1: Sat Aug 11 20:19:09 PDT 2001 pavalos@radium.theshell.com:/usr/obj/usr/src/sys/RADIUM i386


	
>Description:
	When setting WRKDIRPREFIX=/usr/obj, make gets confused. Since
/usr/obj is a fairly intuitive place to put the temp files for making
ports, I think it should be documented in make.conf(5) and
src/etc/defaults/make.conf. ports(7) may also be a good place to put
this as well.
>How-To-Repeat:
	echo WRKDIRPREFIX=/usr/obj >> /etc/make.conf
	Try building a port.
>Fix:

	Although quite simple, these diffs should provide enough
documentation so people don't get too stuck on this problem. Since
4.4-RELEASE is coming quickly, this may be a quite good MFC candidate.


Index: make.conf.5
===================================================================
RCS file: /home/ncvs/src/share/man/man5/make.conf.5,v
retrieving revision 1.25
diff -u -r1.25 make.conf.5
--- make.conf.5	2001/08/07 13:26:57	1.25
+++ make.conf.5	2001/08/16 01:33:50
@@ -760,7 +760,8 @@
 support will build without X11 support by default.
 .It Va WRKDIRPREFIX
 .Pq Vt str
-Where to create temporary files used when building ports.
+Specify where to create temporary files used when building ports.
+Do not set this to /usr/obj.
 .It Va X11BASE
 .Pq Vt str
 Should be set to where the X11 distribution has been


Index: make.conf
===================================================================
RCS file: /home/ncvs/src/etc/defaults/make.conf,v
retrieving revision 1.171
diff -u -r1.171 make.conf
--- make.conf	2001/08/12 18:47:56	1.171
+++ make.conf	2001/08/16 01:33:02
@@ -300,7 +300,7 @@
 #MASTER_SORT_REGEX?=	^file: ^ftp://ftp\.FreeBSD\.org/pub/FreeBSD/ports/local-distfiles/ ://[^/]*\.jp/ ://[^/]*\.jp\.
 #
 # Ports can place their working directories somewhere other than under 
-# /usr/ports.  
+# /usr/ports.  Do not set this to /usr/obj.
 #WRKDIRPREFIX=	/var/tmp
 #
 # Kerberos IV
>Release-Note:
>Audit-Trail:

From: Dima Dorfman <dima@unixfreak.org>
To: Peter Avalos <pavalos@theshell.com>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: docs/29740: [PATCH] Setting WRKDIRPREFIX=/usr/obj is a bad idea, but not commented 
Date: Sun, 19 Aug 2001 17:00:46 -0700

 Peter Avalos <pavalos@theshell.com> writes:
 > Index: make.conf.5
 > ===================================================================
 > RCS file: /home/ncvs/src/share/man/man5/make.conf.5,v
 > retrieving revision 1.25
 > diff -u -r1.25 make.conf.5
 > --- make.conf.5	2001/08/07 13:26:57	1.25
 > +++ make.conf.5	2001/08/16 01:33:50
 > @@ -760,7 +760,8 @@
 >  support will build without X11 support by default.
 >  .It Va WRKDIRPREFIX
 >  .Pq Vt str
 > -Where to create temporary files used when building ports.
 > +Specify where to create temporary files used when building ports.
 > +Do not set this to /usr/obj.
 >  .It Va X11BASE
 >  .Pq Vt str
 >  Should be set to where the X11 distribution has been
 
 It seems wrong to tell someone not to do something and not provide an
 explanation.

From: "Peter Avalos" <pavalos@theshell.com>
To: "'Dima Dorfman'" <dima@unixfreak.org>
Cc: <FreeBSD-gnats-submit@freebsd.org>
Subject: RE: docs/29740: [PATCH] Setting WRKDIRPREFIX=/usr/obj is a bad idea, but not commented 
Date: Sun, 19 Aug 2001 20:14:19 -0500

 > It seems wrong to tell someone not to do something and not 
 > provide an explanation.
 
 I was thinking the same thing, but I honestly don't know why this
 confuses make so much. Perhaps someone who can explain this would
 like to submit a better patch.
 

From: Dima Dorfman <dima@unixfreak.org>
To: "Peter Avalos" <pavalos@theshell.com>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: docs/29740: [PATCH] Setting WRKDIRPREFIX=/usr/obj is a bad idea, but not commented 
Date: Sat, 25 Aug 2001 15:14:31 -0700

 "Peter Avalos" <pavalos@theshell.com> writes:
 > > It seems wrong to tell someone not to do something and not 
 > > provide an explanation.
 > 
 > I was thinking the same thing, but I honestly don't know why this
 > confuses make so much. Perhaps someone who can explain this would
 > like to submit a better patch.
 
 It sounds like this is a bug in make(1) that should be fixed (when I
 first read the PR, I thought this was a documented `feature' of some
 sorts).  Perhaps you (or whoever was having this problem) could file a
 PR against that with some analysis, and/or at least the simplest test
 case?

From: "Peter Avalos" <pavalos@theshell.com>
To: "'Dima Dorfman'" <dima@unixfreak.org>
Cc: <FreeBSD-gnats-submit@freebsd.org>
Subject: RE: docs/29740: [PATCH] Setting WRKDIRPREFIX=/usr/obj is a bad idea, but not commented 
Date: Sun, 26 Aug 2001 03:53:04 -0500

 > It sounds like this is a bug in make(1) that should be fixed 
 > (when I first read the PR, I thought this was a documented 
 > `feature' of some sorts).  Perhaps you (or whoever was having 
 > this problem) could file a PR against that with some 
 > analysis, and/or at least the simplest test case?
 
 Upon searching more about this problem, I stumbled across this:
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=24711
 
 

From: Neil Blakey-Milner <nbm@mithrandr.moria.org>
To: Dima Dorfman <dima@unixfreak.org>
Cc: freebsd-doc@freebsd.org, FreeBSD-gnats-submit@freebsd.org
Subject: Re: docs/29740: [PATCH] Setting WRKDIRPREFIX=/usr/obj is a bad idea, but not commented
Date: Sun, 26 Aug 2001 11:31:04 +0200

 On Sat 2001-08-25 (15:20), Dima Dorfman wrote:
 > The following reply was made to PR docs/29740; it has been noted by GNATS.
 > 
 > From: Dima Dorfman <dima@unixfreak.org>
 > To: "Peter Avalos" <pavalos@theshell.com>
 > Cc: FreeBSD-gnats-submit@freebsd.org
 > Subject: Re: docs/29740: [PATCH] Setting WRKDIRPREFIX=/usr/obj is a bad idea, but not commented 
 > Date: Sat, 25 Aug 2001 15:14:31 -0700
 > 
 >  "Peter Avalos" <pavalos@theshell.com> writes:
 >  > > It seems wrong to tell someone not to do something and not 
 >  > > provide an explanation.
 >  > 
 >  > I was thinking the same thing, but I honestly don't know why this
 >  > confuses make so much. Perhaps someone who can explain this would
 >  > like to submit a better patch.
 >  
 >  It sounds like this is a bug in make(1) that should be fixed (when I
 >  first read the PR, I thought this was a documented `feature' of some
 >  sorts).  Perhaps you (or whoever was having this problem) could file a
 >  PR against that with some analysis, and/or at least the simplest test
 >  case?
 
 It's not a bug in make(1), it's what make(1) is supposed to do.  It
 checks if ${OBJDIRPREFIX}/${.CURDIR} exists, and if so, changes
 directory to that before executing commands in targets.  However, the
 ports system and individual ports tend not to take that into account.
 
 The reason the ports directory gets created is that
 ${WRKDIRPREFIX}/${WRKDIR} is created to put work in.  Since
 WRKDIRPREFIX=OBJDIRPREFIX=/usr/obj, ${OBJDIRPREFIX}/${.CURDIR} is part
 of the directory tree created.  Then the problems start...
 
 Basically, it's silly that we require maintainers/porters to worry about
 this due to one possibility of locations specified in WRKDIRPREFIX.
 
 Neil
 -- 
 Neil Blakey-Milner
 nbm@mithrandr.moria.org
State-Changed-From-To: open->closed 
State-Changed-By: dd 
State-Changed-When: Wed Sep 5 13:29:12 PDT 2001 
State-Changed-Why:  
This bug should be fixed, not documented.  PR 30331 includes a patch. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29740 
>Unformatted:
