From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9AF3C15802C for ; Sun, 15 Dec 2024 21:54:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5BCF3E0A90; Sun, 15 Dec 2024 21:54:45 +0000 (UTC) Received: from mail.landless-city.net (mail.landless-city.net [IPv6:2a11:4c02:0:10::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id AF29FE0A52 for ; Sun, 15 Dec 2024 21:54:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; s=2024112001_rsa; d=landless-city.net; c=relaxed/relaxed; r=y; h=Message-ID:Date:Subject:To:From; t=1734299678; bh=vhwZrTezpqD9MYMQm2Vv+lM ZhcXT6JGfyBf18sO9zxc=; b=dclEI8lwU7NIDf7D2YqEeCfI48aIeR1wYQ1Qx39ZFo94fFZZxx A/7X9ZRG4QrpYMZx7jmpG5KR1/lpm2qlRfMymjTiI6+7SBNS7glI5j18vhdn8RSIFQw+idaOoHj p5+m8vOkCeNAiS0BlboqSv2DEMrGhj5TfQgeOMXi32Q/PIzqUflnzr/1ncUxmDb2UiSdUHxVPs6 n05r7NlzxvC+Vf6ZF5PlsiGYD2a4e3PO8ZFTiKn5tm2fNJrjn8FcvAWnov11GVfLzMFCe2VC/GQ NwBmD5IZMmW0iZiPC3vhVrDBn/42LAkpbNqjALJQR989ORKRCBcy1Pdz94GhBmVeQ1A==; DKIM-Signature: v=1; a=ed25519-sha256; s=2024112001_ed25519; d=landless-city.net; c=relaxed/relaxed; r=y; h=Message-ID:Date:Subject:To:From; t=1734299678; bh=vhwZrTezpqD9MYMQm2Vv+lM ZhcXT6JGfyBf18sO9zxc=; b=DNtdICC+yOvn9jTEW6waOEiTUjPLUHrwlxubYkd8mK8xyVd+SX etdTXzItSNAP8CL38WqGE3dbEqfpo8Hqb5BQ==; From: Eric Joldasov To: gentoo-dev@lists.gentoo.org Subject: [gentoo-dev] [PATCH] zig.eclass: fix rare spurious `error.BrokenPipe` during `src_test` Date: Mon, 16 Dec 2024 02:54:14 +0500 Message-ID: <20241215215437.4374-1-bratishkaerik@landless-city.net> X-Mailer: git-send-email 2.47.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: d919ca76-6f7a-4069-b4b3-ebe7fe3799ba X-Archives-Hash: a3395bc2a1fe22b411d9c69d7dbd9ea6 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. (GitHub PR https://www.github.com/gentoo/gentoo/pull/39723) Signed-off-by: Eric Joldasov --- eclass/zig.eclass | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eclass/zig.eclass b/eclass/zig.eclass index e838616ef72a..2a0178e66d71 100644 --- a/eclass/zig.eclass +++ b/eclass/zig.eclass @@ -520,9 +520,10 @@ zig_src_test() { # by whitespaces is not enough for some cases. # We probably need something like "--list-steps names_only". # In practice, almost nobody sets such names. + # Ignore failures like rare random "error.BrokenPipe" here. + # If they are real, they would appear in "ezig build test" anyway. if grep -q '^[ ]*test[ ]' < <( - nonfatal ezig build --list-steps "${args[@]}" || - die "ZBS: listing steps failed" + nonfatal ezig build --list-steps "${args[@]}" ); then einfo "ZBS: testing with: ${args[@]}" nonfatal ezig build test "${args[@]}" || -- 2.47.0