ninja-build / ninja

a small build system with a focus on speed
https://ninja-build.org/
Apache License 2.0
11.14k stars 1.59k forks source link

deps log recovery (truncate) is performed even in dry run mode #604

Open maximuska opened 11 years ago

maximuska commented 11 years ago

While running 'ninja -n -d explain' got: ninja: warning: premature end of file; recovering

The deps file was truncated, w/o leaving any evidence of what the problem was.

nico commented 11 years ago

Is this a bug though? dry run mode means "don't run any build edges", which didn't happen.

(Also, was this with trunk ninja? Trunk should flush records after they're written.)

maximuska commented 11 years ago

Matter of definition, I guess. What the use-cases for the "dry run" are? In the specific case it would be much better if ninja wouldn't touch the logs, as I could investigate these then.

As for your question, it has happened with ninja based on master with newish fflushes code. ninja always runs till the end uninterrupted in the tests, and I am out of sane ideas for what the problem is, but something is very wrong there. I've now added more logs and assertions to test for ret values of all fwrites/fflushes to debug this (the code still passes the tests;)

I am running this builds with 'ionice' in parallel to my regular activity (but in a completely separate build tree), but I am not sure if this is related.

maximuska commented 11 years ago

(the log corruption is likely explainable by https://github.com/martine/ninja/issues/605)

jonesmz commented 4 years ago

@maximuska Is this bug still reproducible with Ninja 1.10.0?