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(...@@ -2201,25 +2201,35 @@ fn spawnChildAndCollect(
2201 assert(conf_run.flags.stdio != .inherit);2201 assert(conf_run.flags.stdio != .inherit);
2202 break :s .pipe;2202 break :s .pipe;
2203 } else switch (conf_run.flags.stdio) {2203 } 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,
2205 .inherit => .inherit,2205 .inherit => .inherit,
2206 .check => .ignore,2206 .check => .ignore,
2207 .zig_test => .pipe,2207 .zig_test => .pipe,
2208 },2208 },
2209 .stdout = if (conf_run.captured_stdout.value != null) .pipe else switch (conf_run.flags.stdio) {2209 .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,
2211 .inherit => .inherit,2211 .inherit => .inherit,
2212 .check => if (checksContainStdout(&conf_run)) .pipe else .ignore,2212 .check => if (checksContainStdout(&conf_run)) .pipe else .ignore,
2213 .zig_test => .pipe,2213 .zig_test => .pipe,
2214 },2214 },
2215 .stderr = if (conf_run.captured_stderr.value != null) .pipe else switch (conf_run.flags.stdio) {2215 .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,2216 .infer_from_args => if (maker.protocol_server == null and has_side_effects) .inherit else .pipe,
2217 .inherit => .inherit,2217 .inherit => if (maker.protocol_server == null) .inherit else .pipe,
2218 .check => .pipe,2218 .check => .pipe,
2219 .zig_test => .pipe,2219 .zig_test => .pipe,
2220 },2220 },
2221 };2221 };
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
2223 if (conf_run.flags.stdio == .zig_test) {2233 if (conf_run.flags.stdio == .zig_test) {
2224 try setColorEnvironmentVariables(&conf_run, environ_map, graph.stderr_mode.?);2234 try setColorEnvironmentVariables(&conf_run, environ_map, graph.stderr_mode.?);
2225 const started: Io.Clock.Timestamp = .now(io, .awake);2235 const started: Io.Clock.Timestamp = .now(io, .awake);