reproc

A cross-platform (C99/C++11) process library

MIT License

Downloads
368
Stars
548
Committers
12

Bot releases are visible (Hide)

reproc - v7.0.0

Published by DaanDeMeyer over 5 years ago

See the changelog for a list of changes.

reproc - v6.0.0

Published by DaanDeMeyer over 5 years ago

See the changelog for a list of changes.

reproc - v5.0.1

Published by DaanDeMeyer over 5 years ago

See the changelog for a list of changes.

reproc - v5.0.0

Published by DaanDeMeyer over 5 years ago

See the changelog for a list of changes.

reproc - v4.0.0

Published by DaanDeMeyer over 5 years ago

See the changelog for a list of changes.

reproc - v3.1.3

Published by DaanDeMeyer almost 6 years ago

See the changelog for a list of changes.

reproc - v3.1.2

Published by DaanDeMeyer almost 6 years ago

See the changelog for a list of changes.

reproc - v3.1.1

Published by DaanDeMeyer almost 6 years ago

Internal improvements.

reproc - v3.1.0

Published by DaanDeMeyer almost 6 years ago

See the changelog for a list of changes.

reproc - v3.0.0

Published by DaanDeMeyer almost 6 years ago

See the changelog for a list of changes.

reproc - v3.0.0-beta.1

Published by DaanDeMeyer almost 6 years ago

See the changelog for a list of changes.

reproc - v2.0.0

Published by DaanDeMeyer almost 6 years ago

Changes since the last beta release

  • Lots of the documentation was cleaned up or rewritten. Some irrelevant parts of the readme were removed.
reproc - v2.0.0-beta.8

Published by DaanDeMeyer almost 6 years ago

Breaking Changes

  • Split process::read(reproc::stream stream, Parser &&parser) into process::read(reproc::stream stream, Parser &&parser) and process::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 from read in that the sink doesn't return a bool to tell drain 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. Use drain 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.
reproc - v2.0.0-beta.7

Published by DaanDeMeyer almost 6 years ago

Changes

  • Renamed reproc::cleanup::none to reproc::cleanup::noop
  • CMake options:
    • Removed REPROC_W4 (replaced by check if we're included with add_subdirectory)
    • Removed REPROC_COLORED_OUTPUT (now always enabled). Side effect: GCC min version is now 4.9
    • Renamed REPROC_CLANG_TIDY to REPROC_TIDY
    • Renamed REPROC_CLANG_FORMAT to REPROC_FORMAT

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);

reproc - v2.0.0-beta.6

Published by DaanDeMeyer almost 6 years ago

Breaking Changes

  • Removed reproc_stop and replaced it with reproc_wait, reproc_terminate and reproc_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 and process::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 provides process::stop which simplifies calling combinations of process::wait, process::terminate and process::kill. It now takes its arguments differently. Check the examples or the process::stop documentation for more info. The process 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.

reproc - v2.0.0-beta.5

Published by DaanDeMeyer almost 6 years ago

Bug Fixes

  • Console windows should no longer appear when launching child processes on Windows (thanks to @Alzathar)

Features

  • Added REPROC_ARGS_TOO_LONG and REPROC_NOT_EXECUTABLE to REPROC_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)
reproc - v2.0.0-beta.4

Published by DaanDeMeyer almost 6 years ago

Breaking Changes

  • Changed reproc_stop, reproc::process constructor and reproc::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:

    1. REPROC_WAIT (reproc::cleanup::wait)
    2. REPROC_TERMINATE (reproc::cleanup::terminate)
    3. 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 sending SIGKILL 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 to REPROC_W4.

reproc - v2.0.0-beta.3

Published by DaanDeMeyer almost 6 years ago

Breaking Changes

  • Renamed CMake options:
    • REPROC_BUILD_TESTS => REPROC_TESTS
    • REPROC_BUILD_EXAMPLES => REPROC_EXAMPLES
    • REPROC_BUILD_DOCS => REPROC_DOCS
reproc - v2.0.0-beta.2

Published by DaanDeMeyer almost 6 years ago

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 by CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT).
reproc -

Published by DaanDeMeyer almost 6 years ago

Breaking Changes

  • C++ wrapper functionality is now available from a separate library reproc++:
    • The BUILD_CXX_WRAPPER CMake option has been renamed to REPROCXX

    • The include namespace for the C++ API has changed from reproc to reproc++. For example: #include "reproc/reproc.hpp" is now #include "reproc++/reproc.hpp".

    • To use the C++ API you now have to link against reproc++ instead of reproc:

      target_link_libraries(myapp reproc::reproc++)

    • Both libraries (reproc and reproc++) are installed to the system completely separately. To find reproc in CMake: find_package(reproc). To find reproc++ in CMake: find_package(reproc++). find_package(reproc++) automatically makes sure reproc is available.

Moving the C++ functionality to a completely separate library that depends on reproc was inspired by this talk: https://www.youtube.com/watch?v=sBP17HQAQjk&feature=youtu.be.

The rest of the changes is internal refactoring and documentation updates/additions.