[all-commits] [llvm/llvm-project] d769ce: [Lit] Change processRedirects to open all files in...
Benjamin Stott via All-commits
all-commits at lists.llvm.org
Tue Apr 28 07:50:26 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d769ce21768c66a04b3e46d1b330fd29238b34a5
https://github.com/llvm/llvm-project/commit/d769ce21768c66a04b3e46d1b330fd29238b34a5
Author: Benjamin Stott <Benjamin.Stott at sony.com>
Date: 2026-04-28 (Tue, 28 Apr 2026)
Changed paths:
M llvm/utils/lit/lit/InprocBuiltins.py
M llvm/utils/lit/lit/ShellEnvironment.py
M llvm/utils/lit/lit/TestRunner.py
M llvm/utils/lit/tests/shtest-glob.py
Log Message:
-----------
[Lit] Change processRedirects to open all files in binary mode (#194368)
This PR is the second in a series of patches upgrading Lit's in-process
built-ins to be able to run with piped input/output and full redirection
support, and to allow custom in-process builtns to be provided via the
Lit config. The remaining patches to Lit's test runner can be found here@
https://github.com/BStott6/llvm-project/compare/lit-inproc-builtins.
This is part of the Lit daemonized testing project:
https://discourse.llvm.org/t/88612.
This PR makes Lit's `processRedirects` function open all input/output
files in binary mode. This makes sure that in-process builtins have the
expected behaviour when reading and writing from them:
Newline translation is not required for any of the current in-process
built-ins, in fact, the in-process built-in for `echo`, which is the
only one that writes to `stdout`, explicitly re-opens the output file
with `newline=""` on Windows, to avoid newline translation. Also,
in-process builtins will eventually need to be able to read or write
binary data: for example, `opt` without `-S` running in daemon mode.
I believe this has no functional change for regular process invocations;
I have confirmed that programs invoked by Lit which write to files
opened in binary mode by Lit still have the newline translation
performed as normal on Windows, unless they change the mode of their
output stream themselves.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list