Skip to content
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

[interop] Fix build errors with -Dtesting=off #17791

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aaronj0
Copy link
Contributor

@aaronj0 aaronj0 commented Feb 21, 2025

This was due to a bug in CppInterOp where option(CPPINTEROP_ENABLE_TESTING "Enables the testing infrastructure." BOOL)
was defined twice conditionally. This is incorrect and does not allow users to override the option, leading to testing always being on. Fixed with compiler-research/CppInterOp#506

This also requires ROOT to set the same flag in the interpreter CMake (which did not work earlier due to the underlying bug in InterOp)

cc @bellenot

@@ -59,6 +59,7 @@ set(CMAKE_CXX_EXTENSIONS NO)
include(GNUInstallDirs)
option(CPPINTEROP_USE_CLING "Use Cling as backend" OFF)
option(CPPINTEROP_USE_REPL "Use clang-repl as backend" ON)
option(CPPINTEROP_ENABLE_TESTING "Enable the CppInterOp testing infrastructure." ON)
Copy link
Member

@bellenot bellenot Feb 21, 2025

Choose a reason for hiding this comment

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

Wrong place, you set set(CPPINTEROP_ENABLE_TESTING OFF) in interpreter/CMakeLists.txt but add the option here... Please take a look at my diff again

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These options are meant to live inside CppInterOp. See CPPINTEROP_USE_CLING. We configure them from within the Interpreter CMake that propagates the flags to InterOp.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We cannot define the option in ROOT, since InterOp is also a standalone library.

Copy link
Member

Choose a reason for hiding this comment

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

Well, anyway, you cannot set a value before defining it...

@@ -525,4 +525,9 @@ set(CPPINTEROP_INCLUDE_DIRS
#---Set InterOp to build on Cling, this can be toggled to use Clang-REPL-------------------------------------------------------
set(CPPINTEROP_USE_CLING ON BOOL "Use Cling as backend")

#---Disable testing on InterOp if ROOT's testing is OFF (InterOp tests are enabled by default) -------------------------------------------------------
if(NOT testing)
set(CPPINTEROP_ENABLE_TESTING OFF)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
set(CPPINTEROP_ENABLE_TESTING OFF)
set(CPPINTEROP_ENABLE_TESTING OFF)

Copy link
Member

Choose a reason for hiding this comment

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

Don’t we just need set in the cache with force?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that is how we do it for LLVM. Updated with the same

Copy link

github-actions bot commented Feb 21, 2025

Test Results

    15 files      15 suites   3d 19h 20m 58s ⏱️
 2 685 tests  2 685 ✅ 0 💤 0 ❌
39 704 runs  39 704 ✅ 0 💤 0 ❌

Results for commit 463c909.

♻️ This comment has been updated with latest results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants