-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
avoid depending on child process execution when the target OS does not support it #10750
Comments
I'd be curious to see how significant the performance cost is for sub processes on platforms that support it. With this in place we could easily find out! |
Doesn't |
Why should |
Oh yes. To compile anything zig build will spawn a subprocess like |
This should probably be first implemented before #1356 with potentially panicking subprocess being started from the subprocess that supervises test results. |
In accordance with the requesting issue (ziglang#10750): - `zig test` skips any tests that it cannot spawn, returning success - `zig run` and `zig build` exit with failure, reporting the command the cannot run - `zig clang`, `zig ar`, etc. already punt directly to the appropriate clang/lld main(), even without this change This comes with a number of limitations for no-spawn targets: - `exec()` and related Builder functions error at run-time - Libc Detection is not supported
In accordance with the requesting issue (ziglang#10750): - `zig test` skips any tests that it cannot spawn, returning success - `zig run` and `zig build` exit with failure, reporting the command the cannot be run - `zig clang`, `zig ar`, etc. already punt directly to the appropriate clang/lld main(), even before this change - Native `libc` Detection is not supported Additionally, `exec()` and related Builder functions error at run-time, reporting the command that cannot be run
In accordance with the requesting issue (ziglang#10750): - `zig test` skips any tests that it cannot spawn, returning success - `zig run` and `zig build` exit with failure, reporting the command the cannot be run - `zig clang`, `zig ar`, etc. already punt directly to the appropriate clang/lld main(), even before this change - Native `libc` Detection is not supported Additionally, `exec()` and related Builder functions error at run-time, reporting the command that cannot be run
In accordance with the requesting issue (ziglang#10750): - `zig test` skips any tests that it cannot spawn, returning success - `zig run` and `zig build` exit with failure, reporting the command the cannot be run - `zig clang`, `zig ar`, etc. already punt directly to the appropriate clang/lld main(), even before this change - Native `libc` Detection is not supported Additionally, `exec()` and related Builder functions error at run-time, reporting the command that cannot be run
In accordance with the requesting issue (ziglang#10750): - `zig test` skips any tests that it cannot spawn, returning success - `zig run` and `zig build` exit with failure, reporting the command the cannot be run - `zig clang`, `zig ar`, etc. already punt directly to the appropriate clang/lld main(), even before this change - Native `libc` Detection is not supported Additionally, `exec()` and related Builder functions error at run-time, reporting the command that cannot be run
In accordance with the requesting issue (ziglang#10750): - `zig test` skips any tests that it cannot spawn, returning success - `zig run` and `zig build` exit with failure, reporting the command the cannot be run - `zig clang`, `zig ar`, etc. already punt directly to the appropriate clang/lld main(), even before this change - Native `libc` Detection is not supported Additionally, `exec()` and related Builder functions error at run-time, reporting the command that cannot be run
Landed in 2113538 |
There are a few places in the Zig compiler where we invoke a child process, but none of them are strictly necessary. This issue is to detect when the OS does not support child process execution and produce a build of the compiler that does not attempt to use child processes.
For now the detection logic can be simply:
Here is a complete list of everywhere Zig might want to spawn a child process:
zig test
- instead print a message about not being able to spawn child processes and exit success.zig run
- instead print "unable to spawn child processes" and exit failure.zig ar
,zig dlltool
, etc.This is a prerequisite for #10716.
The text was updated successfully, but these errors were encountered: