Skip to content

[cmake] Keep dictionary byproducts newer than the generated .cxx - #23432

Merged
guitargeek merged 1 commit into
root-project:masterfrom
guitargeek:fix-dict-byproduct-mtimes-20907
Sep 21, 2026
Merged

guitargeek merged 1 commit into
root-project:masterfrom
guitargeek:fix-dict-byproduct-mtimes-20907

Conversation

@guitargeek

Copy link
Copy Markdown
Contributor

The Makefile generator models each secondary output of the multi-output dictionary custom command (the _rdict.pcm, the .rootmap, the C++ module) as its own rule ending in 'cmake -E touch_nocreate ', to keep it newer than the primary output, the generated dictionary source. When a dictionary is regenerated through freshly re-scanned dependency information (make's depend/build phase split), those rules are not re-evaluated after the recipe has run: the byproducts stay older than the .cxx until the next build. That next build then fires the deferred touch, which rewrites the byproducts' mtimes in a build that had nothing to do (caught by the CI spurious-rebuild check) and spuriously regenerates every dictionary that consumes them.

Do the touch in the dictionary recipe itself, right after rootcling, so the expected output ordering holds whenever the recipe runs, independent of the generator.

🤖 Done with the help of AI

Closes #20907.

The Makefile generator models each secondary output of the multi-output
dictionary custom command (the _rdict.pcm, the .rootmap, the C++ module)
as its own rule ending in 'cmake -E touch_nocreate <output>', to keep it
newer than the primary output, the generated dictionary source.  When a
dictionary is regenerated through freshly re-scanned dependency
information (make's depend/build phase split), those rules are not
re-evaluated after the recipe has run: the byproducts stay older than the
.cxx until the next build.  That next build then fires the deferred
touch, which rewrites the byproducts' mtimes in a build that had nothing
to do (caught by the CI spurious-rebuild check) and spuriously
regenerates every dictionary that consumes them.

Do the touch in the dictionary recipe itself, right after rootcling, so
the expected output ordering holds whenever the recipe runs, independent
of the generator.

🤖 Done with the help of AI

Closes root-project#20907.
@github-actions

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 15h 48m 11s ⏱️
 3 875 tests  3 870 ✅ 0 💤 5 ❌
80 069 runs  80 060 ✅ 0 💤 9 ❌

For more details on these failures, see this check.

Results for commit 7040810.

@guitargeek
guitargeek merged commit 00a1b3d into root-project:master Sep 21, 2026
34 of 39 checks passed
@guitargeek
guitargeek deleted the fix-dict-byproduct-mtimes-20907 branch September 21, 2026 09:55
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.

Spurious rebuilds in some circunstances

2 participants