From owner-freebsd-toolchain@FreeBSD.ORG Mon Jun 10 11:11:07 2013 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2470DB3E; Mon, 10 Jun 2013 11:11:07 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-ie0-x22a.google.com (mail-ie0-x22a.google.com [IPv6:2607:f8b0:4001:c03::22a]) by mx1.freebsd.org (Postfix) with ESMTP id E490F1E6F; Mon, 10 Jun 2013 11:11:06 +0000 (UTC) Received: by mail-ie0-f170.google.com with SMTP id e11so131858iej.15 for ; Mon, 10 Jun 2013 04:11:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=tRHAok95UhIjuyCSXoMLF9or36vkeQMhiztIbJ1mcQs=; b=q68gLTr1MHA4mPM2H/L6l2BuLJn5LsxHkSdV3EKz+1bNvpdo116v2Vy84lRmAVT/U4 Nxz69vHVl2C/ZteTxYmC7faGmgIsvcam1t5mCyAOzPYTASaipuIgfFfWjl0yc6O5/a91 Wg0w0DSUAes5ZvMOUUidlV1XoPTEJorzNHLKd+GotbX7sNJOsbkYKp/9WlW+uNpTVfSI qM4Gcchg/1FWFOPmKF4lsGMuPtvRNcHVZb9brWeHZiWAkCDdruyNwQh5Pudp+XOWp4w+ HajcsN3giQYYa4PCUmRWgnM+6bY0x1vDtwiHohRloYeXK31d1SvWG469xI4G75Y3v3/z 0I2A== X-Received: by 10.50.20.133 with SMTP id n5mr418393ige.65.1370862666635; Mon, 10 Jun 2013 04:11:06 -0700 (PDT) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.64.28.131 with HTTP; Mon, 10 Jun 2013 04:10:36 -0700 (PDT) From: Chris Rees Date: Mon, 10 Jun 2013 12:10:36 +0100 X-Google-Sender-Auth: BMgHk20AeJiEZSvzm6GS70YsS_o Message-ID: Subject: bmake exports disallowed environment variables To: freebsd-toolchain@freebsd.org, tech-toolchain@netbsd.org, "Simon J. Gerraty" Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jun 2013 11:11:07 -0000 [Hope I got the NetBSD list right...] Hi all, bmake appears to export ${.MAKE.LEVEL} into the environment, which sh doesn't support, due to the leading '.'. Normally this is ignored, but for example Tinderbox cleans the environment by unsetting everything except a small list of variables, resulting in an error. pmake (FreeBSD's make) exports it as ${__MKLVL__} (IIRC), which is more portable. I've worked around it in Tinderbox by adding .MAKE.LEVEL to the 'safe' variable list, but I think exporting incompatible envars to sh(1) is undesirable. Can anyone come up with a possibly solution? My preferred solution is to export __MKLVL__ and allow ${.MAKE.LEVEL} to be recognised as ${__MKLVL__} in Makefiles, possibly with a warning? I'll see if I can make a patch for this behaviour, unless anyone has a better idea. Chris http://svnweb.freebsd.org/base/head/contrib/bmake/var.c?revision=251422&view=markup#l970 From owner-freebsd-toolchain@FreeBSD.ORG Mon Jun 10 16:36:38 2013 Return-Path: Delivered-To: freebsd-toolchain@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CCC99300; Mon, 10 Jun 2013 16:36:38 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from db8outboundpool.messaging.microsoft.com (mail-db8lp0187.outbound.messaging.microsoft.com [213.199.154.187]) by mx1.freebsd.org (Postfix) with ESMTP id 3CC7312AF; Mon, 10 Jun 2013 16:36:34 +0000 (UTC) Received: from mail123-db8-R.bigfish.com (10.174.8.248) by DB8EHSOBE013.bigfish.com (10.174.4.76) with Microsoft SMTP Server id 14.1.225.23; Mon, 10 Jun 2013 16:36:28 +0000 Received: from mail123-db8 (localhost [127.0.0.1]) by mail123-db8-R.bigfish.com (Postfix) with ESMTP id 38B353001B6; Mon, 10 Jun 2013 16:36:28 +0000 (UTC) X-Forefront-Antispam-Report: CIP:66.129.224.50; KIP:(null); UIP:(null); IPV:NLI; H:P-EMHUB02-HQ.jnpr.net; RD:none; EFVD:NLI X-SpamScore: 3 X-BigFish: PS3(zzzz1f42h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1fc6h1082kzzz31h2a8h668h839hd25hf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h14ddh1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b88h1d0ch1d2eh1d3fh1de2h1dfeh1dffh1e23h1155h) Received-SPF: softfail (mail123-db8: transitioning domain of juniper.net does not designate 66.129.224.50 as permitted sender) client-ip=66.129.224.50; envelope-from=sjg@juniper.net; helo=P-EMHUB02-HQ.jnpr.net ; -HQ.jnpr.net ; Received: from mail123-db8 (localhost.localdomain [127.0.0.1]) by mail123-db8 (MessageSwitch) id 1370882186179337_29364; Mon, 10 Jun 2013 16:36:26 +0000 (UTC) Received: from DB8EHSMHS012.bigfish.com (unknown [10.174.8.234]) by mail123-db8.bigfish.com (Postfix) with ESMTP id 295B93E0078; Mon, 10 Jun 2013 16:36:26 +0000 (UTC) Received: from P-EMHUB02-HQ.jnpr.net (66.129.224.50) by DB8EHSMHS012.bigfish.com (10.174.4.22) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 10 Jun 2013 16:36:23 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB02-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Mon, 10 Jun 2013 09:36:12 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id r5AGa9L10714; Mon, 10 Jun 2013 09:36:10 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 8F4D358097; Mon, 10 Jun 2013 09:36:09 -0700 (PDT) To: Chris Rees Subject: Re: bmake exports disallowed environment variables In-Reply-To: References: Comments: In-reply-to: Chris Rees message dated "Mon, 10 Jun 2013 12:10:36 +0100." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Mon, 10 Jun 2013 09:36:09 -0700 Message-ID: <20130610163609.8F4D358097@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain X-OriginatorOrg: juniper.net Cc: freebsd-toolchain@FreeBSD.org, tech-toolchain@netbsd.org, sjg@juniper.net X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jun 2013 16:36:38 -0000 Hi Chris, >bmake appears to export ${.MAKE.LEVEL} into the environment, which sh >doesn't support, due to the leading '.'. Normally this is ignored, Yes, though env(1) does allow it. The leading '.' was deliberately chosen to reduce the risk of this being picked up from user environment. That is, if make finds .MAKE.LEVEL in its environment, then it "trusts" it - either an ancestor was make (rather than say gmake), or the user "must know what they are doing". In short, I'd like to leave it as is. From owner-freebsd-toolchain@FreeBSD.ORG Mon Jun 10 16:59:35 2013 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7FC7CC4F for ; Mon, 10 Jun 2013 16:59:35 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ob0-x22d.google.com (mail-ob0-x22d.google.com [IPv6:2607:f8b0:4003:c01::22d]) by mx1.freebsd.org (Postfix) with ESMTP id 4BC7C147A for ; Mon, 10 Jun 2013 16:59:35 +0000 (UTC) Received: by mail-ob0-f173.google.com with SMTP id wc20so10420901obb.18 for ; Mon, 10 Jun 2013 09:59:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=HjcF3dhmlkoVAgN6b3fpVdTU/wSXgjjmKTq3x4FeW3U=; b=piiu+xV82GoJiILJIp00q0ELZRB3FG2IEPz96+9263rHHKMEsYV9C3DeO36w23mli8 2II9rKw6JpJX6oaV3cOvFPvYz+Pt33OOYmYk2e7P0mM0lP8dRS/LITca1VI7NoTtNlym Q3zotJWIVuKifi+SGinwCjeItqWVdBG6Dvw6HjSZm3WoHDXDdD+RI2xTyPoQ1PYng1bp 1JaUTJzAOis/VYJFxfgSATV6EgUiyrwkODlERz6dh3zARXEEQb9yXBL7Yaa/RfV28HJH SkkbK23+7512JbzOyZkeO4NjhsgNvzwMYNL9jK8GfZiVrmH7cXT0ovMEuaolaWHLPP9K ioMQ== X-Received: by 10.60.141.164 with SMTP id rp4mr9123088oeb.38.1370883574566; Mon, 10 Jun 2013 09:59:34 -0700 (PDT) Received: from monkey-bot.int.fusionio.com ([209.117.142.2]) by mx.google.com with ESMTPSA id oe10sm23392511oeb.6.2013.06.10.09.59.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Jun 2013 09:59:33 -0700 (PDT) Sender: Warner Losh Subject: Re: bmake exports disallowed environment variables Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20130610163609.8F4D358097@chaos.jnpr.net> Date: Mon, 10 Jun 2013 10:59:31 -0600 Content-Transfer-Encoding: 7bit Message-Id: <4E8C9D23-FD2B-40FC-B11D-204390F6DD9D@bsdimp.com> References: <20130610163609.8F4D358097@chaos.jnpr.net> To: "Simon J. Gerraty" X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQnOoGd1yZVXLhC8urFyS9kw12XtZGKV/fsaFDzBmxlQsCH2amlLXmE735ftgEdbw7sA9hK2 Cc: Chris Rees , freebsd-toolchain@FreeBSD.org, tech-toolchain@netbsd.org X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jun 2013 16:59:35 -0000 On Jun 10, 2013, at 10:36 AM, Simon J. Gerraty wrote: > Hi Chris, > >> bmake appears to export ${.MAKE.LEVEL} into the environment, which sh >> doesn't support, due to the leading '.'. Normally this is ignored, > > Yes, though env(1) does allow it. The leading '.' was deliberately chosen > to reduce the risk of this being picked up from user environment. > That is, if make finds .MAKE.LEVEL in its environment, then it "trusts" > it - either an ancestor was make (rather than say gmake), or the user > "must know what they are doing". > > In short, I'd like to leave it as is. Then perhaps you can share the /bin/sh syntax to unset it? Warner From owner-freebsd-toolchain@FreeBSD.ORG Mon Jun 10 18:13:03 2013 Return-Path: Delivered-To: freebsd-toolchain@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7954B7EC; Mon, 10 Jun 2013 18:13:03 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from co1outboundpool.messaging.microsoft.com (co1ehsobe001.messaging.microsoft.com [216.32.180.184]) by mx1.freebsd.org (Postfix) with ESMTP id 45D0F1935; Mon, 10 Jun 2013 18:13:02 +0000 (UTC) Received: from mail158-co1-R.bigfish.com (10.243.78.245) by CO1EHSOBE020.bigfish.com (10.243.66.83) with Microsoft SMTP Server id 14.1.225.23; Mon, 10 Jun 2013 17:42:45 +0000 Received: from mail158-co1 (localhost [127.0.0.1]) by mail158-co1-R.bigfish.com (Postfix) with ESMTP id 269F67000DD; Mon, 10 Jun 2013 17:42:45 +0000 (UTC) X-Forefront-Antispam-Report: CIP:66.129.224.51; KIP:(null); UIP:(null); IPV:NLI; H:P-EMHUB02-HQ.jnpr.net; RD:none; EFVD:NLI X-SpamScore: 3 X-BigFish: PS3(zzzz1f42h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1fc6h1082kzzz2fh2a8h668h839hf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h14ddh1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b88h1d0ch1d2eh1d3fh1de2h1dfeh1dffh1e23h1155h) Received-SPF: pass (mail158-co1: domain of juniper.net designates 66.129.224.51 as permitted sender) client-ip=66.129.224.51; envelope-from=sjg@juniper.net; helo=P-EMHUB02-HQ.jnpr.net ; -HQ.jnpr.net ; Received: from mail158-co1 (localhost.localdomain [127.0.0.1]) by mail158-co1 (MessageSwitch) id 137088616399600_22894; Mon, 10 Jun 2013 17:42:43 +0000 (UTC) Received: from CO1EHSMHS022.bigfish.com (unknown [10.243.78.226]) by mail158-co1.bigfish.com (Postfix) with ESMTP id 0BF2D44012C; Mon, 10 Jun 2013 17:42:43 +0000 (UTC) Received: from P-EMHUB02-HQ.jnpr.net (66.129.224.51) by CO1EHSMHS022.bigfish.com (10.243.66.32) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 10 Jun 2013 17:42:42 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB02-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Mon, 10 Jun 2013 10:42:40 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id r5AHgYL56816; Mon, 10 Jun 2013 10:42:36 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 6539158097; Mon, 10 Jun 2013 10:42:34 -0700 (PDT) To: Warner Losh Subject: Re: bmake exports disallowed environment variables In-Reply-To: <4E8C9D23-FD2B-40FC-B11D-204390F6DD9D@bsdimp.com> References: <20130610163609.8F4D358097@chaos.jnpr.net> <4E8C9D23-FD2B-40FC-B11D-204390F6DD9D@bsdimp.com> Comments: In-reply-to: Warner Losh message dated "Mon, 10 Jun 2013 10:59:31 -0600." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Mon, 10 Jun 2013 10:42:34 -0700 Message-ID: <20130610174234.6539158097@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain X-OriginatorOrg: juniper.net Cc: Chris Rees , freebsd-toolchain@FreeBSD.org, tech-toolchain@netbsd.org, sjg@juniper.net X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jun 2013 18:13:03 -0000 On Mon, 10 Jun 2013 10:59:31 -0600, Warner Losh writes: >Then perhaps you can share the /bin/sh syntax to unset it? No, the point is that this variable is not supposed to be manipulated by sh at all. The name was chosen precisely because it cannot easily be put into the environment. That and it "looks" like a make internal variable - which it is.