-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable CppInterOp #16814
base: master
Are you sure you want to change the base?
Enable CppInterOp #16814
Conversation
9392e07
to
2d038e7
Compare
Test Results 18 files 18 suites 3d 22h 13m 24s ⏱️ Results for commit 34a36e5. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The direction looks good to me! In addition to the test failures that need fixing, some comments inline for consideration
interpreter/CMakeLists.txt
Outdated
set(LLVM_DIR "${CMAKE_BINARY_DIR}/interpreter/llvm-project/llvm/lib/cmake/llvm") | ||
set(Clang_DIR "${CMAKE_BINARY_DIR}/interpreter/llvm-project/llvm/tools/clang/lib/cmake/clang") | ||
set(Cling_DIR "${CMAKE_BINARY_DIR}/interpreter/cling") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need adapting for externally built LLVM, Clang, and / or Cling. For LLVM and Clang, I believe this should already be taken care of above, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment still applies, even if the code was moved: variables related to this are already set above (and will change with #17354)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I will look into improving this config for externally built llvm and cling, and test if the existing variables work
@@ -0,0 +1,372 @@ | |||
<div align="center"> | |||
|
|||
# CppInterOp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed offline, we probably want a similar workflow as .github/workflows/llvm-diff.yml
to make sure our copies are not diverging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would still strongly recommend implement this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! The workflow has been added
ef871f9
to
86246a7
Compare
196c4ff
to
9977082
Compare
ab52fd8
to
540c6fc
Compare
c08b40e
to
2a684e1
Compare
93afacc
to
b48a22e
Compare
6f2ac11
to
7e53b7b
Compare
cd493d8
to
c25ce54
Compare
interpreter/CMakeLists.txt
Outdated
set(USE_CLING ON CACHE BOOL "Use Cling as backend" FORCE) | ||
set(USE_REPL OFF CACHE BOOL "Use Clang-repl as backend" FORCE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhm, can CppInterOp be changed to scope its configuration options? Setting this as a global CACHE
variable is not great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! We can get away by just setting USE_CLING ON
|
||
#ifdef _WIN32 | ||
GTEST_SKIP() << "Disabled on Windows (Fails with ROOT win-x64)"; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this done upstream in CppInterOp? We should not start by immediately diverging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aaronj0, do you remember how this used to fail?
#ifdef LLVM_BINARY_DIR | ||
TEST(InterpreterTest, DetectResourceDir) { | ||
#else | ||
|
||
TEST(InterpreterTest, DISABLED_DetectResourceDir) { | ||
#endif // LLVM_BINARY_DIR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this done upstream in CppInterOp? We should not start by immediately diverging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is only required when shipping CppInterOp externally and doesn't work with ROOT since llvm is not externally built, which is why we opted to disable and track this as a patch to the tests..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I think the binary dir is set but it is not what we expect it to be. I think that's part of the problem that LLVM's build system was not designed to be embedded in another build system...
be05b00
to
ffb1ec6
Compare
run: | | ||
rm -rf .github | ||
- name: Compare | ||
continue-on-error: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I was already wondering: With this line you just ignore the error and continue even if the two copies have a difference. That renders the check useless...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, I will drop the continue-on-error setting. I will note that we may have to keep a patch disabling a unittest, assuming the other failing test on Windows is fixed and no longer disabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This practically looks good to me...
#ifdef LLVM_BINARY_DIR | ||
TEST(InterpreterTest, DetectResourceDir) { | ||
#else | ||
|
||
TEST(InterpreterTest, DISABLED_DetectResourceDir) { | ||
#endif // LLVM_BINARY_DIR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I think the binary dir is set but it is not what we expect it to be. I think that's part of the problem that LLVM's build system was not designed to be embedded in another build system...
|
||
#ifdef _WIN32 | ||
GTEST_SKIP() << "Disabled on Windows (Fails with ROOT win-x64)"; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aaronj0, do you remember how this used to fail?
@vgvassilev about your question, here is the error:
|
Any chance to debug this? Maybe it is the way we capture streams? I doubt this is as broken to not run the constructors on windows… |
Sure! I can try to take a look when I find some time for it |
In this case let's leave this pending and move forward with the PR. |
2a58aa5
to
4ee500d
Compare
cd575d7
to
34a36e5
Compare
by linking clangCppInterOp in libCling
34a36e5
to
b8c8476
Compare
b8c8476
to
cc86b50
Compare
CppInterOp exposes API from Clang and LLVM in a mostly backward compatibe way. The API support downstream tools that utilize interactive C++ by using the compiler as a service.
This PR is the first step in using pure clang based reflection API in meta, and part of eventually integrating the JITCall and DynamicLibraryManager infrastructure.
Adopting more of CppInterOp in ROOT will help simplify the LLVM migration process and allow us to upstream more patches to either CppInterOp or LLVM.
TODO: