diff options
author | Paul Smith <psmith@gnu.org> | 2022-07-24 14:14:32 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2022-07-30 18:40:28 -0400 |
commit | 16e14b4114c0c9cc14d15e818bf22588a79e39da (patch) | |
tree | 6d8bfab54e795a38766edcccc1ba3dba040a3503 /NEWS | |
parent | 77881d2281035e2ace1e30800ff3528e1ef1fd98 (diff) | |
download | make-git-16e14b4114c0c9cc14d15e818bf22588a79e39da.tar.gz |
Disable the jobserver in non-recursive children
Savannah issues such as SV 57242 and SV 62397 show how passing
references to closed file descriptors via the --jobserver-auth option
in MAKEFLAGS can lead to problematic outcomes.
When computing the child environment for a non-recursive shell, add
an extra option to MAKEFLAGS to disable the file descriptors for the
jobserver.
Unfortunately this doesn't modify the value of the make variable
MAKEFLAGS, it only modifies the value of the sub-shell environment
variable MAKEFLAGS. This can lead to confusion if the user is not
considering the distinction.
* src/makeint.h: Publish the jobserver-auth value. Add a global
definition of the name of the command line option.
* src/os.h (jobserver_get_invalid_auth): New function to return a
string invalidating the jobserver-auth option.
* src/w32/w32os.c (jobserver_get_invaid_auth): Implement it. On
Windows we use a semaphore so there's no need to invalidate.
* src/posixos.c (jobserver_parse_auth): If we parse the invalid
auth string, don't set up the jobserver.
(jobserver_get_invalid_auth): Return an invalid option.
* src/variable.h (target_environment): Specify if the target
environment is for a recursive shell or non-recursive shell.
* src/variable.c (target_environment): Move checking for MAKELEVEL
into the loop rather than doing it at the end.
Along with this, check for MAKEFLAGS and MFLAGS, and update them
based on whether we're invoking a recursive or non-recursive child,
and also on whether it's necessary to invalidate the jobserver.
* src/function.c (func_shell_base): Shell functions can never be
recursive to pass 0 to target_environment().
* src/job.c (start_job_command): Specify whether the child is
recursive when calling target_environment().
* src/main.c: Export jobserver_auth. sync_mutex doesn't need to
be exported. Use the global definition for the option name.
* tests/scripts/variables/MAKEFLAGS: Add tests for $MAKEFLAGS.
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -107,6 +107,13 @@ https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=109&se * Special targets like .POSIX are detected upon definition, ensuring that any change in behavior takes effect immediately, before the next line is parsed. +* When the jobserver is enabled and GNU make decides it is invoking a non-make + sub-process and closes the jobserver pipes, it will now add a new option to + the MAKEFLAGS environment variable that disables the jobserver. + This prevents sub-processes that invoke make from accidentally using other + open file descriptors as jobserver pipes. For more information see + https://savannah.gnu.org/bugs/?57242 and https://savannah.gnu.org/bugs/?62397 + * A long-standing issue with the directory cache has been resolved: changes made as a side-effect of some other target's recipe are now noticed as expected. |