Skip to content

Commit 66510fc

Browse files
authored
[SystemZ][z/OS] Enable lit testing for z/OS (#107631)
This patch fixes various errors to enable llvm-lit to run on z/OS
1 parent e009089 commit 66510fc

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lit/run.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import multiprocessing
22
import os
3+
import platform
34
import time
45

56
import lit.Test
@@ -136,6 +137,6 @@ def _increase_process_limit(self):
136137
"Raised process limit from %d to %d" % (soft_limit, desired_limit)
137138
)
138139
except Exception as ex:
139-
# Warn, unless this is Windows, in which case this is expected.
140-
if os.name != "nt":
140+
# Warn, unless this is Windows or z/OS, in which case this is expected.
141+
if os.name != "nt" and platform.system() != "OS/390":
141142
self.lit_config.warning("Failed to raise process limit: %s" % ex)

lit/util.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ def killProcessAndChildrenIsSupported():
502502
otherwise is contains a string describing why the function is
503503
not supported.
504504
"""
505-
if platform.system() == "AIX":
505+
if platform.system() == "AIX" or platform.system() == "OS/390":
506506
return (True, "")
507507
try:
508508
import psutil # noqa: F401
@@ -528,6 +528,9 @@ def killProcessAndChildren(pid):
528528
"""
529529
if platform.system() == "AIX":
530530
subprocess.call("kill -kill $(ps -o pid= -L{})".format(pid), shell=True)
531+
elif platform.system() == "OS/390":
532+
# FIXME: Only the process is killed.
533+
subprocess.call("kill -KILL $(ps -s {} -o pid=)".format(pid), shell=True)
531534
else:
532535
import psutil
533536

0 commit comments

Comments
 (0)