[RFC] [core] put all headers within ROOT subfolder - #23307
Open
ferdymercury wants to merge 1 commit into
Open
Conversation
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.
Test Results0 tests 0 ✅ 0s ⏱️ Results for commit 33f3d23. ♻️ This comment has been updated with latest results. |
ferdymercury
marked this pull request as ready for review
September 9, 2026 08:26
ferdymercury
requested review from
bellenot,
dpiparo,
hageboeck and
pcanal
as code owners
September 9, 2026 08:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 compatibilitylines 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/ROOTand then have the old headers in/usr/include/ROOT/TCanvas.hand the already-modern headers in/usr/include/ROOT/ROOT/RConfigure.hwith the ugly double ROOT folder. Besides it would be a wasted opportunity for working towards #16327TODO: