Skip to content

[roottest] Use interpreter in reading step of TFile::MakeProject tests#21081

Closed
guitargeek wants to merge 1 commit intoroot-project:masterfrom
guitargeek:issue-21076
Closed

[roottest] Use interpreter in reading step of TFile::MakeProject tests#21081
guitargeek wants to merge 1 commit intoroot-project:masterfrom
guitargeek:issue-21076

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

The reading part of the TFile::MakeProject tests were a bit brittle, because the CMake build system linked against shareded libraries that are produced at runtime by ROOT with MakeProject.

That caused some problems, like:

  1. The automatic RPATH that is set by CMake didn't work on macOS, forcing us to set DYLD_LIBRARY_PATH.
  2. A linker optimization issue on Windows (see 0ecab8e), which had to be worked around.

To avoid these workarounds, this commit suggests to use the auto-generated libraries as they are usually used also by our users: dynamically by the interpreter at runtime.

Closes #21076 by avoiding overwriting the existing LD_LIBRARY_PATH.

The reading part of the `TFile::MakeProject` tests were a bit brittle,
because the CMake build system linked against shareded libraries that
are produced at runtime by ROOT with `MakeProject`.

That caused some problems, like:

  1. The automatic RPATH that is set by CMake didn't work on macOS,
     forcing us to set `DYLD_LIBRARY_PATH`.
  2. A linker optimization issue on Windows (see 0ecab8e), which
     had to be worked around.

To avoid these workarounds, this commit suggests to use the
auto-generated libraries as they are usually used also by our users:
dynamically by the interpreter at runtime.

Closes root-project#21076 by avoiding overwriting the existing `LD_LIBRARY_PATH`.
Copy link
Copy Markdown
Member

@dpiparo dpiparo left a comment

Choose a reason for hiding this comment

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

thanks for these changes


const auto &event = viewEvent(0);
// Get values out as plain STL types
auto event_foo = interpreter_get<std::bitset<16>>("&event.foo");
Copy link
Copy Markdown
Member

@pcanal pcanal Jan 30, 2026

Choose a reason for hiding this comment

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

This is cumbersome and thus once has to wonder whether we would be 'better' serve by switching from an executable to a script ... I suspect that the down side is to have to 'replace' the EXPECT_EQ macro (or maybe gtest works 'fine' in a script?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That would also be a good solution! There are many options and we'll discuss next week what to do

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That would also be a good solution! There are many options and we'll discuss next week what to do

Copy link
Copy Markdown
Member

@vepadulano vepadulano left a comment

Choose a reason for hiding this comment

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

I discussed this PR on mattermost with @guitargeek . I see the issue it's trying to solve but I do not believe this is the right direction. In general, we cannot assume what way the users may want to use the library produced by MakeProject. If anything we should support all modes of operation (C++ programs, C++ macros, Python scripts). I believe #21083 goes in a better direction, although it is still not ready to be merged. I'm also trying things out myself locally, will give updates in case I find any better way.

@github-actions
Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 14h 52m 26s ⏱️
 3 775 tests  3 775 ✅ 0 💤 0 ❌
75 079 runs  75 079 ✅ 0 💤 0 ❌

Results for commit c25ce65.

@guitargeek
Copy link
Copy Markdown
Contributor Author

Superseded by #21097

@guitargeek guitargeek closed this Feb 2, 2026
@guitargeek guitargeek deleted the issue-21076 branch February 2, 2026 10:04
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.

Tests: roottest-root-ntuple-makeproject-ttree-read_ttree, roottest-root-ntuple-makeproject-rntuple-read_rntuple failing to find libtbb.so

4 participants