zig/lib
Alex Kladov 865ef24518 build: don't hang when capturing Stdout of verbose Build.Step.Run
When using Build.Step.Run.captureStdOut with a program that prints more
than 10 megabytes of output, the build process hangs.

This is because evalGeneric returns an error without reading child's
stdin till the end, so we subsequently get stuck in `try child.wait()`.

To fix this, make sure to kill the child in case of an error!

Output before this change:

    λ ./zig/zig build  -Dmultiversion=0.15.6 -Dconfig-release=0.15.7 -Dconfig-release-client-min=0.15.6
    [3/8] steps
    └─ run gh
    ^C
    λ # an hour of debugging

Output after this change:

    λ ./zig/zig build  -Dmultiversion=0.15.6 -Dconfig-release=0.15.7 -Dconfig-release-client-min=0.15.6
    install
    └─ install generated to ../tigerbeetle
       └─ run build_mutliversion (tigerbeetle)
          └─ run unzip
             └─ run gh failure
    error: unable to spawn gh: StdoutStreamTooLong
    Build Summary: 3/8 steps succeeded; 1 failed (disable with --summary none)
    install transitive failure
    └─ install generated to ../tigerbeetle transitive failure
       └─ run build_mutliversion (tigerbeetle) transitive failure
          └─ run unzip transitive failure
             └─ run gh failure
    error: the following build command failed with exit code 1:
    /home/matklad/p/tb/work/.zig-cache/o/c0e3f5e66ff441cd16f9a1a7e1401494/build /home/matklad/p/tb/work/zig/zig /home/matklad/p/tb/work /home/matklad/p/tb/work/.zig-cache /home/matklad/.cache/zig --seed 0xc1d4efc8 -Zaecc61299ff08765 -Dmultiversion=0.15.6 -Dconfig-release=0.15.7 -Dconfig-release-client-min=0.15.6
2024-11-19 11:50:38 -08:00
..
compiler compiler: un-jit zig fmt 2024-11-12 21:55:46 -08:00
compiler_rt Merge pull request #21843 from alexrp/callconv-followup 2024-11-03 14:27:09 +01:00
docs Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
fuzzer/web Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
include clang: Update compiler-provided C headers to Clang 19.1.0. 2024-09-19 18:20:21 -07:00
init fix init template for new fuzz testing API 2024-09-11 13:41:29 -07:00
libc glibc: Fix an LP_SIZE redefinition warning for gnux32. 2024-11-02 10:42:53 +01:00
libcxx libcxx: Update to LLVM 19.1.0. 2024-09-19 18:20:22 -07:00
libcxxabi libcxxabi: Update to LLVM 19. 2024-09-19 18:20:21 -07:00
libunwind libunwind: Fix compilation for the x32 ABI. 2024-11-18 17:43:54 +01:00
std build: don't hang when capturing Stdout of verbose Build.Step.Run 2024-11-19 11:50:38 -08:00
tsan tsan: Update to LLVM 19.1.0. 2024-09-24 23:58:21 -07:00
c.zig c: Include Os.Tag.other in the list of freestanding OSs. 2024-11-08 14:56:55 +01:00
compiler_rt.zig handle _fltused in compiler_rt 2024-10-23 16:27:39 -07:00
fuzzer.zig fix type of std_options 2024-11-05 23:46:10 +01:00
zig.h zig.h: Improve portability of zig_*_windows_teb() helpers. 2024-11-04 11:59:38 +01:00