[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] make branch, master, updated. 4.3-206-g7ad2593b
From: |
Paul D. Smith |
Subject: |
[SCM] make branch, master, updated. 4.3-206-g7ad2593b |
Date: |
Tue, 2 Aug 2022 23:42:25 -0400 (EDT) |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "make".
The branch, master has been updated
via 7ad2593b2d2bb5b9332f4444d8bf93ac6f958bc6 (commit)
via 09cce75c308a6e7ae0f3635724d2ae87e72f9800 (commit)
from 07eea3aa496184bb763b7306e9de6a40a94605c9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7ad2593b2d2bb5b9332f4444d8bf93ac6f958bc6
Author: Paul Smith <psmith@gnu.org>
Date: Tue Aug 2 18:07:27 2022 -0400
Support implementing the jobserver using named pipes
Using anonymous pipes for jobserver support has some advantages:
for example there is nothing on disk that needs to be cleaned up.
However it has many obscure problems, related to the fact that in
order for it to work we need to ensure these resources are properly
passed through to child processes that want to use the jobserver.
At the same time we don't want to pass the pipe to process which
DON'T know about the jobserver.
Other processes can open file descriptors which we then think are
our jobserver, but aren't. And, we open the pipe file descriptors
in blocking mode which doesn't work for all users.
See issues such as SV 57178, SV 57242, and SV 62397
To avoid these issues, use named pipes (on systems where they are
available) instead of anonoymous pipes. This simplifies many things:
we never need to pass open file descriptors to our children; they
can open the jobserver named pipe. We don't need to worry about
recursive vs. non-recursive children. Users don't have to "pass
through" the resources if they are invoking sub-makes. Each child
can open its own file descriptor and set blocking as needed.
The downside is the named pipe exists on disk and so must be cleaned
up when the "top-level" make instance exits.
In order to allow make to continue to be used in build systems where
older versions of GNU make, or other tools that want to use the
jobserver, but don't understand named pipes, introduce a new option
--jobserver-style that allows the user to choose anonymous pipes.
* NEWS: Announce the change and the --jobserver-style option.
* doc/make.1: Add --jobserver-style documentation.
* doc/make.texi (Special Variables): Add missing items to .FEATURES.
(Options Summary): Add --jobserver-style.
(POSIX Jobserver): Named pipes, changes to --jobserver-auth, and the
--jobserver-style option.
(Windows Jobserver): Document --jobserver-style for Windows.
* configure.ac: Check for mkfifo.
* src/config.h-vms.template: Undefined HAVE_MKFIFO.
* src/config.h.W32.template: Ditto.
* src/main.c: Add jobserver-style as a new command line option.
(main): Add jobserver-fifo to .FEATURES if supported. Pass the style
option to jobserver_setup().
* src/os.h (jobserver_setup): Accept a style string option.
* src/posixos.c (enum js_type): Enumeration of the jobserver style.
(js_type): Which style we are currently using.
(fifo_name): The path to the named pipe (if in use).
(jobserver_setup): If no style is given, or "fifo" is given, set up a
named pipe: get a temporary file and use mkfifo() on it, then open it
for reading and writing. If something fails fall back to anonymous
pipes.
(jobserver_parse_auth): Parse jobserver-auth to determine the style.
If we are using a named pipe, open it. If we're using anonymous pipes
ensure they're valid as before.
(jobserver_get_invalid_auth): Don't invalidate the jobserver when
using named pipes.
(jobserver_clear): Clean up memory used for named pipes.
(jobserver_acquire_all): Unlink the named pipe when done.
* src/w32/w32os.c (jobserver_setup): Check the style argument.
* tests/scripts/features/jobserver: Use --jobserver-style to test
the anonymous pipe behavior, and also test named pipe/semaphore
behavior. Check invalid jobserver-style options.
* tests/scripts/functions/shell: Use --jobserver-style to test the
anonymous pipe behavior, and also test named pipe/semaphore
behavior.
commit 09cce75c308a6e7ae0f3635724d2ae87e72f9800
Author: Paul Smith <psmith@gnu.org>
Date: Mon Aug 1 12:57:12 2022 -0400
Enhance get_tmpfile() and add get_tmppath()
Move all the logic on creating temporary files into misc.c, and add
a new function get_tmppath() that returns the pathname to a temporary
file without creating or opening it.
* src/makeint.h: Add a declaration for get_tmppath(). Remove the
template argument from get_tmpfile(): it will compute its own.
* src/main.c (main): Remove the logic for computing templates.
* src/vmsjobs.c (child_execute_job): Ditto.
* src/misc.c (get_tmptemplate): New function to return an allocated
template string for use with various mktemp-style functions.
(get_tmppath): Return an allocated path to a temporary file, but do
not create it. Generally this should be avoided due to TOCTOU issues.
(get_tmpfile): Use get_tmptemplate() to generate a template rather
than using one passed in. If we don't have mkstemp() then use
get_tmppath() to compute the path of a temp file.
-----------------------------------------------------------------------
Summary of changes:
NEWS | 13 +++
configure.ac | 2 +-
doc/make.1 | 10 ++
doc/make.texi | 167 ++++++++++++++++++++++------------
src/config.h-vms.template | 3 +
src/config.h.W32.template | 3 +
src/main.c | 48 +++-------
src/makeint.h | 3 +-
src/misc.c | 88 +++++++++++++++---
src/os.h | 38 ++++----
src/posixos.c | 192 +++++++++++++++++++++++++++++++--------
src/vmsjobs.c | 4 +-
src/w32/w32os.c | 5 +-
tests/scripts/features/jobserver | 33 +++++--
tests/scripts/functions/shell | 19 +++-
15 files changed, 449 insertions(+), 179 deletions(-)
hooks/post-receive
--
make
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] make branch, master, updated. 4.3-206-g7ad2593b,
Paul D. Smith <=