diff options
author | Paul Smith <psmith@gnu.org> | 2022-09-10 16:21:23 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2022-09-10 16:27:47 -0400 |
commit | 70ba0357a080f72b9f5912f16b3ffc095db381e6 (patch) | |
tree | fef33bac04c3d9c8708b7dee86341ffb358ba99a /NEWS | |
parent | 7d484017077089ac2642b89da8984ca46a07323d (diff) | |
download | make-git-70ba0357a080f72b9f5912f16b3ffc095db381e6.tar.gz |
[SV 63040] shell: Fall back to the callers environment
If we detect a recursive variable reference when constructing the
environment for the shell function, return the original value from the
caller's environment. Other options such as failing, returning the
empty string, or returning the unexpanded make variable value have
been shown to not behave well in real-world environments. If the
variable doesn't exist in the caller's environment, return the empty
string.
Found by Sergei Trofimovich <slyich@gmail.com> when testing older
versions of autoconf.
* NEWS: Clarify this behavior.
* doc/make.texi (Shell Function): Ditto. Also add info about !=.
* src/expand.c (recursively_expand_for_file): Search the caller's
environment if we detect a recursive variable expansion.
* tests/scripts/functions/shell: Add tests for this behavior.
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -36,7 +36,8 @@ https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=109&se * WARNING: Backward-incompatibility! Previously makefile variables marked as export were not exported to commands started by the $(shell ...) function. Now, all exported variables are - exported to $(shell ...). + exported to $(shell ...). If this leads to recursion during expansion, then + for backward-compatibility the value from the original environment is used. To detect this change search for 'shell-export' in the .FEATURES variable. * WARNING: New build requirement |