Releases: DaanDeMeyer/reproc
v3.0.0
v3.0.0-beta.1
See the changelog for a list of changes.
v2.0.0
Changes since the last beta release
- Lots of the documentation was cleaned up or rewritten. Some irrelevant parts of the readme were removed.
v2.0.0-beta.8
Breaking Changes
-
Split
process::read(reproc::stream stream, Parser &&parser)
intoprocess::read(reproc::stream stream, Parser &&parser)
andprocess::drain(reproc::stream stream, Sink &&sink)
.read
now reports the stream being closed as an error. The provided parser is also called once with an empty string before reading to give the parser the opportunity to completely process all previous output before reading new output from the stream.drain
differs fromread
in that the sink doesn't return a bool to telldrain
to stop reading. Instead,drain
keeps reading until the stream is closed or an error occurs.drain
does not report the stream being closed as an error.Use
read
with a parser to read separate delimited messages from a stream. Usedrain
to read the entire output of a stream.
Additions
- Added an example background.cpp that shows how to access partial results when reading the child process output in background thread.
v2.0.0-beta.7
Changes
- Renamed
reproc::cleanup::none to reproc::cleanup::noop
- CMake options:
- Removed
REPROC_W4
(replaced by check if we're included withadd_subdirectory
) - Removed
REPROC_COLORED_OUTPUT
(now always enabled). Side effect: GCC min version is now 4.9 - Renamed
REPROC_CLANG_TIDY
toREPROC_TIDY
- Renamed
REPROC_CLANG_FORMAT
toREPROC_FORMAT
- Removed
New Features
-
Export headers are now generated by CMake so
REPROC_SHARED
doesn't have to be defined when using reproc as a shared library. -
pkg-config support
-
Added
reproc_stop
. C doesn't support overloading so the reproc version doesn't have the overloads with less arguments that the reproc++ version has.Example usage:
reproc_stop(process, REPROC_WAIT, 10000, REPROC_TERMINATE, 5000, REPROC_NOOP, 0, &exit_status)
;
v2.0.0-beta.6
Breaking Changes
-
Removed
reproc_stop
and replaced it withreproc_wait
,reproc_terminate
andreproc_kill
.Because C doesn't support function overloading I was unable to find a satisfactory design to stop a child process in a configurable way using a single function (
reproc_stop
). By splitting back into separate functions simple use cases don't have to specify unnecessary arguments and complicated use cases still have full control over how they want to stop a child process.reproc++ now also exposes separate
process::wait
,process::terminate
andprocess::kill
methods in the process class that directly map to the corresponding reproc functions. However, because C++ does support overloaded functions and methods, reproc++ still providesprocess::stop
which simplifies calling combinations ofprocess::wait
,process::terminate
andprocess::kill
. It now takes its arguments differently. Check the examples or theprocess::stop
documentation for more info. Theprocess
constructor has been updated to take its arguments the same way. -
Changed
process
destructor to wait indefinitely for the child process to exit instead of only checking if the child process is still running.reproc++ should promote correct cleanup of child processes. The previous defaults might cause users to accidentally not correctly clean up child processes. By changing the defaults to wait indefinitely, users will immediately know the child process isn't exiting for some reason which they can then solve by adding more options to the constructor.
v2.0.0-beta.5
Bug Fixes
- Console windows should no longer appear when launching child processes on Windows (thanks to @Alzathar)
Features
- Added
REPROC_ARGS_TOO_LONG
andREPROC_NOT_EXECUTABLE
toREPROC_ERROR
which are reported on POSIX systems when too many arguments are passed or the given binary cannot be executed.
Other
- Internal refactoring (taking into account possible detached process support in the future)
v2.0.0-beta.4
Breaking Changes
-
Changed
reproc_stop
,reproc::process
constructor andreproc::process::stop
to take 3 timeout values instead of a single timeout value. The timeout values are assigned to passed cleanup flags in a fixed order:REPROC_WAIT
(reproc::cleanup::wait
)REPROC_TERMINATE
(reproc::cleanup::terminate
)REPROC_KILL
(reproc::cleanup::kill
)
Example: when calling
reproc_stop(&process, REPROC_WAIT | REPROC_KILL, 10000, 5000, 2000, NULL)
the function will first wait for 10 seconds before sendingSIGKILL
and waiting 5 more seconds. Only two flags were passed so the third timeout value (2000) is ignored. -
Removed
reproc::process
constructor default values since they encouraged leaky behaviour (didn't make sure the child process was completely cleaned up). -
Renamed
REPROC_ENABLE_W4
CMake option toREPROC_W4
.
v2.0.0-beta.3
Breaking Changes
- Renamed CMake options:
REPROC_BUILD_TESTS
=>REPROC_TESTS
REPROC_BUILD_EXAMPLES
=>REPROC_EXAMPLES
REPROC_BUILD_DOCS
=>REPROC_DOCS
v2.0.0-beta.2
Breaking Changes
- Fix reproc++ install on Windows (previously installed to
<prefix>/reproc
directory, now correctly installs to<prefix>/reproc++
directory). - Require CMake 3.7 on Windows when
REPROC_INSTALL=ON
(needed byCMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
).