From owner-freebsd-current@FreeBSD.ORG Fri Feb 18 17:11:43 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 478B6106564A; Fri, 18 Feb 2011 17:11:43 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 95AED8FC2E; Fri, 18 Feb 2011 17:11:42 +0000 (UTC) Received: by bwz12 with SMTP id 12so397859bwz.13 for ; Fri, 18 Feb 2011 09:11:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:x-mailer:mime-version:content-type :content-transfer-encoding; bh=V3QZf4yMMTT5otM+K2R3rqd4g51AhIF9eyyiVjA2H0w=; b=kCRa2WTeHIVVIk1AdUJubVmiQD9RhRqgS1xeNGB4ABcWKp4xLVJORQikg/+AkKEIgy DJGNgy1oR6qlL9BlAXr2NaVrgRkhbkBzbWqcvePrWeNxqXTI9TxyV51mcGvTE00GPAfX SWaMVEakVnfRQVxGSGVVgxlcsgIitZ/iDeCu4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=wuB8VqN5ZgWpaIXLy757KwSSCaG5RWhE/of3u+PfgY8TvJF0lK8olWlh/UF1YYf5Vb FGQz9+erfZcOw/KqT78RDoJYIe1XW0PuLiDDNyxVGUsZ8ElX2j7n0RZbGmYMqm/GeA4z Twb30fdBUZLRbMP0eW32246Hm2a1BXw7sa29A= Received: by 10.204.102.146 with SMTP id g18mr924356bko.163.1298049101152; Fri, 18 Feb 2011 09:11:41 -0800 (PST) Received: from ernst.jennejohn.org (p578E3B5A.dip.t-dialin.net [87.142.59.90]) by mx.google.com with ESMTPS id j11sm1624183bka.12.2011.02.18.09.11.39 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Feb 2011 09:11:40 -0800 (PST) Date: Fri, 18 Feb 2011 18:11:38 +0100 From: Gary Jennejohn To: Alexander Best Message-ID: <20110218181138.551e585d@ernst.jennejohn.org> In-Reply-To: <20110218163613.GA21409@freebsd.org> References: <20110215211029.GA74471@freebsd.org> <20110218131603.GO65811@acme.spoerlein.net> <20110218163613.GA21409@freebsd.org> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit 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 Reply-To: gljennjohn@googlemail.com 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 17:11:43 -0000 On Fri, 18 Feb 2011 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). > > 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. > But what if the user wants to test whether world/kernel are buildable using a more recent version of gcc from ports? That seems legitimate to me. Just my Euro .02. -- Gary Jennejohn