New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
graph: always use the on-disk mtime of generator rules #1527
graph: always use the on-disk mtime of generator rules #1527
Conversation
So this should fix #1376, I guess. |
Yes, it should. I suspect there are likely other duplicates of the issue around. |
I have tested the patch and I do not observe anymore the issue #1376. |
Generator rules are likely to have been run outside of ninja, so the build log should not be trusted for detecting whether or not to rerun the rule.
ab5712a
to
29a565f
Compare
This seems to fix issue #1376 for me. |
This fixes the issue for Do you know of a way around this, or should I request a feature for CMake to set custom commands as |
Please open an issue over there (rather than muddying the discussion here), but include your example custom command. Ninja's rules on the |
Update the ninja_log in your custom command. |
I don't know that this is going to be easy. Ninja itself uses the tmpfile-and-rename style, so any command doing this would need to coordinate with ninja on what's going on. This just sounds 100% flaky to me. |
But this shouldn't matter because we're talking about the case where the generator is run outside of ninja, right? |
How is the tool supposed to know if it is inside or outside ninja? Plus, the question asked was for a way to claim |
Pass itself a flag in its build rule for example. |
Maybe if the deplog format were documented and guaranteed to be stable, that route could be taken. Until then, is this a sufficient solution to the problem being seen? |
I would rather add a tool to Ninja (e.g. |
Hmm. That could work. A pipeline like |
Exactly! |
Strawman MR filed for CMake here: https://gitlab.kitware.com/cmake/cmake/merge_requests/3316 |
Closing in favor of #1685. |
Generator rules are likely to have been run outside of ninja, so the
build log should not be trusted for detecting whether or not to rerun
the rule.
Observed with CMake projects which exhibit behavior that
ninja
rerunscmake
right after runningcmake
manually. Maybe it is better to just not add generator rules to the build log at all? I don't know of the implications of that.See https://gitlab.kitware.com/cmake/cmake/issues/15830 for some context.