Monkey patch async pipes foor Boost 1.72

This is an simple workaround and it's much more practical than having to
downgrade Boost since that breaks any application that links to it.
This commit is contained in:
Robbert van der Helm
2020-03-14 16:49:38 +01:00
parent 37b0e72d4a
commit 5f584323c2
3 changed files with 22 additions and 7 deletions
+1 -3
View File
@@ -20,9 +20,7 @@ endif
# about the way these two components work together can be found in the readme # about the way these two components work together can be found in the readme
# file. # file.
# Boost 1.72 has a known bug in Boost.Process that will cause compilation to boost_dep = dependency('boost', modules : ['filesystem'])
# fail, see https://github.com/boostorg/process/issues/116
boost_dep = dependency('boost', version : '!=1.72', modules : ['filesystem'])
bitsery_dep = subproject('bitsery').get_variable('bitsery_dep') bitsery_dep = subproject('bitsery').get_variable('bitsery_dep')
threads_dep = dependency('threads') threads_dep = dependency('threads')
# The built in threads dependency does not know how to handle winegcc # The built in threads dependency does not know how to handle winegcc
+1 -1
View File
@@ -326,7 +326,7 @@ void HostBridge::set_parameter(AEffect* /*plugin*/, int index, float value) {
assert(!response.value.has_value()); assert(!response.value.has_value());
} }
void HostBridge::async_log_pipe_lines(bp::async_pipe& pipe, void HostBridge::async_log_pipe_lines(patched_async_pipe& pipe,
boost::asio::streambuf& buffer, boost::asio::streambuf& buffer,
std::string prefix) { std::string prefix) {
boost::asio::async_read_until( boost::asio::async_read_until(
+20 -3
View File
@@ -27,6 +27,23 @@
#include "../common/logging.h" #include "../common/logging.h"
/**
* Boost 1.72 was released with a known breaking bug caused by a missing
* typedef: https://github.com/boostorg/process/issues/116.
*
* Luckily this is easy to fix since it's not really possible to downgrade Boost
* as it would break other applications.
*
* Check if this is still needed for other distros after Arch starts packaging
* Boost 1.73.
*/
class patched_async_pipe : public boost::process::async_pipe {
public:
using boost::process::async_pipe::async_pipe;
typedef typename handle_type::executor_type executor_type;
};
/** /**
* This handles the communication between the Linux native VST plugin and the * This handles the communication between the Linux native VST plugin and the
* Wine VST host. The functions below should be used as callback functions in an * Wine VST host. The functions below should be used as callback functions in an
@@ -103,7 +120,7 @@ class HostBridge {
* @param buffer The stream buffer to write to. * @param buffer The stream buffer to write to.
* @param prefix Text to prepend to the line before writing to the log. * @param prefix Text to prepend to the line before writing to the log.
*/ */
void async_log_pipe_lines(boost::process::async_pipe& pipe, void async_log_pipe_lines(patched_async_pipe& pipe,
boost::asio::streambuf& buffer, boost::asio::streambuf& buffer,
std::string prefix = ""); std::string prefix = "");
@@ -150,11 +167,11 @@ class HostBridge {
/** /**
* The STDOUT stream of the Wine process we can forward to the logger. * The STDOUT stream of the Wine process we can forward to the logger.
*/ */
boost::process::async_pipe wine_stdout; patched_async_pipe wine_stdout;
/** /**
* The STDERR stream of the Wine process we can forward to the logger. * The STDERR stream of the Wine process we can forward to the logger.
*/ */
boost::process::async_pipe wine_stderr; patched_async_pipe wine_stderr;
/** /**
* Runs the Boost.Asio `io_context` thread for logging the Wine process * Runs the Boost.Asio `io_context` thread for logging the Wine process
* STDOUT and STDERR messages. * STDOUT and STDERR messages.