-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
zig.eclass: fix rare spurious error.BrokenPipe
during src_test
#39723
Conversation
Most likely caused by `grep -q` processing too fast when steps are filtered. Can sometimes be reproduced with this command (you might need several retries to hit it): ```console $ for i in {0..20}; do zig build --list-steps | grep -q test; done error: BrokenPipe /usr/lib64/zig/9999/lib/compiler/build_runner.zig:1229:9: 0x1518f3e in steps__anon_4736 (build) try out_stream.print(" {s:<28} {s}\n", .{ name, top_level_step.description }); ^ /usr/lib64/zig/9999/lib/compiler/build_runner.zig:374:9: 0x1511b81 in main (build) return steps(builder, stdout_writer); ^ error: the following build command failed with exit code 1: /home/bratishkaerik/github.com/zig/.zig-cache/o/4b3846557c333ec9e467b7cc136d3698/build /usr/lib64/zig/9999/bin/zig /usr/lib64/zig/9999/lib /home/bratishkaerik/github.com/zig /home/bratishkaerik/github.com/zig/.zig-cache /home/bratishkaerik/.cache/zig --seed 0x86f5c718 -Z7b5e4ad814524daf --list-steps ``` Caught this today when I merged and tested `dev-lang/zig:9999` 9 times in a row because I was checking patch for upstream. Out of these 9 times it failed only once. I couldn't reproduce this on `sys-fs/ncdu` or `gui-wm/river::guru`, my guess here is that `test` step is listed last there, so zig pipe catches up with it. Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
Pull Request assignmentSubmitter: @BratishkaErik @gentoo/github Linked bugsNo bugs to link found. If your pull request references any of the Gentoo bug reports, please add appropriate GLEP 66 tags to the commit message and request reassignment. New packagesThis Pull Request appears to be introducing new packages only. Due to limited manpower, adding new packages is considered low priority. This does not mean that your Pull Request will not receive any attention, however, it might take quite some time for it to be reviewed. In the meantime, your new ebuild might find a home in the GURU project repository: the ebuild repository maintained collaboratively by Gentoo users. GURU offers your ebuild a place to be reviewed and improved by other Gentoo users, while making it easy for Gentoo users to install it and enjoy the software it adds. In order to force reassignment and/or bug reference scan, please append Docs: Code of Conduct ● Copyright policy (expl.) ● Devmanual ● GitHub PRs ● Proxy-maint guide |
Sometimes it also hides real errors: >>> Test phase: dev-lang/zig-0.13.0-r2
* ZBS: testing with: -j7 -Dtarget=native -Dcpu=x86_64_v3 --release=safe --prefix-exe-dir bin/ --prefix-lib-dir lib64/ --prefix-include-dir include/ --prefix usr/ --libc /var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/zig_libc.txt --summary all --verbose --build-file /var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0/build.zig --zig-lib-dir /var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0/lib/ --prefix-lib-dir lib/ -Dno-langref -Dstd-docs=false --release=fast -Denable-llvm=true -Dstatic-llvm=false -Dconfig_h=/var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0_build/config.h -Dskip-non-native
error: BrokenPipe
/var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0/lib/compiler/build_runner.zig:1073:9: 0x11c6a06 in steps__anon_9081 (build)
try out_stream.print(" {s:<28} {s}\n", .{ name, top_level_step.description });
^
/var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0/lib/compiler/build_runner.zig:336:9: 0x11c007c in main (build)
return steps(builder, stdout_writer);
^
error: the following build command failed with exit code 1:
/var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/zig-cache/local/o/0d2b10813df93d3d14ee85b3dcd9379b/build /var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0_build/stage3/bin/zig /var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0 /var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/zig-cache/local/ /var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/zig-cache/global/ --seed 0x54be53e9 -Z2f2bf09d71c992dd --list-steps -j7 -Dtarget=native -Dcpu=x86_64_v3 --release=safe --prefix-exe-dir bin/ --prefix-lib-dir lib64/ --prefix-include-dir include/ --prefix usr/ --libc /var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/zig_libc.txt --summary all --verbose --zig-lib-dir /var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0/lib/ --prefix-lib-dir lib/ -Dno-langref -Dstd-docs=false --release=fast -Denable-llvm=true -Dstatic-llvm=false -Dconfig_h=/var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0_build/config.h -Dskip-non-native
* Failed to run command: ./stage3/bin/zig build --list-steps -j7 -Dtarget=native -Dcpu=x86_64_v3 --release=safe --prefix-exe-dir bin/ --prefix-lib-dir lib64/ --prefix-include-dir include/ --prefix usr/ --libc /var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/zig_libc.txt --summary all --verbose --build-file /var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0/build.zig --zig-lib-dir /var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0/lib/ --prefix-lib-dir lib/ -Dno-langref -Dstd-docs=false --release=fast -Denable-llvm=true -Dstatic-llvm=false -Dconfig_h=/var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0_build/config.h -Dskip-non-native
* ERROR: dev-lang/zig-0.13.0-r2::gentoo failed (test phase):
* ZBS: listing steps failed
*
* Call stack:
* ebuild.sh, line 136: Called src_test
* environment, line 3348: Called zig_src_test '-Dskip-non-native'
* environment, line 5111: Called die
* The specific snippet of code:
* if grep -q '^[ ]*test[ ]' < <(nonfatal ezig build --list-steps "${args[@]}" || die "ZBS: listing steps failed"); then
*
* If you need support, post the output of `emerge --info '=dev-lang/zig-0.13.0-r2::gentoo'`,
* the complete build log and the output of `emerge -pqv '=dev-lang/zig-0.13.0-r2::gentoo'`.
* The complete build log is located at '/var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/environment'.
* Working directory: '/var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0_build'
* S: '/var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0'
...
test
└─ test-link
└─ link_test_cases
└─ test-macho
└─ test-hello-zig-x86_64-macos.11.7.1...14.1-none-Debug-no-llvm-no-lld
└─ run main
└─ zig build-exe main Debug x86_64-macos 1 errors
error: unable to find libSystem system library
note: tried /usr/lib/libSystem.tbd
note: tried /usr/lib/libSystem.dylib
note: tried /usr/lib/libSystem
note: tried /usr/lib/llvm/18/lib/libSystem.tbd
note: tried /usr/lib/llvm/18/lib/libSystem.dylib
note: tried /usr/lib/llvm/18/lib/libSystem
error: the following command failed with 1 compilation errors:
/var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0_build/stage3/bin/zig build-exe -fno-llvm -fno-lld -ODebug -target x86_64-macos -mcpu baseline -Mroot=/var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/zig-cache/local/o/d7ba7107f3e0a304e83356689aff43eb/a.zig --libc /var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/zig_libc.txt --cache-dir /var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/zig-cache/local/ --global-cache-dir /var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/zig-cache/global/ --name main -L /usr/lib/llvm/18/lib -I /usr/lib/llvm/18/include --listen=-
/var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0_build/stage3/bin/zig test -ODebug -target x86_64-linux-musl -mcpu baseline -Mroot=/var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0/lib/std/std.zig -lc --libc /var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/zig_libc.txt --cache-dir /var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/zig-cache/local/ --global-cache-dir /var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/zig-cache/global/ --name test -L /usr/lib/llvm/18/lib -I /usr/lib/llvm/18/include --zig-lib-dir /var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0/lib --listen=-
>>> Failed to emerge dev-lang/zig-0.13.0-r2, Log file:
>>> '/var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/build.log'
* Messages for package dev-lang/zig-0.13.0-r2:
* Failed to run command: ./stage3/bin/zig build --list-steps -j7 -Dtarget=native -Dcpu=x86_64_v3 --release=safe --prefix-exe-dir bin/ --prefix-lib-dir lib64/ --prefix-include-dir include/ --prefix usr/ --libc /var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/zig_libc.txt --summary all --verbose --build-file /var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0/build.zig --zig-lib-dir /var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0/lib/ --prefix-lib-dir lib/ -Dno-langref -Dstd-docs=false --release=fast -Denable-llvm=true -Dstatic-llvm=false -Dconfig_h=/var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0_build/config.h -Dskip-non-native
* ERROR: dev-lang/zig-0.13.0-r2::gentoo failed (test phase):
* ZBS: listing steps failed
*
* Call stack:
* ebuild.sh, line 136: Called src_test
* environment, line 3348: Called zig_src_test '-Dskip-non-native'
* environment, line 5111: Called die
* The specific snippet of code:
* if grep -q '^[ ]*test[ ]' < <(nonfatal ezig build --list-steps "${args[@]}" || die "ZBS: listing steps failed"); then
*
* If you need support, post the output of `emerge --info '=dev-lang/zig-0.13.0-r2::gentoo'`,
* the complete build log and the output of `emerge -pqv '=dev-lang/zig-0.13.0-r2::gentoo'`.
* The complete build log is located at '/var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/environment'.
* Working directory: '/var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0_build'
* S: '/var/tmp/portage/dev-lang/zig-0.13.0-r2/work/zig-0.13.0'
*
* The following package has failed to build, install, or execute postinst:
*
* (dev-lang/zig-0.13.0-r2:0.13/0.13::gentoo, ebuild scheduled for merge), Log file:
* '/var/tmp/portage/dev-lang/zig-0.13.0-r2/temp/build.log'
* |
Pull request CI reportReport generated at: 2024-12-15 21:55 UTC There are existing issues already. Please look into the report to make sure none of them affect the packages in question: |
Thanks! |
Most likely caused by
grep -q
processing too fast when steps are filtered. Can sometimes be reproduced with this command (you might need several retries to hit it):Caught this today when I merged and tested
dev-lang/zig:9999
9 times in a row because I was checking patch for upstream. Out of these 9 times it failed only once. I couldn't reproduce this onsys-fs/ncdu
orgui-wm/river::guru
, my guess here is thattest
step is listed last there, so zig pipe catches up with it.Please check all the boxes that apply:
Signed-off-by
line to every commit in the pull request.pkgcheck scan --commits --net
to check for issues with my commits.Please note that all boxes must be checked for the pull request to be merged.