NetBSD Problem Report #42394

From sdrake@xnet.co.nz  Tue Dec  1 04:18:52 2009
Return-Path: <sdrake@xnet.co.nz>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id AC71963C497
	for <gnats-bugs@gnats.netbsd.org>; Tue,  1 Dec 2009 04:18:52 +0000 (UTC)
Message-Id: <alpine.LNX.2.00.0912011712280.8543@vqena.qenxr.bet.am>
Date: Tue, 1 Dec 2009 17:13:21 +1300 (NZDT)
From: Steven Drake <sdrake@xnet.co.nz>
To: gnats-bugs@gnats.netbsd.org
Subject: build-env target and ENV

>Number:         42394
>Category:       pkg
>Synopsis:       build-env target and ENV
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 01 04:20:00 +0000 2009
>Originator:     Steven Drake
>Release:        pkgsrc-2009Q3
>Organization:
>Environment:
System: Linux idran 2.6.30 #2 PREEMPT Sun Aug 9 18:32:44 NZST 2009 i686 pentium4 i386 GNU/Linux
Architecture: pentium4
Machine: i686
C library: GNU C Library stable release version 2.10.1, by Roland McGrath et al.
>Description:
With the ENV environment variable set the shell invoked be build-env will 
source the file pointed to by ENV even with the fake home directory and the
ENV file can corrupt the build environment (eg change the PATH)

>How-To-Repeat:
As an example

# ENV="${HOME}/shrc-test" ;export ENV
# echo $ENV
/root/shrc-test
# echo 'PATH=/usr/i686-pc-linux/bin:$PATH' > $ENV
# echo 'date' >>$ENV
# make build-env
[.....]
Entering the build environment for shlock-20080529
Tue Dec  1 17:04:34 NZDT 2009
# echo $PATH
/usr/i686-pc-linux/bin:/usr/pkgsrc/shlock/work/.wrapper/bin:[......]

>Fix:
Index: mk/build/build.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/build/build.mk,v
retrieving revision 1.19
diff -u -p -r1.19 build.mk
--- mk/build/build.mk	10 Jan 2009 15:59:29 -0000	1.19
+++ mk/build/build.mk	1 Dec 2009 04:15:02 -0000
@@ -163,7 +163,7 @@ BUILD_ENV_SHELL?=	${SH}
 build-env: .PHONY configure
 	@${STEP_MSG} "Entering the build environment for ${PKGNAME}"
 	${RUN}${_ULIMIT_CMD}						\
-	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${BUILD_ENV_SHELL}
+	cd ${WRKSRC} && ${SETENV} ENV=/dev/null ${MAKE_ENV} ${BUILD_ENV_SHELL}
 .else
 build-env: barrier
 .endif


-- 
Steven
  1: Linux - will work for fish.
  2: The Linux penguin - looks stuffed to the brim with herring.
  ( make your own conclusions )

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.