Support developer builds of CppInterOp/LLVM, add project verification and robust fallbacks - #18
Merged
Merged
Conversation
Test Results
|
guitargeek
reviewed
Aug 15, 2026
guitargeek
approved these changes
Aug 15, 2026
guitargeek
left a comment
Collaborator
There was a problem hiding this comment.
LGTM! Consider CMake 3.20 compatibility if possible, but if it can't be done so be it. LLVM will also require CMake 3.31, starting from LLVM 24.
aaronj0
force-pushed
the
cmake-devmodule-and-source-dir
branch
from
August 15, 2026 09:46
f4e4787 to
93546f6
Compare
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.
Developing CppInterOp or LLVM against cppjit requires building from local trees instead of the pinned clone.
CPPINTEROP_SOURCE_DIRnow builds CppInterOp from a local checkout with incremental rebuilds, and a post-config check rejects source trees that are not CppInterOp. Validated against a fetch of ci-workflows LLVM 22 and an uninstalled LLVM 21.1.8 build tree. This change also improves how robust the build system is with various permutations of developer setups (custom CppInterOp/LLVM development)The behavior of cppjit's build system with this change is:
pip install . --config-settings=cmake.define.<...>CPPINTEROP_GIT_TAGfind_package(LLVM):$CONDA_PREFIXhint, then the system searchLLVM_DIR=<dir>CPPINTEROP_GIT_REPOSITORY=<url>/CPPINTEROP_GIT_TAG=<ref>CPPINTEROP_SOURCE_DIR=<dir>Priority:
CPPINTEROP_SOURCE_DIRoverCPPINTEROP_GIT_REPOSITORY/CPPINTEROP_GIT_TAGLLVM_DIRover the$CONDA_PREFIXhint over the system search.The two axes combine freely, and the selected LLVM is forwarded to the CppInterOp sub-build.
The negative cases each fail at config time with actionable feedback:
No LLVM CMake package found. Install LLVM 20-22 development packages (apt: llvm-22-dev libclang-22-dev; conda: llvmdev clangdev), or point cppjit at your own LLVM build with -DLLVM_DIR=...LLVM_DIRinvalidNo LLVMConfig.cmake under LLVM_DIR (<path>); expected <install prefix or build tree>/lib/cmake/llvmClang_DIRinvalidNo ClangConfig.cmake under Clang_DIR (<path>)LLVM <version> is unsupported: the currently supported CppInterOp version (CPPINTEROP_GIT_TAG) only supports LLVM 20-22CPPINTEROP_SOURCE_DIRis not a CMake treeThe provided source path override declares project '<name>', not CppInterOpThe supported range is defined once next to the pin (
CPPJIT_LLVM_VERSION_MIN/MAX, updated together with the supported CppInterOp version), and the Clang lookup is now confined to the discovered LLVM's own package dir, preventing a mismatched system clang from breaking the config on a machine with several toolchains installed.