authorgravatar for techatrix@mailbox.orgTechatrix <techatrix@mailbox.org> 2026-07-13 00:06:57+02:00
committergravatar for techatrix@mailbox.orgTechatrix <techatrix@mailbox.org> 2026-07-21 16:31:30+02:00
logf0b768988d2c28f854195212d98b4fd3a7f654da
treedb202a91389a67678ef7135a2d6080bb088adab2
parent38efc69dc98f8548d473eeee24ea0717d07af11e
signaturebadge-check Signed by SSH key SHA256:HYC3SjXQcAt6uwv9pu/6OoVQ2rUH8rb5zKiUHSe9uxk

do not inherit stdio of run step when running the build system protocol


1 files changed, 14 insertions(+), 4 deletions(-)

lib/compiler/Maker/Step/Run.zig+14-4
......@@ -2201,25 +2201,35 @@ fn spawnChildAndCollect(
22012201 assert(conf_run.flags.stdio != .inherit);
22022202 break :s .pipe;
22032203 } else switch (conf_run.flags.stdio) {
2204 .infer_from_args => if (has_side_effects) .inherit else .ignore,
2204 .infer_from_args => if (maker.protocol_server == null and has_side_effects) .inherit else .ignore,
22052205 .inherit => .inherit,
22062206 .check => .ignore,
22072207 .zig_test => .pipe,
22082208 },
22092209 .stdout = if (conf_run.captured_stdout.value != null) .pipe else switch (conf_run.flags.stdio) {
2210 .infer_from_args => if (has_side_effects) .inherit else .ignore,
2210 .infer_from_args => if (maker.protocol_server == null and has_side_effects) .inherit else .ignore,
22112211 .inherit => .inherit,
22122212 .check => if (checksContainStdout(&conf_run)) .pipe else .ignore,
22132213 .zig_test => .pipe,
22142214 },
22152215 .stderr = if (conf_run.captured_stderr.value != null) .pipe else switch (conf_run.flags.stdio) {
2216 .infer_from_args => if (has_side_effects) .inherit else .pipe,
2217 .inherit => .inherit,
2216 .infer_from_args => if (maker.protocol_server == null and has_side_effects) .inherit else .pipe,
2217 .inherit => if (maker.protocol_server == null) .inherit else .pipe,
22182218 .check => .pipe,
22192219 .zig_test => .pipe,
22202220 },
22212221 };
22222222
2223 if (maker.protocol_server != null) {
2224 if (spawn_options.stdin == .inherit) {
2225 return step.fail(maker, "Cannot inherit stdin when running through over the build system protocol", .{});
2226 }
2227 if (spawn_options.stdout == .inherit) {
2228 return step.fail(maker, "Cannot inherit stdout when running through over the build system protocol", .{});
2229 }
2230 assert(spawn_options.stderr != .inherit);
2231 }
2232
22232233 if (conf_run.flags.stdio == .zig_test) {
22242234 try setColorEnvironmentVariables(&conf_run, environ_map, graph.stderr_mode.?);
22252235 const started: Io.Clock.Timestamp = .now(io, .awake);