Skip to content

Fix ROOT dictionary autoload header paths in views - #228

Merged
tmadlener merged 6 commits into
masterfrom
fix-root-dict-autoload-header-paths
Oct 5, 2026
Merged

tmadlener merged 6 commits into
masterfrom
fix-root-dict-autoload-header-paths

Conversation

@jmcarcell

@jmcarcell jmcarcell commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

LCIO's ROOT dictionaries currently record source-tree relative header paths such as include/IMPL/LCCollectionVec.h. Installed views expose <view>/include through ROOT_INCLUDE_PATH, so ROOT cannot resolve those
paths and import pyLCIO fails when the Python ownership decorators access LCCollectionVec::addElement.

Normalize dictionary header paths relative to ROOT_DICT_INCLUDE_DIRS before passing them to rootcint. Keep LinkDef defined_in pragmas and CMake dependencies on the original absolute paths, because rootcint uses them
to generate class registrations.

BEGINRELEASENOTES

  • Fix LCIO ROOT dictionary header paths so pyLCIO can autoload installed classes.
  • Use ROOT_INCLUDE_PATH instead of CPATH for the local tests

ENDRELEASENOTES

Issue uncovered by iLCSoft/LCIO#226. Importing pyLCIO in a view without include/IMPL in ROOT_INCLUDE_PATH fails:

...
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
   Missing FileEntry for include/UTIL/LCTime.h
   requested to autoload type UTIL::LCTime
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
   Missing FileEntry for include/UTIL/PIDHandler.h
   requested to autoload type UTIL::PIDHandler
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
   Missing FileEntry for include/UTIL/PIDHandler.h
   requested to autoload type UTIL::UnknownAlgorithm
Error in <TClass::LoadClassInfo>: no interpreter information for class EVENT::LCEvent is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class EVENT::LCEvent is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class lcrtrel::LCRTRelations is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class lcrtrel::LCRTRelations is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class lcrtrel::LCRTRelations is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class EVENT::LCObject is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class EVENT::LCObject is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class EVENT::CalorimeterHit is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class EVENT::CalorimeterHit is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class EVENT::Cluster is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class EVENT::Cluster is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class EVENT::RawCalorimeterHit is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class EVENT::RawCalorimeterHit is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class EVENT::ReconstructedParticle is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class EVENT::ReconstructedParticle is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class EVENT::SimCalorimeterHit is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class EVENT::SimCalorimeterHit is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class EVENT::SimTrackerHit is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class EVENT::SimTrackerHit is available even though it has a TClass initialization routine.
Error in <TClass::LoadClassInfo>: no interpreter information for class EVENT::SimTrackerHit is available even though it has a TClass initialization routine.
input_line_44:2:10: error: incomplete type 'EVENT::SimTrackerHit' named in nested name specifier
 &EVENT::SimTrackerHit::BITOverlay;

@tmadlener tmadlener left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wondering whether we could solve at least some of these issues by not re-implementing half of the root dictionary generation here, but rather using the one that comes with ROOT now.

CI seems to have been happy before as well. Did we not catch this due to not testing the env / stack where this happens, or because we have no test for this at all?

@jmcarcell

Copy link
Copy Markdown
Contributor Author

I reproduced in #229 by removing CPATH, this PR also removes CPATH from the test environment and fixes it as CI is passing. So the answer was that the environment that we were using in LCIO is a bit special with a CPATH pointing to the includes which is hiding the issue. LCG stacks do not set CPATH.

Wondering whether we could solve at least some of these issues by not re-implementing half of the root dictionary generation here, but rather using the one that comes with ROOT now.

Many things could be changed in iLCSoft packages related to CMake, targets, etc. I don't mind, not sure if it's worth it and maybe then you can not support the old ROOT versions that are in CI like now.

@tmadlener

Copy link
Copy Markdown
Contributor

Should the setup.sh script that is sourced be fixed rather than the workflow definitions? As far as I can see that should be possible, right?

@jmcarcell

jmcarcell commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor Author

I thought I had done that but apparently not, there are many possible failures 🤯
#229 proves that some workflows fail without CPATH, reproducing the issue on Alma 9 (sw-nightlies.hsf.org...)
5ab85c3 (this PR) proves that the Key4hep nightlies on Alma 9 (LCG) are fixed with this PR (what we want). Ubuntu 24 nightlies don't have this problem because CPATH is being set by Spack: https://github.com/spack/spack-packages/blob/develop/repos/spack_repo/builtin/packages/lcio/package.py#L135
cec7452 (this PR) fixes it locally, since some include is needed, nightlies don't fail because they set ROOT_INCLUDE_PATH. One of the two is needed locally, and ROOT_INCLUDE_PATH is more restrictive than CPATH so it should be preferred.

@tmadlener

Copy link
Copy Markdown
Contributor

Closing and re-opening just to re-trigger CI to see if things are still working today.

@tmadlener tmadlener closed this Oct 5, 2026
@tmadlener tmadlener reopened this Oct 5, 2026
@tmadlener
tmadlener enabled auto-merge (squash) October 5, 2026 19:12
@tmadlener
tmadlener merged commit 1e73ff5 into master Oct 5, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants