Add a way to disable pipes for the Wine host

For some reason ujam plugins (and other plugins made with the Gorilla
Engine, like the LoopCloud plugins) will throw a `JS_EXEC_FAILED` error
when trying to load the plugin while either of the STDOUT or STDERR
streams is pointing to a pipe. Simply redirecting the output to a file
fixes this. By default we'll write the output to
`<temporary_directory>/yabridge-plugin-output.log`, but you can also set
the new `disable_pipes` option to `"/dev/null"` to completely throw away
all output.

This addresses #47.
This commit is contained in:
Robbert van der Helm
2021-05-18 17:55:39 +02:00
parent 99428ba28e
commit 95badeb1bc
6 changed files with 128 additions and 41 deletions
+15
View File
@@ -81,6 +81,19 @@ class Configuration {
*/
std::optional<std::string> group;
/**
* If enabled, we'll redirect the plugin's STDOUT and STDERR streams to this
* file instead of using pipes to intersperse it with yabridge's other
* output. This is necessary for _ujam_ plugins to work since they for some
* reason will throw `JS_EXEC_FAILED` errors when either STDOUT or STDERR is
* a pipe.
*
* This option can be set to a boolean, in which case we'll set the path to
* `<temporary_directory>/yabridge-plugin-output.log`, or it can be set to
* an absolute path. (we don't try to expand tildes)
*/
std::optional<boost::filesystem::path> disable_pipes;
/**
* If this is set to `true`, then the plugin editor should be embedded in
* yet another window. This would result in an embedding sequence of
@@ -187,6 +200,8 @@ class Configuration {
s.ext(group, bitsery::ext::StdOptional(),
[](S& s, auto& v) { s.text1b(v, 4096); });
s.ext(disable_pipes, bitsery::ext::StdOptional(),
[](S& s, auto& v) { s.ext(v, bitsery::ext::BoostPath{}); });
s.value1b(editor_double_embed);
s.value1b(editor_force_dnd);
s.value1b(editor_xembed);