mlugg 048e85f27e
std.process.Child: add waitForSpawn
`std.Build.Step.Run` makes the very reasonable assumption that
`error.InvalidExe` will be reported on `spawn` if it will happen.
However, this property does not currently hold on POSIX targets. This
is, through a slightly convoluted series of events, partially
responsible for the sporadic `BrokenPipe` errors we've been seeing more
and more in CI runs.

Making `spawn` wait for the child to exec in the POSIX path introduces
a block of up to 400us. So, instead of doing that, we add a new API for
this particular case: `waitForSpawn`. This function is a nop on Windows,
but on POSIX it blocks until the child successfully (or otherwise) calls
`execvpe`, and reports the error if necessary. `std.Build.Step.Run`
calls this function, so that it can get `error.InvalidExe` when it wants
it.

I'm not convinced that this API is optimal. However, I think this entire
API needs to be either heavily refactored or straight-up redesigned
(related: #22504), so I'm not too worried about hitting the perfect API:
I'd rather just fix this bug for now, and figure out the long-term goal
a bit later.
2025-01-20 00:27:19 +00:00
..
2025-01-20 00:27:19 +00:00
2024-12-19 17:10:03 -05:00
2025-01-16 20:42:08 -05:00
2024-02-23 02:37:11 -07:00
2025-01-16 20:42:08 -05:00
2024-07-23 11:43:12 -07:00
2025-01-16 20:42:08 -05:00
2024-07-09 14:25:42 -07:00
2024-03-10 18:13:30 -07:00
2025-01-16 20:47:30 -05:00
2024-08-22 08:44:08 +02:00
2024-03-21 14:11:46 -07:00
2024-11-01 02:04:27 +03:30
2025-01-16 20:42:08 -05:00
2024-08-07 00:48:32 -07:00
2024-07-31 16:57:42 -07:00
2025-01-16 20:42:08 -05:00
2024-07-19 00:30:32 -07:00
2025-01-16 20:42:08 -05:00
2024-08-29 23:43:52 +01:00
2025-01-16 20:42:08 -05:00
2024-07-09 14:25:42 -07:00
2025-01-16 20:42:08 -05:00