[PATCH] D118071: [SystemZ][z/OS]: fix lit tmp_dir to use - instead of _

Nancy Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 24 13:08:12 PST 2022


NancyWang2222 created this revision.
NancyWang2222 added reviewers: SeanP, abhina.sreeskantharajan, uweigand, fanbo-meng, yln.
Herald added a subscriber: delcypher.
NancyWang2222 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Latest upstream change in https://reviews.llvm.org/D117179 causes lit regressions on z/OS, when TMPDIR is exported and contains _, ld linker fails, it doesnt recognize _ specified in SYSLIN. this seems a limitation on z/OS. we need to fix lit.


https://reviews.llvm.org/D118071

Files:
  llvm/utils/lit/lit/main.py


Index: llvm/utils/lit/lit/main.py
===================================================================
--- llvm/utils/lit/lit/main.py
+++ llvm/utils/lit/lit/main.py
@@ -245,7 +245,9 @@
     tmp_dir = None
     if 'LIT_PRESERVES_TMP' not in os.environ:
         import tempfile
-        tmp_dir = tempfile.mkdtemp(prefix='lit_tmp_')
+        # z/OS linker limitation: When TMPDIR is exported and contains '_', it
+        # will cause lit test cases fail at linker step, use '-' to replace '_'.
+        tmp_dir = tempfile.mkdtemp(prefix='lit-tmp-')
         tmp_dir_envs = {k: tmp_dir for k in ['TMP', 'TMPDIR', 'TEMP', 'TEMPDIR']}
         os.environ.update(tmp_dir_envs)
         for cfg in {t.config for t in run.tests}:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118071.402632.patch
Type: text/x-patch
Size: 723 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220124/a3601655/attachment.bin>


More information about the llvm-commits mailing list