Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Issue 2152413002: GN: don't write separate files for non-binary targets (Closed)

Created:
4 years, 5 months ago by brettw
Modified:
4 years, 4 months ago
Reviewers:
brucedawson
CC:
chromium-reviews, Dirk Pranke, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

GN: don't write separate files for non-binary targets Binary targets that compile code need to be in separate ninja files for the various flags variables to be properly scoped. But other targets like groups and actions don't. This change skips making separate files for such targets. The target writers have changed to return the code they want written to the main ninja file, which is either all of the code (for the new integrated case) or a subninja line to reference a written file. This allowed some amount of cleanup in how the Ninja toolchain files were written. The changes in the ninja toolchain files required more changes in the NinjaBuildWriter because the lists the NinjaBuildWriter were no longer being generated as a side effect of running. The build writer is now more isolated and can run without such precomputed context. There was a fair bit of refactoring required to make this work in ninja_build_writer.cc. Effectively the complexity in NinjaWriter moved to NinjaBuildWriter::RunAndWriteFiles. A related cleanup is that I noticed the Builder object is RefCountedThreadsafe because it used to be used across threads. But a while ago I changes this to work on the main thread only. I removed the refcounting and changed most places to pass by reference instead of pointer. GN runtime stats: - Desktop Linux: saves 2656 files, 110ms. - Android: saves 8825 files, 231ms. - Windows: saves 2203 files, 247ms. Ninja no-op build stats (measures loading time): - Desktop Linux: same - Android: regressed 50ms (maybe because there's less parsing parallelism and Linux's filesystem is so fast?) - Windows: saves 156ms (because Windows' filesystem is so slow. Committed: https://crrev.com/8293c354da7aee9e9a7130b3b6f67d9ea43a7230 Cr-Commit-Position: refs/heads/master@{#407908}

Patch Set 1 #

Patch Set 2 : WOrk #

Patch Set 3 : compiles #

Patch Set 4 : tests #

Patch Set 5 : Tests pass #

Patch Set 6 : win_test_fixes #

Total comments: 1

Patch Set 7 : typo #

Patch Set 8 : typo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+349 lines, -317 lines) Patch
M tools/gn/builder.h View 1 2 3 3 chunks +4 lines, -6 lines 0 comments Download
M tools/gn/builder_unittest.cc View 1 2 3 9 chunks +16 lines, -16 lines 0 comments Download
M tools/gn/command_check.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M tools/gn/command_gen.cc View 1 2 3 5 chunks +44 lines, -20 lines 0 comments Download
M tools/gn/command_ls.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M tools/gn/command_refs.cc View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M tools/gn/commands.cc View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M tools/gn/eclipse_writer.h View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M tools/gn/eclipse_writer.cc View 1 2 3 5 chunks +5 lines, -5 lines 0 comments Download
M tools/gn/json_project_writer.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M tools/gn/json_project_writer.cc View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M tools/gn/ninja_build_writer.h View 1 2 3 4 2 chunks +22 lines, -17 lines 0 comments Download
M tools/gn/ninja_build_writer.cc View 1 2 3 4 5 chunks +49 lines, -13 lines 0 comments Download
M tools/gn/ninja_build_writer_unittest.cc View 1 2 3 4 5 3 chunks +40 lines, -29 lines 0 comments Download
M tools/gn/ninja_target_writer.h View 1 2 3 4 5 6 1 chunk +8 lines, -1 line 0 comments Download
M tools/gn/ninja_target_writer.cc View 1 chunk +49 lines, -17 lines 0 comments Download
M tools/gn/ninja_toolchain_writer.h View 1 3 chunks +6 lines, -7 lines 0 comments Download
M tools/gn/ninja_toolchain_writer.cc View 1 2 4 chunks +17 lines, -32 lines 0 comments Download
M tools/gn/ninja_toolchain_writer_unittest.cc View 1 2 3 1 chunk +1 line, -7 lines 0 comments Download
M tools/gn/ninja_writer.h View 1 2 3 2 chunks +18 lines, -20 lines 0 comments Download
M tools/gn/ninja_writer.cc View 1 2 3 1 chunk +15 lines, -88 lines 0 comments Download
M tools/gn/qt_creator_writer.h View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M tools/gn/qt_creator_writer.cc View 1 2 3 4 chunks +4 lines, -4 lines 0 comments Download
M tools/gn/settings.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M tools/gn/setup.h View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M tools/gn/setup.cc View 1 2 3 4 5 chunks +10 lines, -7 lines 0 comments Download
M tools/gn/toolchain.h View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M tools/gn/visual_studio_writer.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M tools/gn/visual_studio_writer.cc View 1 2 3 3 chunks +4 lines, -4 lines 0 comments Download
M tools/gn/xcode_writer.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M tools/gn/xcode_writer.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 34 (25 generated)
brettw
compiles
4 years, 5 months ago (2016-07-19 16:31:12 UTC) #1
brettw
tests
4 years, 5 months ago (2016-07-19 19:50:45 UTC) #2
brettw
win_test_fixes
4 years, 5 months ago (2016-07-20 17:47:53 UTC) #13
brettw
Low priority (doesn't affect GN transition). Over the no-meetings week I finished up this patch ...
4 years, 5 months ago (2016-07-20 18:00:03 UTC) #17
brucedawson
It might have been better to separate the reference-count change from the other change to ...
4 years, 5 months ago (2016-07-25 17:38:00 UTC) #20
brettw
typo
4 years, 4 months ago (2016-07-26 17:52:23 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2152413002/140001
4 years, 4 months ago (2016-07-26 20:32:47 UTC) #30
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 4 months ago (2016-07-26 20:38:52 UTC) #32
commit-bot: I haz the power
4 years, 4 months ago (2016-07-26 20:40:46 UTC) #34
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/8293c354da7aee9e9a7130b3b6f67d9ea43a7230
Cr-Commit-Position: refs/heads/master@{#407908}

Powered by Google App Engine
This is Rietveld 408576698