`include-what-you-use` diagnostics, in practice, are specific to
the environment's compiler and standard library. Update includes
to satisfy IWYU for our CI job under Debian 12.
Previously, we were letting libuv create the output pipe for each
process. However, in order to facilitate use cases where process
spawn is expected to fail (in the case of a missing executable), we
want pipe creation to be separate from process creation. Manually
create all of the pipes.
Move most of cmUVProcessChain::InternalData::Finish() to Prepare()
so that error codes can be checked before attepting to spawn any
processes. Check some error codes that weren't being checked before.
Change return type of Finish() to void as it can't fail.
Provide a standardized way to handle the C++ "standard" headers
customized to be used with current CMake C++ standard constraints.
Offer under directory `cm` headers which can be used as direct
replacements of the standard ones. For example:
#include <cm/string_view>
can be used safely for CMake development in place of the `<string_view>`
standard header.
Fixes: #19491
Some static analysis tools throw a false positive for an
out-of-bounds item that is being dereferenced. This out-of-bounds
error will never actually happen because of how
cmUVProcessChain::InternalData::AddCommand() is being called.
Nevertheless, this change adds an assert() to help static analysis
tools be absolutely certain that the referenced item is within the
vector's bounds.
This change also changes the item access to use an index rather
than an iterator.
This class is ultimately intended as a replacement for cmsys::Process.
It spawns a series of processes using libuv, piping the output of each
command into the next.
Note: input support has not yet been implemented because write
support has not yet been implemented on cmUVStreambuf.