New issue
Advanced search Search tips

Issue 612940 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

clobber.py sometimes nukes arg.gn files

Project Member Reported by brucedaw...@chromium.org, May 18 2016

Issue description

If a landmine causes the output directory to be clobbered then clobber.py:clobber is run. This attempts to gently delete directories, without losing the args.gn files. However if delete_dir hits an exception (perhaps because a previously built version of Chrome is running) then the code to restore the args.gn (and build.ninja) files will be skipped.

This is not extremely common but I did hit this and it caused some wasted time as I tried to remember what gn settings I had settled on.

This is especially likely on Windows where running binaries cannot be deleted.
 
yup, looks buggy alright.
Labels: -Proj-GN-Migration
fixing this shouldn't block the migration, though (IMO) ...
Agreed that it shouldn't block migration. Thanks for fixing the tag.
Allow me to lobby as usual for only having outputs in the output dir. :/
Project Member

Comment 5 by bugdroid1@chromium.org, May 20 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/562df4f33e0a29669b83d451d33c81648a9e023e

commit 562df4f33e0a29669b83d451d33c81648a9e023e
Author: brucedawson <brucedawson@chromium.org>
Date: Fri May 20 22:00:46 2016

Fix clobber.py to restore args.gn on failure

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}

[modify] https://crrev.com/562df4f33e0a29669b83d451d33c81648a9e023e/build/clobber.py

Status: Fixed (was: Assigned)

Sign in to add a comment