[llvm] [lit] Avoid multiprocessing for -j1 runs (PR #175587)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 12 14:48:09 PST 2026
================
@@ -0,0 +1,42 @@
+# Test that -j1 runs in single-process mode (no multiprocessing).
+#
+# This ensures lit can run in sandboxed environments where multiprocessing
+# primitives (semaphores, process creation) are blocked.
+
+# REQUIRES: strace
+
+# Use strace to trace file operations. With -j1, lit should NOT create
+# POSIX semaphores in /dev/shm which are used by multiprocessing.Pool.
+#
+# Python's multiprocessing.BoundedSemaphore creates files like:
+# openat(AT_FDCWD, "/dev/shm/sem.XXXXXX", O_RDWR|O_CREAT|O_EXCL|...)
+#
+# These are the semaphores that fail in sandboxed environments, so verifying
+# they don't appear with -j1 confirms the fix works.
+#
+# Note: We use /usr/bin/env explicitly because lit's test config puts
+# fake-externals (which use #!/usr/bin/env python) at the start of PATH.
----------------
boomanaiden154 wrote:
Why exactly is `env` problematic?
https://github.com/llvm/llvm-project/pull/175587
More information about the llvm-commits
mailing list