[llvm] [LIT] Fix env without subcommand causing early return in pipeline (PR #184028)
Paul Kirth via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 9 13:52:17 PDT 2026
================
@@ -1108,22 +1151,32 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
if data is not None:
output_files.append((name, path, data))
+ cmd_index = proc_cmd_indices[i]
results.append(
ShellCommandResult(
- cmd.commands[i],
+ cmd.commands[cmd_index],
out,
err,
res,
timeoutHelper.timeoutReached(),
output_files,
)
)
+ command_exit_codes[cmd_index] = res
+
+ exitCode = None
+ for cmd_result in command_exit_codes:
if cmd.pipe_err:
# Take the last failing exit code from the pipeline.
- if not exitCode or res != 0:
- exitCode = res
+ if exitCode is None or cmd_result != 0:
+ exitCode = cmd_result
else:
- exitCode = res
+ exitCode = cmd_result
+ if exitCode is None:
+ exitCode = 0
+
+ for input_file in inproc_pipeline_tempfiles:
+ input_file.close()
----------------
ilovepi wrote:
So we defer closing the temporaries until the pipeline finishes, right? It would be nice if we had a way to get them to close once that part of the pipeline is done. That doesn't sound practical to me given that we're still likely communicating with the rest of the pipeline over Popen, but it would be nice if they'd get dropped as they were consumed...
https://github.com/llvm/llvm-project/pull/184028
More information about the llvm-commits
mailing list