[ios] Fix interaction of build/clobber.py & ios/build/tools/setup-gn.py
The script build/clobber.py tried to parse the build.ninja when clobbering a directory and use it as a template, however if the parsing failed, it generated a broken build.ninja file. The script ios/build/tools/setup-gn.py would create multiple empty build directory with just args.gn and a build.ninja file that would result in invoking `gn gen` as a first step. However, the build.ninja created by setup-gn.py could not be parsed by clobber.py since it did not include minimum required version of ninja command. Also, setup-gn.py did not recreate the file if they existed, even if they were incorrect. All this caused build/clobber.py to sometimes leave a build directory in an unbuildable state requiring the developer to run `gn gen` manually. To fix this, change setup-gn.py to always overwrite build.ninja file, to use a format that can be parsed by clobber.py and fix clobber.py to write a build.ninja file that is valid if parsing fails. Always overwrite the build.ninja file to ensure that `--check` is added to `gn gen` invocation (as locally running `gn gen` without `--check` even once would disable the local check of the deps and later be reported by Chrome iOS developers as a bug). Bug: 1102331 Change-Id: Iabe906ac5f676f1b837c6ebb03ee32d73c7b6cf9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2283143 Auto-Submit: Sylvain Defresne <sdefresne@chromium.org> Reviewed-by:Dirk Pranke <dpranke@google.com> Reviewed-by:
Olivier Robin <olivierrobin@chromium.org> Commit-Queue: Sylvain Defresne <sdefresne@chromium.org> Cr-Commit-Position: refs/heads/master@{#786208}
Showing
Please register or sign in to comment