Revisiting the semantics of phony

60 views
Skip to first unread message

RJ Ascani

unread,
May 1, 2021, 3:47:07 PMMay 1
to ninja-build
Hi ninja-dev,

According to the ninja manual, the phony rule [1] can be used to create aliases for other targets. However, ninja does not currently consider the outputs of a phony edge to be dirty if the edge's inputs have been modified. This appears to have come up a few times over the years in discussion [2] and pull requests [3, 4], but no fix has been merged.

Would such a change still be possible? I think it is a reasonable expectation of the user for targets that depend on a phony target to be rebuilt if one of the phony target's inputs is modified, but obviously this behavior has existed in ninja for a long time now. I've uploaded a new PR [5] that rebases to the latest and addresses some of the outstanding feedback on the last attempt, but I'd also like to solicit from the community whether this might break any existing uses.


Thanks!
-RJ

Scott Graham

unread,
May 6, 2021, 3:47:28 PMMay 6
to RJ Ascani, ninja-build
This seems to make sense to me, given mixing of phonys with files. Any reason we shouldn't try merging 1964?

--
You received this message because you are subscribed to the Google Groups "ninja-build" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ninja-build...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ninja-build/695573c6-dc22-4580-8100-0cd029c64b03n%40googlegroups.com.

RJ Ascani

unread,
Oct 1, 2021, 1:36:53 PMOct 1
to ninja-build
Hello everyone,

The PR to set output mtime of phony edges to the latest inputs[1] has now been merged. Please test with this change and let us know if any phony use cases break.

Thank you,
-RJ

Reply all
Reply to author
Forward
0 new messages