From owner-freebsd-current@FreeBSD.ORG Fri Feb 18 16:36:13 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 646C0106566B; Fri, 18 Feb 2011 16:36:13 +0000 (UTC) Date: Fri, 18 Feb 2011 16:36:13 +0000 From: Alexander Best To: freebsd-current@freebsd.org Message-ID: <20110218163613.GA21409@freebsd.org> References: <20110215211029.GA74471@freebsd.org> <20110218131603.GO65811@acme.spoerlein.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20110218131603.GO65811@acme.spoerlein.net> Subject: Re: $PATH and buildworld not getting along X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2011 16:36:13 -0000 On Fri Feb 18 11, Ulrich Spörlein wrote: > On Tue, 15.02.2011 at 21:10:29 +0000, Alexander Best wrote: > > hi there, > > > > i've run into an issue where $PATH doesn't get discarded during buildworld. is > > this behavior to be expected? to reproduce do: > > > > 1) be sure /usr/local/bin comes *before* /usr/bin in your $PATH > > 2) ln -s /bin/cat /usr/local/bin/cc (some sh script would be better) > > 3) cd /usr/src ; make SRCCONF=/dev/null __MAKE_CONF=/dev/null buildworld > > 4) see how buildworld fails, because cat(1) gets invoked instead of cc(1). > > > > ... buildkernel on the other hand seems to be immune to such an issue. > > The bootstrap stage needs *some* compiler on the host system to build > the (cross)compiler that is then used during the rest of buildworld (and > all of buildkernel). If you remove cc or c++ or libstdc++.so then you're > screwed. sure, but cc resides in in /usr/bin. so there's no need to invoke anything from /usr/local/bin at all. > > As to whether the user's PATH should be honored for building the > bootstrap/cross/build-tools, I'd say yes. i'd say no. imo nothing from /usr/local/* should ever be invoked when compiling a target in /usr/src. everything that's needed is in /usr/* (excluding local). so $PATH should unconditionally be set to sth. like: PATH=/sbin:/bin:/usr/sbin:/usr/bin; to be sure no tools, libs or whatever from any foreign place such as /usr/local/* get sucked into a build. cheers. alex > > If, however, the breakage is during the actual build-everything stage, > that would be a problem indeed. > > Regards, > Uli -- a13x