| ... | @@ -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 | }; |
| 2222 | | 2222 | |
| | 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); |