[llvm] [llvm-lit] Fix `TypeError` string argument expected in lit's internal shell (PR #105925)

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 5 10:28:06 PDT 2024


================
@@ -776,8 +776,8 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
         # FIXME: Standardize on the builtin echo implementation. We can use a
         # temporary file to sidestep blocking pipe write issues.
 
-        # Ensure args[0] is hashable.
-        args[0] = expand_glob(args[0], cmd_shenv.cwd)[0]
+        # Expand all glob expressions
+        args = expand_glob_expressions(args, cmd_shenv.cwd)
----------------
arichardson wrote:

With this change the call to `expand_glob_expressions` in `executeBuiltinMkdir` and `executeBuiltinRm()` can also be removed.

It would probably also be good to add a test that checks something like the following
```
# RUN: touch %t-first.txt %t-second.txt
# RUN: ls %t-*.txt
# RUN: rm -v %t-*.txt
# Check that both files were deleted.
# RUN: test ! -e %t-first.txt 
# RUN: test ! -e %t-second.txt
```

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


More information about the llvm-commits mailing list