[CMake] Use DEPFILE instead of IMPLICIT_DEPENDS for dictionaries - #23011
Open
guitargeek wants to merge 2 commits into
Open
[CMake] Use DEPFILE instead of IMPLICIT_DEPENDS for dictionaries#23011guitargeek wants to merge 2 commits into
guitargeek wants to merge 2 commits into
Conversation
Re-applying commit ae4d830 after revert in 94caecf. Closes root-project#21203.
Follows up on ae4d830, which switched ROOT_GENERATE_DICTIONARY() from IMPLICIT_DEPENDS to a proper DEPFILE, but rebuilt every dictionary on every incremental build with older Ninja (e.g. 1.8.2 on Alma 8): ```txt ninja: expected depfile '.../io/io/G__RIO.depfile' to mention 'io/io/G__RIO.cxx', got 'G__RIO.cxx' ``` rootcling writes the depfile target as the plain dictionary name it is given (`"G__RIO.cxx"`) relative to CMAKE_CURRENT_BINARY_DIR. ROOT pins `CMP0116` to OLD globally (see 7392b02), and under OLD the Ninja generator consumes the depfile verbatim and expects the target relative to the top-level build directory (`"io/io/G__RIO.cxx"`). The mismatch makes older Ninja treat the dictionary as perpetually out of date; newer Ninja tolerates it, which is why the regression only showed up on some platforms. This commit suggests to enable CMP0116 NEW locally around the dictionary `add_custom_command` so CMake transforms the depfile to whatever the active generator needs.
Test Results 23 files 23 suites 3d 15h 32m 36s ⏱️ Results for commit 3c63d03. |
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.
Re-applying commit ae4d830 after revert in 94caecf.
This PR also contains a follow-up fix to make things work under CMP0116 OLD.
This version was confirmed to not result in spurious dictionary rebuilds on the
alma8Docker container.Closes #21203.