[llvm-branch-commits] [llvm] [lit] Add support for setting limits to unlimited (PR #165123)
Alexander Richardson via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Oct 27 09:19:18 PDT 2025
================
@@ -602,18 +602,28 @@ def executeBuiltinUlimit(cmd, shenv):
"""executeBuiltinUlimit - Change the current limits."""
if os.name != "posix":
raise InternalShellError(cmd, "'ulimit' not supported on this system")
+ # Import resource here after we confirm we are on a POSIX system as the
+ # module does not exist on Windows.
+ import resource
----------------
arichardson wrote:
```suggestion
try:
# Try importing the resource package (for POSIX systems) and emit
# an error on Windows where it does not exist.
import resource
except ImportError:
raise InternalShellError(cmd, "'ulimit' not supported on this system")
```
I guess this would be the other option to avoid hardcoding os.name == posix
https://github.com/llvm/llvm-project/pull/165123
More information about the llvm-branch-commits
mailing list