From owner-freebsd-current@FreeBSD.ORG Sun Feb 20 08:54:16 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 468E9106566B; Sun, 20 Feb 2011 08:54:16 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id CCF8C8FC0A; Sun, 20 Feb 2011 08:54:15 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id p1K8sE4s074482 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 20 Feb 2011 09:54:14 +0100 (CET) (envelope-from uqs@spoerlein.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1298192054; bh=ROG7eRBuUkyrd0HZBdQke7v4eSAmuBQrZIKa7t/WrB0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Transfer-Encoding:In-Reply-To; b=c2cttfRmbGQvw6LhXW9+bfevAZYIhxLBC/W/LGofaZiz7IuojW5fiDSCHZ7Ur7L4V REunLt0t/juKQz/kn8+C8Be+oZmHDN4gZwdBr1OSgSUM0SsKlufLV65QPDdPACclhl SB6FP1rYTBkN3zVnAzZF03ztOUst4mVpZ/kxIAwY= Date: Sun, 20 Feb 2011 09:54:14 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Alexander Best Message-ID: <20110220085414.GS65811@acme.spoerlein.net> Mail-Followup-To: Alexander Best , freebsd-current@freebsd.org References: <20110215211029.GA74471@freebsd.org> <20110218131603.GO65811@acme.spoerlein.net> <20110218163613.GA21409@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20110218163613.GA21409@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-current@freebsd.org 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: Sun, 20 Feb 2011 08:54:16 -0000 On Fri, 18.02.2011 at 16:36:13 +0000, Alexander Best wrote: > 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). You're assuming a build of FreeBSD on FreeBSD. But people might want to build FreeBSD on NetBSD and use the initial bootstrap cc from /usr/pkg/bin (or whatever). FreeBSD should be about tools, not policy. If you shoot yourself in the foot by messing with PATH + cc(1), that's your problem. hth Uli