This is an archive of the discontinued LLVM Phabricator instance.

[lit] Likely fix for symlink path failures after D152709
AbandonedPublic

Authored by MrTrillian on Jun 16 2023, 5:16 AM.

Details

Summary

Update llvm-lit to switch from os.path.realpath to os.path.abspath like lit to avoid mismatching paths.

Context: D152709 switched lit from using os.path.realpath to os.path.abspath since the former changed behavior in Python 3.8 and now resolves substitute drives used to shorten paths on Windows, causing us to run into MAX_PATH issues (the CMake-based build is already well-behaved with regard to this). Clang tests broke on a few architectures, where breaks are comparing paths with symlinks with path with expanded symlinks. I cannot repro this failure locally, but the likely issue is that llvm-lit still had an os.path.realpath, which would mismatch what the base lit.py now does.

How tested: Ran check-clang and lit tests

Diff Detail

Event Timeline

MrTrillian created this revision.Jun 16 2023, 5:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2023, 5:16 AM
MrTrillian requested review of this revision.Jun 16 2023, 5:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2023, 5:16 AM

Same issue for me still, sorry:

llvm-lit: /bitbucket/nlopes/llvm/llvm/utils/lit/lit/TestingConfig.py:151: fatal: unable to parse config file '/home/nlopes/llvm/llvm/test/lit.cfg.py', traceback: Traceback (most recent call last):
  File "/bitbucket/nlopes/llvm/llvm/utils/lit/lit/TestingConfig.py", line 139, in load_from_path
    exec(compile(data, path, "exec"), cfg_globals, None)
  File "/home/nlopes/llvm/llvm/test/lit.cfg.py", line 21, in <module>
    config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
AttributeError: 'NoneType' object has no attribute 'use_lit_shell'
MrTrillian edited the summary of this revision. (Show Details)Jun 16 2023, 5:41 AM