Skip to content

Conversation

@hageboeck
Copy link
Member

@hageboeck hageboeck commented Jan 9, 2026

This follows up on 3161321, where LD_LIBRARY_PATH was removed from roottest.

It cannot be removed without replacement for tests that compile macros. Either LD_LIBRARY_PATH or RUNPATH is needed for those: When ROOT is installed in the system, or when an LD_LIBRARY_PATH is set such that a different ROOT installation is visible, compiled macros can fail. The sequence of events is as follows:

  • roottest compiles a macro into an .so
  • In a subsequent test, that .so is loaded.
  • The dynamic loader will try to load the dependencies of that .so, e.g. libROOTVecOps.so, libCore.so, ... Given that the library being opened (the .so resulting from the macro) doesn't have any RUNPATHs set, the ROOT libraries it depends on are searched for first in LD_LIBRARY_PATH and then in the system.
  • If a library of another ROOT is found in one of those two locations, the whole chain of library loads starts, opening all ROOT libraries that the last library found depends on, loading e.g. /usr/lib64/libCore.so and similar. This will provoke a lot of warnings, because TClassTable is already populated, and potentially crashes the program.

Therefore, in this PR, a RUNPATH is added for ACLiC libraries on Linux and Mac. TSystem::GetMakeSharedLib() by default now contains $RPath, which gets expanded to -Wl,-rpath,<ROOT library path>.

Copy link
Contributor

@guitargeek guitargeek left a comment

Choose a reason for hiding this comment

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

LGTM! It would just be nice to add some comment avoid the a possible more future-proof solution as a TODO, so we maybe attract effort to implement RUNPATH embedding in ACLiC.

@hageboeck hageboeck force-pushed the roottest-LD_LIBRARY_PATH branch from 25229a7 to 6e2dcc0 Compare January 9, 2026 17:19
@github-actions
Copy link

github-actions bot commented Jan 9, 2026

Test Results

    23 files      23 suites   4d 4h 20m 10s ⏱️
 3 816 tests  3 816 ✅ 0 💤 0 ❌
80 418 runs  80 418 ✅ 0 💤 0 ❌

Results for commit 7f5bc86.

♻️ This comment has been updated with latest results.

@hageboeck hageboeck force-pushed the roottest-LD_LIBRARY_PATH branch from 6e2dcc0 to abd03e1 Compare January 12, 2026 12:52
@hageboeck hageboeck changed the title [roottest] Re-introduce LD_LIBRARY_PATH to macro tests. Introduce a RUNPATH for compiled macros. Jan 12, 2026
With the previous commit, users have control over whether an rpath is
added or not, so the unconditial addition of an rpath can be replaced
with the placeholder.
@hageboeck hageboeck marked this pull request as ready for review January 15, 2026 16:42
@hageboeck hageboeck requested a review from vepadulano January 15, 2026 16:44
@hageboeck
Copy link
Member Author

LGTM! It would just be nice to add some comment avoid the a possible more future-proof solution as a TODO, so we maybe attract effort to implement RUNPATH embedding in ACLiC.

In fact, that what I did now. 🙂

@hageboeck hageboeck requested a review from guitargeek January 15, 2026 16:50
Copy link
Contributor

@guitargeek guitargeek left a comment

Choose a reason for hiding this comment

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

Thank you very much, awesome!

It's definitely also a step in the right direction because it unifies macOS and Linux behavior, and synchronizes root-config --libs and gSystem->GetMakeSharedLib().

Copy link
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.

LGTM, remember to squash the second commit before merging.

@hageboeck hageboeck merged commit f789e55 into root-project:master Jan 16, 2026
56 of 58 checks passed
@hageboeck hageboeck deleted the roottest-LD_LIBRARY_PATH branch January 16, 2026 13:25
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.

4 participants