The build.ninja file generated by ninja has changed and now
include a "ninja_required_version" statement. To keep the
rule to generate the build.ninja file, all the line up to
the third blank line should be kept (this is what "gn clean"
does).
Bug: 830627
Change-Id: I493cc39f484c6da8a0784d9cf2b45337cb4672d3
Reviewed-on: https://chromium-review.googlesource.com/1001902
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549181}
Background: in order to use multiple build directories without the
cognitive or scripting overhead of figuring out which one is currently
in use, I keep a symlink "out/cur" pointing to the current one.
When the clobber script runs, it detects that out/cur is a build
directory (because out/cur/args.gn exists) but shutil.rmtree() fails
when applied to a symlink. This change skips the clobber when a link is
detected and leaves out/cur pointing to the real build dir. There's no
need to remove the symlink, since the original has been clobbered.
Review-Url: https://codereview.chromium.org/2642833002
Cr-Commit-Position: refs/heads/master@{#444777}
If delete_dir or os.mkdir throw an exception then the code to restore
args.gn, build.ninja, and build.ninja.d will not run. This breaks a
design goal of gn which is that the args.gn files should not be
deleted.
The fix is to catch the exception and raise it after the files have
been restored.
To test the code leave chrome.exe or base_unittests.exe running in one
window and run this in another:
python build\clobber.py d:\src\chromium\src\out
Note that if you do this without the patch applied then all args.gn
files may be deleted, so consider backing them up. Also note that
args.gn files won't be restored unless build.ninja and build.ninja.d
files are also present, so back them up.
Just apply the patch first - it's easier.
BUG=612940
Review-Url: https://codereview.chromium.org/1996833002
Cr-Commit-Position: refs/heads/master@{#395177}
For unknown reasons (Windows!) shutil.rmtree has been failing frequently
when the landmines change due to a toolchain change. This avoids the
the problem. This is necessary because manually deleting the 'out'
directory causes args.gn to get lost, which is a hassle.
This was noticed because the VS 2015 toolchain upgrades kept failing
to clobber the out directory on multiple machines.
Review URL: https://codereview.chromium.org/1812673003
Cr-Commit-Position: refs/heads/master@{#382140}
This patch factors clobbering functionality from build/landmines.py
into build/clobber.py (new file). This will allow us to reuse existing
code in the cr tool.
BUG=493023
Review URL: https://codereview.chromium.org/1199933004
Cr-Commit-Position: refs/heads/master@{#335491}