Closed adamchainz closed 1 year ago
They are available on Windows but do not perform usefully.
Oh interesting, good to know. Perhaps there could be a check to use exec
on unix only?
There could be, but I'm worried about issues that arise from using different mechanisms on Unix and Windows. (This is why it doesn't already use os.exec
.)
For what it's worth, the zig binary itself will use execve on Unix for zig run
and CreateProcessW on Windows.
Does it wait for the process to terminate?
The CreateProcessW path? Yes, I believe this would be equivalent to the status quo python code.
To be clear I'm not saying you can get execve semantics on Windows, just that zig does use execve when it can and where it makes sense to.
No objection to using os.execvp
on Unix then.
Using an
os.exec*
function, when available (Unix, Windows) will replace the Python wrapper process, rather than keeping it around until zig has finished. This saves memory and makes processes easier to debug.You should be able to change:
to something like: