Fix standalone Lit discovery - #568
Open
shin4141 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #432
Summary
Cling's standalone CMake configuration currently decides whether to enable tests using
LLVM_LIT, but modern LLVM'sAddLLVMtest helpers executeLLVM_EXTERNAL_LIT/LLVM_DEFAULT_EXTERNAL_LIT.That creates two problems:
lit.py, while current Lit installations commonly providelitor LLVM's platform launcher.This change keeps LLVM-provided Lit configuration authoritative, preserves source-tree Lit discovery, and only falls back to platform-appropriate installed executables when LLVM has not already supplied one. A fallback discovered by Cling is forwarded through
LLVM_EXTERNAL_LITso the same executable is used byAddLLVM.If no valid Lit executable is available, standalone tests remain disabled as before.
Verification
I exercised standalone CMake configuration with isolated cases for:
LLVM_EXTERNAL_LITLLVM_DEFAULT_EXTERNAL_LITutils/lit/lit.pyllvm-litlitllvm-lit.pyselection logicThe precedence is:
LLVM_EXTERNAL_LITLLVM_DEFAULT_EXTERNAL_LITlitA negative-control run restoring the old
lit.py-only fallback reproduced the original failure: CMake configured successfully but disabled Cling tests when only a valid installedlitexecutable was available.git diff --checkalso passes.I did not run a full Cling build or
check-clinglocally because this environment does not contain a real built LLVM/Clang installation.