11 Commits

Author SHA1 Message Date
Alex Rønne Petersen
9be9b8ca90 std.Build.findProgram(): Try with and without the Windows executable extensions.
I renamed std.process.Child.CreateProcessSupportedExtension to WindowsExtension
and made it public to avoid duplicating the list of extensions.

While here, I also improved it to not misreport OOM from std.fs.realpathAlloc()
as a generic failure to find the program, but instead panic like the rest of the
build system does for OOM.

Closes #20314.
2024-06-21 15:41:03 -04:00
Andrew Kelley
42658de762 std.process.Child: run fn accepts std.Progress.Node
There was not a way to pass a progress node to this function until now.
2024-06-16 19:28:13 -07:00
Andrew Kelley
947a3a1be9 std.process.Child: fix spawning child proc with new cwd fd
Before this fix, the dup2 of the progress pipe was clobbering the cwd
fd, causing the fchdir to return ENOTDIR in between fork() and exec().
2024-05-27 20:56:49 -07:00
Andrew Kelley
e2e61f3296 std.process.Child: comptime assert to protect prog_fileno
documenting my assumptions via comptime assertion
2024-05-27 20:56:48 -07:00
mlugg
acdf988c24 std.process.Child: prevent racing children from inheriting progress pipes
This fix is already in master branch for stdin, stdout, and stderr; this
commit solves the same problem but for the progress pipe.

Both fixes were originally included in one commit on this branch,
however it was split it into two so that master branch could receive the
fix before the progress branch is merged.
2024-05-27 20:56:48 -07:00
Andrew Kelley
c01cfde688 std.process.Child: fix ZIG_PROGRESS env var handling
and properly dup2 the file descriptor to make it handle the case when
other files are already open
2024-05-27 20:56:48 -07:00
Andrew Kelley
df46f5af69 std.Progress: include subtrees from child processes 2024-05-27 20:56:48 -07:00
Andrew Kelley
f07116404a std.Progress: child process sends updates via IPC 2024-05-27 20:56:48 -07:00
Matthew Lugg
389181f6be std.process.Child: prevent racing children from inheriting one another's pipes
The added comment explains the issue here relatively well. The new
progress API made this bug obvious because it became visibly clear that
certain Compile steps were seemingly "hanging" until other steps
completed. As it turned out, these child processes had raced to spawn,
and hence one had inherited the other's stdio pipes, meaning the `poll`
call in `std.Build.Step.evalZigProcess` was not identifying the child
stdout as closed until an unrelated process terminated.
2024-05-26 16:44:14 -04:00
Ryan Liptak
aa463adc91 std.process.Child: Improve doc comments of Windows argv -> command line functions 2024-05-26 09:37:14 -07:00
Andrew Kelley
f47824f24d std: restructure child process namespace 2024-05-26 09:31:55 -07:00