martine/ninja — pull request #516 by riannucci (2013-03-13 05:07:23+00:00)
Title: Prevent redundant in-edges on a rule.

This is a 'fix' for the issue brought up here: https://groups.google.com/forum/?fromgroups=#!topic/ninja-build/CNqaIwlTgVo

The minified version of the repro:
```
pool compile
depth = 1
rule gen_foo
command = touch foo.cpp
rule echo
command = echo $out > $out
build foo.cpp.obj: echo foo.cpp || foo.cpp
pool = compile
build libfoo.a: echo foo.cpp.obj
build foo.cpp: gen_foo
build all: phony libfoo.a
```

Will now result in the error:
```
ninja: error: build.ninja:7: redundant dependency 'foo.cpp'
build foo.cpp.obj: cat foo.cpp || foo.cpp
^ near here
```

I generated recent chromium/ninja build manifests, and they also have this error :unamused:.

I'm wondering if an Error is too harsh, if a warning+ignore edge with a flag to make it an error would be better instead?

Alternately, I could fall back to one of the other 'silent ignore' strategies.