Skip to content

[core] Use automatic build tree detection for all resource directories#21018

Open
guitargeek wants to merge 3 commits into
root-project:masterfrom
guitargeek:ignoreprefix
Open

[core] Use automatic build tree detection for all resource directories#21018
guitargeek wants to merge 3 commits into
root-project:masterfrom
guitargeek:ignoreprefix

Conversation

@guitargeek

@guitargeek guitargeek commented Jan 25, 2026

Copy link
Copy Markdown
Contributor

This follows up on a5b1ed9, using the mechanism to automatically detect if we are in the build tree or install tree also for the other resource directories (so far it was only implemented for the include directory as a first test).

Several fallbacks and hacks can be removed because of this change, like the ROOTIGNOREPREFIX variable that was needed to run ROOT in the build tree for the tests.

This change also makes ROOT completely independent of the ROOTSYS environment variable and therefore unblocks #20006.

If one wants to check that all the resource directories (inlcuding RootSys()) are correct, one can use this check:

void checkdirs() {

    std::cout << "Bin       : " << gROOT->GetBinDir() << std::endl;
    std::cout << "Data      : " << gROOT->GetDataDir() << std::endl;
    std::cout << "Doc       : " << gROOT->GetDocDir() << std::endl;
    std::cout << "Etc       : " << gROOT->GetEtcDir() << std::endl;
    std::cout << "Icon      : " << gROOT->GetIconPath() << std::endl;
    std::cout << "Include   : " << gROOT->GetIncludeDir() << std::endl;
    std::cout << "Lib       : " << gROOT->GetLibDir() << std::endl;
    std::cout << "Macro     : " << gROOT->GetMacroDir() << std::endl;
    std::cout << "RootSys   : " << gROOT->GetRootSys() << std::endl;
    std::cout << "SharedLib : " << gROOT->GetSharedLibDir() << std::endl;
    std::cout << "TTFFont   : " << gROOT->GetTTFFontDir() << std::endl;
    std::cout << "Tutorial  : " << gROOT->GetTutorialDir() << std::endl;
}

@guitargeek guitargeek self-assigned this Jan 25, 2026
@guitargeek guitargeek requested a review from pcanal as a code owner January 25, 2026 15:04
@guitargeek guitargeek added in:Core Libraries clean build Ask CI to do non-incremental build on PR labels Jan 25, 2026
@guitargeek guitargeek force-pushed the ignoreprefix branch 3 times, most recently from 82f684f to 5bd24d2 Compare January 25, 2026 17:40
@guitargeek guitargeek requested a review from couet as a code owner January 25, 2026 17:40
@github-actions

github-actions Bot commented Jan 25, 2026

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 11h 10m 7s ⏱️
 3 849 tests  3 848 ✅  1 💤 0 ❌
76 007 runs  75 989 ✅ 18 💤 0 ❌

Results for commit 6c6dee9.

♻️ This comment has been updated with latest results.

@guitargeek guitargeek marked this pull request as draft January 26, 2026 08:51
@guitargeek guitargeek force-pushed the ignoreprefix branch 2 times, most recently from 9658e4c to e3a4c50 Compare January 26, 2026 15:54
Comment thread core/base/src/TSystem.cxx Outdated
@vepadulano

Copy link
Copy Markdown
Member

https://github.com/root-project/root/actions/runs/21481040637/job/61888781030?pr=21018#step:7:18 This error probably means that ROOT cannot even start and the process segfaults.

@guitargeek

Copy link
Copy Markdown
Contributor Author

https://github.com/root-project/root/actions/runs/21481040637/job/61888781030?pr=21018#step:7:18 This error probably means that ROOT cannot even start and the process segfaults.

This is fixed by that PR:

@guitargeek guitargeek force-pushed the ignoreprefix branch 2 times, most recently from 84ea7d7 to 160e5f1 Compare March 2, 2026 10:52
@guitargeek guitargeek force-pushed the ignoreprefix branch 2 times, most recently from 000a6bd to 180ebb0 Compare April 18, 2026 14:17
@guitargeek guitargeek force-pushed the ignoreprefix branch 5 times, most recently from 489b683 to 6c6dee9 Compare April 26, 2026 20:59
@guitargeek guitargeek marked this pull request as ready for review April 27, 2026 07:49
This is to test that ROOT doesn't get confused at build and test time by
the fact that the structure of the install tree and build tree is
different, which is the case for `gnuinstall=ON`.
This follows up on a5b1ed9, using the mechanism to automatically
detect if we are in the build tree or install tree also for the other
resource directories (so far it was only implemented for the `include`
directory as a first test).

Several fallbacks and hacks can be removed because of this change, like
the `ROOTIGNOREPREFIX` variable that was needed to run ROOT in the build
tree for the tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-python-wheels Run the workflow to build Python wheels clean build Ask CI to do non-incremental build on PR in:Build System in:Core Libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants