zig/lib/std/Build
Andrew Kelley 3169f0529b eliminate posix_spawn from the standard library
Today I found out that posix_spawn is trash. It's actually implemented
on top of fork/exec inside of libc (or libSystem in the case of macOS).

So, anything posix_spawn can do, we can do better. In particular, what
we can do better is handle spawning of child processes that are
potentially foreign binaries. If you try to spawn a wasm binary, for
example, posix spawn does the following:

 * Goes ahead and creates a child process.
 * The child process writes "foo.wasm: foo.wasm: cannot execute binary file"
   to stderr (yes, it prints the filename twice).
 * The child process then exits with code 126.

This behavior is indistinguishable from the binary being successfully
spawned, and then printing to stderr, and exiting with a failure -
something that is an extremely common occurrence.

Meanwhile, using the lower level fork/exec will simply return ENOEXEC
code from the execve syscall (which is mapped to zig error.InvalidExe).

The posix_spawn behavior means the zig build runner can't tell the
difference between a failure to run a foreign binary, and a binary that
did run, but failed in some other fashion. This is unacceptable, because
attempting to excecve is the proper way to support things like Rosetta.
2023-03-10 15:41:07 -05:00
..
Cache move the cache system from compiler to std lib 2023-02-13 06:42:25 -07:00
Cache.zig std.Build.Cache: remove 'test-filetimestamp.tmp' once timestamp returned 2023-03-03 13:50:44 -05:00
CheckFileStep.zig std.Build: avoid use of catch unreachable 2023-01-31 15:09:35 -07:00
CheckObjectStep.zig std.Build: avoid use of catch unreachable 2023-01-31 15:09:35 -07:00
CompileStep.zig eliminate posix_spawn from the standard library 2023-03-10 15:41:07 -05:00
ConfigHeaderStep.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
EmulatableRunStep.zig add test to ignore sigpipe 2023-02-17 15:25:36 -07:00
FmtStep.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
InstallArtifactStep.zig remove reference to removed addTestExe 2023-02-01 22:52:32 -05:00
InstallDirStep.zig
InstallFileStep.zig
LogStep.zig
ObjCopyStep.zig rename std.Build.InstallRawStep to ObjCopyStep 2023-02-24 23:48:03 -05:00
OptionsStep.zig std.Build.OptionsStep: update test case 2023-02-13 06:42:26 -07:00
RemoveDirStep.zig
RunStep.zig Merge pull request #11982 from marler8997/ignoreSigpipe 2023-02-19 13:55:12 -05:00
Step.zig rename std.Build.InstallRawStep to ObjCopyStep 2023-02-24 23:48:03 -05:00
TranslateCStep.zig std.Build: enhancements to ConfigHeaderStep 2023-02-05 06:26:30 -07:00
WriteFileStep.zig std.Build.WriteFileStep: integrate with cache system 2023-02-23 01:08:23 -05:00