bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

private environment variables propagated to dependencies when the privat


From: Jason Kruppa
Subject: private environment variables propagated to dependencies when the private or original is exported to the environment
Date: Mon, 7 Sep 2015 16:46:07 -0500

I've never used the bug tracking software, so I'm a bit hesitant to screw it up.

v3.82 and v4.1 exhibit a bug with target-specific private variables being
exported to the environment.  If the private variable is exported, or a private
variable replaces an exported global variable, then the private value shows up 
in
the environment variable for dependent targets.  The following makefile (sorry,
not suitable for echoing Windows environment variables; maybe change $$FOO to
%FOO%) shows the problem.  I will try to find time this week to add something to
tests/scripts/variables/private to show this issue (Test #5 currently tests
“private override export”, but only that it overrides the global value, not that
it prevents propogation to dependencies).
 
Run either of the following makefiles as ‘make’ and again as ‘make target’ to 
see
the unexpected differences.
 
<begin>
FOO=works
all: private override export FOO=broken
all: target
 
target:
                @echo FOO $(FOO) $$FOO
<end>
 
And here is a longer but more complete makefile showing that private_override
works, but e_private_override fails (adding 'export' to the non-private
definition of the variable results in the private value being exported to the
environment for child targets).
 
<begin>
private_override=working
private_override_export=working
private_export=working
export e_private_override=working
export e_private_override_export=working
export e_private_export=working
 
all: private override private_override:=broken
all: private override export private_override_export:=broken
all: private export private_export:=broken
all: private override e_private_override:=broken
all: private override export e_private_override_export:=broken
all: private export e_private_export:=broken
all: target
 
target:
                @echo When building $@
                @echo "  "private_override"          "is \"$(private_override)\"
within make and is \"$$private_override\" in the env
                @echo "  "private_override_export"   "is
\"$(private_override_export)\" within make and is \"$$private_override_export\"
in the env
                @echo "  "private_export"            "is \"$(private_export)\"
within make and is \"$$private_export\" in the env
                @echo "  "e_private_override"        "is
\"$(e_private_override)\" within make and is \"$$e_private_override\" in the env
                @echo "  "e_private_override_export" "is
\"$(e_private_override_export)\" within make and is
\"$$e_private_override_export\" in the env
                @echo "  "e_private_export"          "is \"$(e_private_export)\"
within make and is \"$$e_private_export\" in the env
<end>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]