From cjc@earthlink.net  Mon Nov 19 13:07:38 2001
Return-Path: <cjc@earthlink.net>
Received: from gull.prod.itd.earthlink.net (gull.mail.pas.earthlink.net [207.217.120.84])
	by hub.freebsd.org (Postfix) with ESMTP id 4700B37B416
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 19 Nov 2001 13:07:38 -0800 (PST)
Received: from dialup-209.245.132.171.dial1.sanjose1.level3.net ([209.245.132.171] helo=blossom.cjclark.org)
	by gull.prod.itd.earthlink.net with esmtp (Exim 3.33 #1)
	id 165vdT-0001RD-00
	for FreeBSD-gnats-submit@freebsd.org; Mon, 19 Nov 2001 13:07:28 -0800
Received: (from cjc@localhost)
	by blossom.cjclark.org (8.11.6/8.11.3) id fAJL6Yh00849;
	Mon, 19 Nov 2001 13:06:34 -0800 (PST)
	(envelope-from cjc)
Message-Id: <200111192106.fAJL6Yh00849@blossom.cjclark.org>
Date: Mon, 19 Nov 2001 13:06:34 -0800 (PST)
From: "Crist J. Clark" <cristjc@earthlink.net>
Reply-To: cjclark@alum.mit.edu
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: WRKDIRs should be moved to a central location
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         32114
>Category:       ports
>Synopsis:       WRKDIRs should be moved to a central location
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 19 13:10:00 PST 2001
>Closed-Date:    Fri Jan 24 17:04:04 PST 2003
>Last-Modified:  Fri Jan 24 17:04:04 PST 2003
>Originator:     Crist J. Clark
>Release:        FreeBSD 4.4-STABLE i386
>Organization:
>Environment:
System: FreeBSD blossom.cjclark.org 4.4-STABLE FreeBSD 4.4-STABLE #0: Wed Nov 7 14:50:28 PST 2001 cjc@blossom.cjclark.org:/usr/obj/export/stable/src/sys/BLOSSOM i386


	Ports system as of above date.

>Description:
	Presently, the ports Makefiles will by default put the WRKDIR
in ${.CURDIR}/work. For a typical installation this means that a build
in /usr/ports/<category>/<portname> will put the work files in,

  /usr/ports/<category>/<portname>/work

	At first glance, this seems to make perfect sense. However,
this design has drawbacks. If one wants to make sure there are no
stale work directories around, he can either,

  # cd /usr/ports && make -DNOCLEANDEPENDS 

Which takes a _long_ time, or

  # find /usr/ports -type d -name work -exec rm -rf {} \;

Which is somewhat faster, but a bit dangerous.

	I would claim that it is better to put all WRKDIRs in a
central location. For example, /usr/ports/work. This has the advantage
that when one wishes to clean out old work directories, a single,

  # rm -rf /usr/ports/work/*

Will do the trick. This also brings work directories into line with
how distfiles are stored. After all, distfiles are all by default
placed in /usr/ports/distfiles, they aren't kept in
${.CURDIR}/distfiles even though that would work fine. The only
drawback I can see is that it might be marginally harder for the
novice ports user to find the work directory. However, anyone who
plans to go hacking into the build directory should probably have the
skills to find it. The vast majority of ports users will never know
the difference.

>How-To-Repeat:
	N/A

>Fix:
	For anyone wishing to do this for themselves, a simple,

  WRKDIRPREFIX?=	/usr/ports/work

In /etc/make.conf will do it. However, the reason for the PR is that I
believe somemthing like this would be a better default than the current
design. Just inserting the line above into Mk/bsd.ports.mk would do
it. There are also fancier ways to go so that the build takes place
in,

  /usr/ports/work/<category>/<portname>

But they may break existing localizations whereas changing the default
WRKDIRPREFIX from null to something else should not cause any
back-portablility issues.
>Release-Note:
>Audit-Trail:

From: "."@babolo.ru
To: cjclark@alum.mit.edu
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: ports/32114: WRKDIRs should be moved to a central location
Date: Tue, 20 Nov 2001 00:37:12 +0300 (MSK)

 Crist J. Clark writes:
 > 
 > >Number:         32114
 > >Category:       ports
 > >Synopsis:       WRKDIRs should be moved to a central location
 > >Confidential:   no
 > >Severity:       non-critical
 > >Priority:       low
 > >Responsible:    freebsd-ports
 > >State:          open
 > >Quarter:        
 > >Keywords:       
 > >Date-Required:
 > >Class:          change-request
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Mon Nov 19 13:10:00 PST 2001
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Crist J. Clark
 > >Release:        FreeBSD 4.4-STABLE i386
 > >Organization:
 > >Environment:
 > System: FreeBSD blossom.cjclark.org 4.4-STABLE FreeBSD 4.4-STABLE #0: Wed Nov 7 14:50:28 PST 2001 cjc@blossom.cjclark.org:/usr/obj/export/stable/src/sys/BLOSSOM i386
 > 
 > 
 > 	Ports system as of above date.
 > 
 > >Description:
 > 	Presently, the ports Makefiles will by default put the WRKDIR
 > in ${.CURDIR}/work. For a typical installation this means that a build
 > in /usr/ports/<category>/<portname> will put the work files in,
 > 
 >   /usr/ports/<category>/<portname>/work
 > 
 > 	At first glance, this seems to make perfect sense. However,
 > this design has drawbacks. If one wants to make sure there are no
 > stale work directories around, he can either,
 > 
 >   # cd /usr/ports && make -DNOCLEANDEPENDS 
 > 
 > Which takes a _long_ time, or
 > 
 >   # find /usr/ports -type d -name work -exec rm -rf {} \;
 > 
 > Which is somewhat faster, but a bit dangerous.
 > 
 > 	I would claim that it is better to put all WRKDIRs in a
 > central location. For example, /usr/ports/work. This has the advantage
 > that when one wishes to clean out old work directories, a single,
 > 
 >   # rm -rf /usr/ports/work/*
 > 
 > Will do the trick. This also brings work directories into line with
 > how distfiles are stored. After all, distfiles are all by default
 > placed in /usr/ports/distfiles, they aren't kept in
 > ${.CURDIR}/distfiles even though that would work fine. The only
 > drawback I can see is that it might be marginally harder for the
 > novice ports user to find the work directory. However, anyone who
 > plans to go hacking into the build directory should probably have the
 > skills to find it. The vast majority of ports users will never know
 > the difference.
 > 
 > >How-To-Repeat:
 > 	N/A
 > 
 > >Fix:
 > 	For anyone wishing to do this for themselves, a simple,
 > 
 >   WRKDIRPREFIX?=	/usr/ports/work
 > 
 > In /etc/make.conf will do it. However, the reason for the PR is that I
 > believe somemthing like this would be a better default than the current
 > design. Just inserting the line above into Mk/bsd.ports.mk would do
 > it. There are also fancier ways to go so that the build takes place
 > in,
 > 
 >   /usr/ports/work/<category>/<portname>
 Why /usr/.... ?
 What about WRKDIRPREFIX=${TMPDIR}
 if TMPDIR defined and no change if not?
 
 It is a bad idea to enlage number of filesystems
 with temporary data.
 
 > But they may break existing localizations whereas changing the default
 > WRKDIRPREFIX from null to something else should not cause any
 > back-portablility issues.
 
 -- 
 @BABOLO      http://links.ru/

From: "Crist J. Clark" <cristjc@earthlink.net>
To: "."@babolo.ru
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: ports/32114: WRKDIRs should be moved to a central location
Date: Mon, 19 Nov 2001 13:43:06 -0800

 On Tue, Nov 20, 2001 at 12:37:12AM +0300, "."@babolo.ru wrote:
 [snip]
 
 > >   /usr/ports/work/<category>/<portname>
 > Why /usr/.... ?
 > What about WRKDIRPREFIX=${TMPDIR}
 > if TMPDIR defined and no change if not?
 
 Because (1) the current practice is to build above /usr/ports and
 changing that breaks POLA, (2) ports builds are not necessarily
 "temporary data," if you have several near identical system and a NFS
 exported /usr/ports, you can build once and install many, and (3) some
 ports require BIG workspace and TMPDIR may not be large enough.
 
 > It is a bad idea to enlage number of filesystems
 > with temporary data.
 
 We're not, that's where ports build already.
 -- 
 Crist J. Clark                     |     cjclark@alum.mit.edu
                                    |     cjclark@jhu.edu
 http://people.freebsd.org/~cjc/    |     cjc@freebsd.org
Responsible-Changed-From-To: freebsd-ports->portmgr 
Responsible-Changed-By: dwcjr 
Responsible-Changed-When: Thu Nov 22 22:42:40 PST 2001 
Responsible-Changed-Why:  
Over to maintainer 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=32114 
State-Changed-From-To: open->closed 
State-Changed-By: kris 
State-Changed-When: Fri Jan 24 17:03:29 PST 2003 
State-Changed-Why:  
Thanks for your submission, but I don't see any great need 
to change the defaults in the way you suggest.  The 
workaround you describe is quite appropriate for users 
who want to do things differently. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=32114 
>Unformatted:
