Skip to content

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

Draft
guitargeek wants to merge 4 commits intoroot-project:masterfrom
guitargeek:ignoreprefix
Draft

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

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

@guitargeek guitargeek commented Jan 25, 2026

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 << "Source    : " << gROOT->GetSourceDir() << 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
Copy link
Copy Markdown

github-actions bot commented Jan 25, 2026

Test Results

    21 files      21 suites   3d 3h 17m 35s ⏱️
 3 830 tests  3 576 ✅   1 💤 253 ❌
73 059 runs  72 373 ✅ 433 💤 253 ❌

For more details on these failures, see this check.

Results for commit 180ebb0.

♻️ 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
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