Skip to content

[build] Ship the clang builtin headers and prefer them at runtime - #33

Open
aaronj0 wants to merge 1 commit into
mainfrom
bundle-clang-resource-headers
Open

[build] Ship the clang builtin headers and prefer them at runtime#33
aaronj0 wants to merge 1 commit into
mainfrom
bundle-clang-resource-headers

Conversation

@aaronj0

@aaronj0 aaronj0 commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

This is the second part of the patch that ships the required runtime clang headers. With this change, a build/install of cppjit is self-contained and with the LLVM that is statically linked into libClangCppInterOp.so, we drop the LLVM dependency on a target machine. The wheels build PR will exercise this on clean images without LLVM.

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown

Test Results

Configuration Result
macos-26-intel-llvm21-py3.14-cxx20 = 437 passed, 44 skipped, 85 xfailed, 32 xpassed, 100 warnings in 96.58s (0:01:36) =
macos-26-llvm21-py3.14-cxx20 ==== 438 passed, 37 skipped, 93 xfailed, 30 xpassed, 100 warnings in 44.91s ====
ubuntu-24.04-llvm21-py3.14-cxx20-vg ====== 553 passed, 25 skipped, 18 xfailed, 2 xpassed in 93.56s (0:01:33) =======
ubuntu-24.04-llvm22-py3.14-cxx20 ====== 553 passed, 25 skipped, 19 xfailed, 1 xpassed in 105.60s (0:01:45) ======
ubuntu-24.04-llvm22-py3.14-cxx20-cling ====== 543 passed, 25 skipped, 27 xfailed, 3 xpassed in 108.59s (0:01:48) ======
ubuntu-24.04-llvm22-py3.14-cxx23 ====== 574 passed, 3 skipped, 20 xfailed, 1 xpassed in 110.72s (0:01:50) =======

@aaronj0
aaronj0 requested a review from vgvassilev August 21, 2026 08:55
Comment thread CMakeLists.txt
endif()
install(DIRECTORY "${_clang_resource_dir}/include/"
DESTINATION "cppjit_backend/lib/clang/${LLVM_VERSION_MAJOR}/include"
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this is wrong. The clang resource directory contains a lot more than clang headers. Look at the contents of clang -print-resource-dir.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but we only ship /include. As per my understanding that is all we need, and the in-process JIT does not use any symbols from the compiler-rt archives in /lib

@aaronj0 aaronj0 Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of the contents of resource-dir are not a requirement for a self-contained cppjit wheel. They are link time contents so they cannot be used unless we want to load those archives at runtime, all the necesseray llvm libs are already linked into cppinterop_

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so, you may want to put it as include path? And not as resource directory?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing in the installed layout is called resource director, but here it is written out as clang/${LLVM_VERSION_MAJOR}/include under cppjit_backend. Yes, the variables CPPJIT_RESOURCE_DIR and ResourceDir are inaccurate. I have now renamed them to say clang include dir. _clang_resource_dir is still correct

@aaronj0
aaronj0 force-pushed the bundle-clang-resource-headers branch from 198d0e3 to 46a6799 Compare August 21, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants