Bug 29740

Summary: [PATCH] Setting WRKDIRPREFIX=/usr/obj is a bad idea, but not commented
Product: Documentation Reporter: Peter Avalos <peter>
Component: Books & ArticlesAssignee: freebsd-doc (Nobody) <doc>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
file.diff none

Description Peter Avalos 2001-08-16 02:50:01 UTC
	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.

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.

How-To-Repeat: 	echo WRKDIRPREFIX=/usr/obj >> /etc/make.conf
	Try building a port.
Comment 1 dima 2001-08-20 01:00:46 UTC
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.
Comment 2 Peter Avalos 2001-08-20 02:14:19 UTC
> 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.
Comment 3 dima 2001-08-25 23:14:31 UTC
"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?
Comment 4 Peter Avalos 2001-08-26 09:53:04 UTC
> 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
Comment 5 Neil Blakey-Milner 2001-08-26 10:31:04 UTC
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
Comment 6 dd freebsd_committer freebsd_triage 2001-09-05 21:29:12 UTC
State Changed
From-To: open->closed

This bug should be fixed, not documented.  PR 30331 includes a patch.