New issue
Advanced search Search tips

Issue 662750 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

gn doesn't deterministically write build.ninja

Project Member Reported by thakis@chromium.org, Nov 6 2016

Issue description

1. mkdir out/gn1 && gn gen out/gn1
2. mkdir out/gn2 && gn gen out/gn2
3. gvim -d out/gn1/build.ninja out/gn2/build.ninja

Expected: Files are equal (except for gn1/gn2 mismatches)
Actual: Files have very different line ordering. (In all other .ninja files that gn generates, this doesn't happen).

Having deterministically-generated ninja files is nice for diffing and for build determinism in general.
 
Owner: thakis@chromium.org
Status: Started (was: Untriaged)
https://codereview.chromium.org/2485523002 
Project Member

Comment 2 by bugdroid1@chromium.org, Nov 7 2016

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

commit 8c2865318628b91312ea2bfa065590e3dc4f920a
Author: thakis <thakis@chromium.org>
Date: Mon Nov 07 23:29:28 2016

gn: Make generation of main build.ninja file deterministic.

Follow-up to https://codereview.chromium.org/1494883002/ which either missed
the main build.ninja file, or build.ninja file writing has since gotten
nondetermistic again.

Fixes three cases of nondeterminism in build.ninja:
* Order of pools
* Order of subninjas for each toolchain
* Order of phony targets in build.ninja

BUG= 662750 , 565075 

Review-Url: https://codereview.chromium.org/2485523002
Cr-Commit-Position: refs/heads/master@{#430416}

[modify] https://crrev.com/8c2865318628b91312ea2bfa065590e3dc4f920a/tools/gn/builder.h
[modify] https://crrev.com/8c2865318628b91312ea2bfa065590e3dc4f920a/tools/gn/ninja_build_writer.cc
[modify] https://crrev.com/8c2865318628b91312ea2bfa065590e3dc4f920a/tools/gn/ninja_build_writer.h
[modify] https://crrev.com/8c2865318628b91312ea2bfa065590e3dc4f920a/tools/gn/ninja_build_writer_unittest.cc

Status: Fixed (was: Started)

Sign in to add a comment