[Mlir-commits] [mlir] [MLIR] Fix inverted logic of LIT_USE_INTERNAL_SHELL (PR #105483)

Michael Kruse llvmlistbot at llvm.org
Wed Aug 21 01:36:18 PDT 2024


https://github.com/Meinersbur created https://github.com/llvm/llvm-project/pull/105483

The value of `LIT_USE_INTERNAL_SHELL` is inverted although it is not supposed to. The inversion was introduced in #65415.

Assume the environment variable `LIT_USE_INTERNAL_SHELL=0` (i.e. use `/bin/sh`) is set:
```py
use_lit_shell = True                                          # Use internal shell
lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")      # lit_shell_env = "0", i.e. use /bin/sh
if lit_shell_env:
  use_lit_shell = not lit.util.pythonize_bool(lit_shell_env)  # use_lit_shell = not bool("0") = True, i.e. use internal shell

config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell) # execute_external = not True = False, i.e. use internal shell even though we explicitly switched off `LIT_USE_INTERNAL_SHELL`.
```

>From d2de4b855c0f56c9700e2841abdb99cc98daa7bb Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Wed, 21 Aug 2024 10:22:52 +0200
Subject: [PATCH] [MLIR] Fix inverted logic of LIT_USE_INTERNAL_SHELL

---
 mlir/test/lit.cfg.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/test/lit.cfg.py b/mlir/test/lit.cfg.py
index 98d0ddd9a2be11..81a668e73d4b24 100644
--- a/mlir/test/lit.cfg.py
+++ b/mlir/test/lit.cfg.py
@@ -23,7 +23,7 @@
 use_lit_shell = True
 lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
 if lit_shell_env:
-  use_lit_shell = not lit.util.pythonize_bool(lit_shell_env)
+  use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
 
 config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
 



More information about the Mlir-commits mailing list