phony is infamous for being poorly defined. It's been mentioned here a few times. I agree this is a bug, and should be fixed, as I can't see an advantage of the current implementation.
The reason why this happens is because phony is implemented in an odd way. Last time I looked, Ninja internally uses timestamp 0 as an indicator that a file does does not exist, but also reuses the same timestamp field to track the latest transitive dependency timestamp. Thus the updated foo.txt timestamp has no effect.
I reported this bug 2 1/2 years ago, and submitted a pull request with unit tests, but it's still unfixed https://github.com/martine/ninja/pull/634. Ninja core needs to be refactored to avoid reusing the timestamp field for multiple purposes, but no updates to core ninja have been made in years.
From my perspective, whilst nico does an excellent job with many issues, it feels that the only ninja core issues that get addressed are those affecting Chromium. The majority of my pull requests and bug reports are still open, after 3 years. IMHO, this project needs to clean up the pull request & bug list. The project might benefit from adding a second maintainer who isn't on the Google Chrome or Chromium team.
Richard
--
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.
For more options, visit https://groups.google.com/d/optout.
1. output edge does not exist, inputs are not real
2. output edge does not exist, no inputs
3. output edge does not exist, inputs are real, newest mtime is M
4. output edge is real, inputs are not real
5. output edge is real, no inputs
6. output edge is real, inputs are real, newest mtime is M
Expected results :
1. Edge is marked as clean, mtime is newest mtime of dependents.
Touching inputs will cause dependents to rebuild.
2. Edge is marked as dirty, causing dependent edges to always rebuild
3. Edge is marked as clean, mtime is newest mtime of dependents.
Touching inputs will cause dependents to rebuild.
4. Edge is marked as clean, mtime is newest mtime of dependents.
Touching inputs will cause dependents to rebuild.
5. Edge is marked as dirty, causing dependent edges to always rebuild
6. Edge is marked as clean, mtime is newest mtime of dependents.
Touching inputs will cause dependents to rebuild.
phony
can also be used to create dummy targets for files which may not exist at build time."? I don't understand the use. Does this correspond to the points 4, 5 and 6?phony is infamous for being poorly defined. It's been mentioned here a few times. I agree this is a bug, and should be fixed, as I can't see an advantage of the current implementation.
The reason why this happens is because phony is implemented in an odd way. Last time I looked, Ninja internally uses timestamp 0 as an indicator that a file does does not exist, but also reuses the same timestamp field to track the latest transitive dependency timestamp. Thus the updated foo.txt timestamp has no effect.
I reported this bug 2 1/2 years ago, and submitted a pull request with unit tests, but it's still unfixed https://github.com/martine/ninja/pull/634. Ninja core needs to be refactored to avoid reusing the timestamp field for multiple purposes, but no updates to core ninja have been made in years.
From my perspective, whilst nico does an excellent job with many issues, it feels that the only ninja core issues that get addressed are those affecting Chromium. The majority of my pull requests and bug reports are still open, after 3 years. IMHO, this project needs to clean up the pull request & bug list.
In Make the ".PHONY" attribute is on the file (Node in Ninja terms),
while in Ninja I made it a special edge type for reasons I don't even
remember. Looking at the commit history it looks like I first
implemented by hand (just a "rule phony" block) and then discovered
the various reasons you need to special-case it.
rule phony
phony = 1
rule command
command = $cmd
phony = 1
build test: command
cmd = run-tests