Issue with Process.spawn_command_line_sync() on windows
So far I have Posix.system("command")
, Process.spawn_command_line_sync("command")
and Process.spawn_command_line_sync("command", out string, out string, out int)
all working for Linux in my application without issue together.
I've been adding windows support (just checking the path returned from Environment.get_home_dir() to determine OS type) and it's mostly been fine. But I ran into a couple of issues:
Using the vala v.36 I can get Process.spawn_command_line_sync()'s to work just fine (but that version of the compiler doesn't have --pkg posix available)
Using the v.44 variant I can get Posix.system() support compiling and working, but suddenly all my Process.spawn commands are erroring with "Error: Failed to execute helper program (Invalid argument)".
I've tried different complexities of command and even simple stuff is failing. Anyone have any ideas? Short of no longer mixing Posix and Process system commands and varying my valac version accordingly seems like the only option right now.
Example command following the documentation at Vala doc: Process.spawn_command_line_sync("'c:\\windows\\system32\\cmd.exe' '/c dir .'");
I notice that the windows call formatting in the vala doc page differs from the glib documentation, is this the core issue? If I try just a single \
for windows paths valac throws "error: invalid escape sequence" so that's a nonstarter (trying to shove the /
for paths had the same failure as \\
)
Is this a regression or am I missing something?
To get the v44 build I'm using the usual MSYS2 pacman setup (https://www.gtk.org/download/windows.php https://wiki.gnome.org/Projects/Vala/ValaOnWindows), for older version I'm using the unmaintained http://valainstaller.sourceforge.net/ as I was quickly checking for compatibility, but if someone can recommend a set of packages to downgrade ($ pacman -U) to from repo.msys2.org I can try that as well for a cleaner comparison