[llvm] [lit] Fix to make "RUN: env PATH=..." work as intended (PR #165308)

Björn Pettersson via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 27 13:56:05 PDT 2025


================
@@ -949,7 +945,7 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
             path = (
                 cmd_shenv.env["PATH"] if "PATH" in cmd_shenv.env else shenv.env["PATH"]
----------------
bjope wrote:

Well, I also thought that it looked a bit weird to use the parent env in case of `env -i`.

The goal with this patch is to fix the case when PATH actually is set to something, and then use the correct env when looking up the executable. So I haven't really considered the scenario when PATH is unset in `cmd_shenv`.

https://github.com/llvm/llvm-project/pull/165308


More information about the llvm-commits mailing list