ninja build file regeneration doesn't work in some cases w/ GN built after r392491 |
||
Issue descriptionregenerating build files is currently broken with a tip-of-tree GN (one containing r392491). do this: % gn gen out/foo % ninja -C out/foo gn % mkdir out/bar % echo "is_debug=false" > out/bar/args.gn % out/foo/gn gen out/bar % touch out/bar/args.gn % ninja -C out/bar -d explain build.ninja ninja: Entering directory `out/bar' ninja explain: output build.ninja older than most recent input /media/src/src/c/src/out/bar/args.gn (1463108607 vs 1463108615) [1/1] Regenerating ninja files ninja explain: output build.ninja older than most recent input /media/src/src/c/src/out/bar/args.gn (1463108607 vs 1463108615) [1/1] Regenerating ninja files ninja explain: output build.ninja older than most recent input /media/src/src/c/src/out/bar/args.gn (1463108607 vs 1463108615) [1/1] Regenerating ninja files ^C % (or some such ... the ninja regeneration loops indefinitely until it gives up). The problem is in https://code.google.com/p/chromium/codesearch?q=ninja_build_writer.cc#chromium/src/tools/gn/ninja_build_writer.cc&l=176 By changing from unconditionally writing build.ninja to WriteFileIfChanged(), we don't update build.ninja when one of the dependencies is out of date. this means that build.ninja will always be out of date (args.gn doesn't actually matter in the example above, it could be any build file). This is the reason the roll failed in https://codereview.chromium.org/1966613002/ Since nothing is using ToT GN yet, I'll leave the faulty CL in for now and leave the fix as an exercise to the reader, but we should fix this tomorrow so we're not blocked and can get the other fixes rolled.
,
May 13 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/94b0b56868bb971253dc8f30b0b6aa3a846e70a4 commit 94b0b56868bb971253dc8f30b0b6aa3a846e70a4 Author: brettw <brettw@chromium.org> Date: Fri May 13 18:41:03 2016 GN: Unconditionally write build.ninja. I previously changed this to WriteFileIfChanged which tends to be faster, especially on Windows. But Ninja's build dependency tracking expects the timestamp of this file to be updated whenever any build input has been modified. BUG= 611633 Review-Url: https://codereview.chromium.org/1981443002 Cr-Commit-Position: refs/heads/master@{#393591} [modify] https://crrev.com/94b0b56868bb971253dc8f30b0b6aa3a846e70a4/tools/gn/ninja_build_writer.cc
,
May 17 2016
|
||
►
Sign in to add a comment |
||
Comment 1 by brettw@chromium.org
, May 13 2016