New issue
Advanced search Search tips

Issue 782274 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 406237
Owner: ----
Closed: Nov 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

If you cancel during ninja “[0/1] Regenerating ninja files”, ninja is broken until running “gn gen” again

Project Member Reported by mark@chromium.org, Nov 7 2017

Issue description

What steps will reproduce the problem?
(1) (with an already-configured and generated “out” directory:)
(2) Run ninja -C out/whatever
(3) Think “oops, I forgot something!”
(4) While looking at “[0/1] Regenerating ninja files”, press control-C or use your favorite method of interruption
(5) You’ll see “ninja: error: rebuilding 'build.ninja': interrupted by user”
(6) Do whatever other thing you meant to do before running ninja
(7) Run ninja -C out/whatever again

What is the expected result?
Ninja files should be regenerated, and the build should begin

What happens instead?
ninja: Entering directory `out/whatever'
ninja: error: loading 'build.ninja': No such file or directory

This is annoying, because *usually* ninja can just trigger regeneration on its own, but not if it was interrupted during regeneration. After an initial “gn gen,” I’m accustomed to only having to interact with an “out” directory by running the ninja command. Having ninja instead spit an error back is a surprising slap.

Suggestion:

During generation, (safely) replace build.ninja with a very small, very simple build.ninja that only knows how to properly generate the ninja build. This would probably the first 10 lines of build.ninja. If you leave that file there during generation, then even if generation is interrupted or fails, “ninja -C out/whatever” will re-attempt generation the next time it’s run.
 
Mergedinto: 406237
Status: Duplicate (was: Untriaged)
Yup :).

Sign in to add a comment