diff options
author | Paul Smith <psmith@gnu.org> | 2022-06-18 20:25:30 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2022-07-09 10:44:21 -0400 |
commit | 98da874c43035a490cdca81331724f233a3d0c9a (patch) | |
tree | 1894a4e883fd03ff762dfcfe4357cf1d68de483f /NEWS | |
parent | 88d6c22a487cc45b6d615d5c055ced5c9d5cb56d (diff) | |
download | make-git-98da874c43035a490cdca81331724f233a3d0c9a.tar.gz |
[SV 10593] Export variables to $(shell ...) commands
Export all variables, including exported makefile variables, when
invoking a shell for the $(shell ...) function. If we detect a
recursive variable expansion, silently ignore that variable and do
not export it. We do print a debug message.
* NEWS: Announce the potential backward-incompatibility.
* doc/make.texi (Shell Function): Document the export behavior.
* src/main.c (main): Add "shell-export" to .FEATURES.
* src/job.h: New function to free struct childbase.
* src/job.c (free_childbase): Implement it; call from free_child.
* src/function.c (func_shell_base): Use target_environment() to
obtain the proper environment for the shell function.
Use free_childbase() to free memory.
(windows32_openpipe): Don't reset the environment: the caller
already provided a proper PATH variable in envp.
* src/variable.c (target_environment): If we detect a recursive
expansion and we're called from func_shell, ignore the variable.
(sync_Path_environment): Simplify and reduce memory allocation.
* tests/scripts/functions/shell: Add tests for this.
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -33,6 +33,12 @@ https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=109&se variable that was visible while parsing makefiles. Now, all options are available in MAKEFLAGS. +* 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 ...). + To detect this change search for 'shell-export' in the .FEATURES variable. + * WARNING: New build requirement GNU make utilizes facilities from GNU Gnulib: Gnulib requires certain C99 features in the C compiler and so these features are required by GNU make: |