Skip to content

[RFC] [core] put all headers within ROOT subfolder - #23307

Open
ferdymercury wants to merge 1 commit into
root-project:masterfrom
ferdymercury:hcont
Open

[RFC] [core] put all headers within ROOT subfolder#23307
ferdymercury wants to merge 1 commit into
root-project:masterfrom
ferdymercury:hcont

Conversation

@ferdymercury

@ferdymercury ferdymercury commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

ROOT has 1400 freestanding headers, which is incompatible with Debian packaging (and bad programming practice), since the risk of collision of ROOT headers such as /usr/include/Strlen.h with any other system headers is... well... non-zero. See also #19265
Note that things such as RooFit or RHist / RDF already does things well, is in own subfolder, so no need to also move those into ROOT.

Also fixes (starts to) #16327

This is an experiment: to move all those from core (except deprecated ones) under the ROOT subfolder and implement backward compatibility mechanism so that include paths are correct without changing all source files, only changing CMakeLists.txt is required. This way, the number of headers is not doubled, just the include path mechanism is 'doubled', which is much more manageable than adding 1400 extra files or wrappers.

I opted not to generate any wrapper warnings in headers because it would be superinvasive, everyone in every project in the world would be swamped by it.

In other words: the user is not forced to change anything in the source code. It just allows both variants until ROOT 7.

In ROOT7, one can remove the # bw compatibility lines in the CMakeLists.txt and enforce proper encapsulation everywhere in the codebase. So that will be quite some batch work for ROOT devs, but not necessarily for external users. Note that, even if in ROOT7 we remove all this, we can still suggest the external user to add -Ixxxx/ROOT to his command line or CMake project, that way he won't have to change anything either, so not a big deal either if not wanting to change all headers one by one includes throughout all projects. On the other hand, LLMs could now do this quickly... or even "sed". We could even provide a simple Python script that does that by checking for the 1400 expected names that need fixing.

Before fixing all issues so that the CI passes, I'd first like to ask for opinion about this strategy. Note that this is critical for Debian, so please suggest an alternative if you don't agree to this roadmap.

This is just an example, one could say it's better to move things into ROOT/Core/... or whatever seems reasonable.

Of course, one could say it's much easier to not touch anything on ROOT side and just move everything into /usr/include/ROOT and then have the old headers in /usr/include/ROOT/TCanvas.h and the already-modern headers in /usr/include/ROOT/ROOT/RConfigure.h with the ugly double ROOT folder. Besides it would be a wasted opportunity for working towards #16327

TODO:

  • Implement fixes for root-config --incdirs
  • Implement fixes for RootConfig.cmake
  • ...

ROOT has 1400 freestanding headers, which is incompatible with Debian packaging
Move all these under ROOT subfolder and implement backward compatibility mechanism so that inclue paths are correct without changing all source files.
@ferdymercury ferdymercury added the skip ci Skip the full builds on the actions runners label Sep 9, 2026
@ferdymercury ferdymercury reopened this Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit 33f3d23.

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

Labels

skip ci Skip the full builds on the actions runners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants