New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 757035 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

gn clean is broken

Project Member Reported by dpranke@chromium.org, Aug 18 2017

Issue description

% gn gen out/Default
% gn clean out/Default
% ninja -C out/Default
ninja: Entering directory `out/default'
ninja: no work to do.
% ninja -C out/default gn
ninja: Entering directory `out/default'
ninja: error: unknown target 'gn'
%

The build.ninja file is being incorrectly preserved when we clean the rest of the files.
I think this broke when we added the ninja_required_version rule.

 
Owner: dpranke@chromium.org
Status: Started (was: Untriaged)
Project Member

Comment 2 by bugdroid1@chromium.org, Aug 18 2017

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

commit 7a152fc8b6727dfbf1616043f314d99079605e45
Author: Dirk Pranke <dpranke@chromium.org>
Date: Fri Aug 18 21:08:57 2017

Fix `gn clean`.

The way `gn clean` preserves enough of the toplevel build.ninja
file in order to be able to recreate itself is kind of hacky; it
looks for a certain number of blank lines and then discards the
rest. When we added the `ninja_required_version` field to the
file, that added a blank line, but we didn't bump the number of
blank lines to look for by one. This meant that we discarded
the rule that would actually regenerate ninja.

As a result, `gn clean` would break ninja's ability to regenerate
the file. This CL fixes that.

R: brettw@chromium.org
Bug:  757035 
Change-Id: Ie200c5705d93a9327741f52b194a35c31b66ecce
Reviewed-on: https://chromium-review.googlesource.com/621589
Reviewed-by: Brett Wilson <brettw@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495682}
[modify] https://crrev.com/7a152fc8b6727dfbf1616043f314d99079605e45/tools/gn/command_clean.cc

Status: Fixed (was: Started)
This was fixed.

Sign in to add a comment