NetBSD Problem Report #57494

From www@netbsd.org  Fri Jun 30 19:14:26 2023
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 617D41A923D
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 30 Jun 2023 19:14:26 +0000 (UTC)
Message-Id: <20230630191424.66D171A923E@mollari.NetBSD.org>
Date: Fri, 30 Jun 2023 19:14:24 +0000 (UTC)
From: a6funxh77z@snkmail.com
Reply-To: a6funxh77z@snkmail.com
To: gnats-bugs@NetBSD.org
Subject: bmake: -V does not show value from environment if using -e
X-Send-Pr-Version: www-1.0

>Number:         57494
>Category:       bin
>Synopsis:       bmake: -V does not show value from environment if using -e
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 30 19:15:01 +0000 2023
>Originator:     John Hein
>Release:        MAKE_VERSION: 20220928 (FreeBSD port: devel/bmake)
>Organization:
>Environment:
>Description:
When using -e to override variable values using environment variables, -V still prints the non-overridden value.

The man page for -V says "Print bmake's idea of the value of variable, in the global context."  Maybe the behavior of -V when using -e is subtly correct given that wording.  But the behavior is perhaps surprising for some at least.


>How-To-Repeat:
% printf 'X=2\nx:\n\t@echo "MAKE_VERSION: ${MAKE_VERSION}."\n\t@echo "X: $X."\n\t@echo "Y: $Y."\n' > /tmp/mf
% env X=xe Y=ye /usr/local/bin/bmake -e -f /tmp/mf
MAKE_VERSION: 20220928.
X: xe.
Y: ye.
% env X=xe Y=ye /usr/local/bin/bmake -e -f mf -V X -V Y
2
ye


Notice that '-V X' shows '2' instead of 'xe'.
>Fix:
No fix to source code nor documentation yet.

This could be considered to not be a bug and perhaps just the documentation should be more clear.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.