Skip to content

[6.40] [cmake] Make explicit that all dictionaries depend on Core.pcm - #24043

Open
pcanal wants to merge 2 commits into
root-project:v6-40-00-patchesfrom
pcanal:BP_6.40_pull_23207
Open

pcanal wants to merge 2 commits into
root-project:v6-40-00-patchesfrom
pcanal:BP_6.40_pull_23207

Conversation

@pcanal

@pcanal pcanal commented Nov 6, 2026

Copy link
Copy Markdown
Member

guitargeek and others added 2 commits November 6, 2026 21:49
For each entry in DEPENDENCIES, ROOT_GENERATE_DICTIONARY passes rootcling
a `-m <dep>.pcm` flag and a dependency on the dependency's module file, so
that the prebuilt module is loaded instead of being built implicitly. This
was wired up by inspecting the target graph while the macro runs
(`if(NOT TARGET G__${dep})` / `get_target_property(... ROOT_PCM_FILENAME)`),
which only works if <dep> is configured before the dictionaries using it.

That breaks for core/multiproc: libMultiProc depends on Net (via TSocket),
but it lives under core/, configured long before net/. So when G__MultiProc
is generated, G__Net does not exist yet, the dependency is silently dropped,
and rootcling can build Net implicitly, failing with "Building module 'Net'
implicitly ... 'G__MultiProc.cxx' depends on 'Net'". The same shape affects
every dictionary depending on a module configured later (Tree -> Net, ...).

Decide this at generation time instead, when all targets exist: guard the
flag and the module-file dependency with $<TARGET_EXISTS:G__<dep>>. They are
emitted whenever <dep> provides a dictionary and expand to nothing otherwise
(e.g. a plain library such as TBB::tbb), regardless of configuration order.

Closes root-project#21673.

🤖 Problem identified by AI, then the human guided the AI to write the
solution that the human wanted to apply.
By pcanal

They depend on it implicitly and not expressing leads to missing rebuilds as seen at:
root-project#23046

when no ARG_DEPENDENCIES are specified at all

Co-author: FerdyMercury
@pcanal pcanal self-assigned this Nov 6, 2026
@pcanal
pcanal requested a review from bellenot as a code owner November 6, 2026 21:05
@pcanal pcanal changed the title Bp 6.40 pull 23207 [6.40] [cmake] Make explicit that all dictionaries depend on Core.pcm Nov 6, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 15h 24m 38s ⏱️
 3 883 tests  3 882 ✅ 0 💤 1 ❌
81 273 runs  81 268 ✅ 4 💤 1 ❌

For more details on these failures, see this check.

Results for commit d955773.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants