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

Issue 2394163004: GN: Check if targets with precompiled headers use unsupported toolchains. (Closed)

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

Description

GN: Check if targets with precompiled headers use unsupported toolchains. A target with a precompiled header needs a toolchain which sets precompiled_header_type in the tool()s used by the target. In the past, having precompiled_header_type unset led to broken Ninja files being generated, now an error is raised after the target is resolved. BUG=649899

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+95 lines, -22 lines) Patch
M tools/gn/ninja_binary_target_writer.h View 1 chunk +0 lines, -2 lines 0 comments Download
M tools/gn/ninja_binary_target_writer.cc View 2 chunks +1 line, -20 lines 0 comments Download
M tools/gn/source_file_type.h View 1 chunk +15 lines, -0 lines 0 comments Download
M tools/gn/target.h View 1 chunk +1 line, -0 lines 0 comments Download
M tools/gn/target.cc View 2 chunks +45 lines, -0 lines 0 comments Download
M tools/gn/target_unittest.cc View 1 chunk +33 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (2 generated)
timn
4 years, 2 months ago (2016-10-06 21:33:38 UTC) #3
brettw
Thanks for noticing this bug. I originally wrote this expecting that if the tool didn't ...
4 years, 2 months ago (2016-10-07 18:12:04 UTC) #4
timn
On 2016/10/07 18:12:04, brettw (ping on IM after 24h) wrote: > Thanks for noticing this ...
4 years, 2 months ago (2016-10-07 22:35:39 UTC) #5
brettw
4 years, 2 months ago (2016-10-10 19:21:40 UTC) #6
On 2016/10/07 22:35:39, timn wrote:
> On 2016/10/07 18:12:04, brettw (ping on IM after 24h) wrote:
> > Thanks for noticing this bug.
> > 
> > I originally wrote this expecting that if the tool didn't define the PCH
type,
> > it would just be unused for that compile.
> 
> Makes sense as well, though I would prefer an error/warning in this case.
> At least that's what I'd expect when using PCHs when they're not available.
> 
> btw.: The gcc_toolchain() template doesn't set precompiled_header_type (while
> the MSVC one does).
> Is this an oversight or intended?

I have a lot of sympathy for the pedantic error messages. But the second point
about gcc_toolchain kind of gets to the reason behind the silently-ignore
design. The Chrome build uses many toolchains (even gcc_toolchain is used on
Windows for NaCl), and I wasn't sure all of them would support PCH. If this
failed hard, we would have to do a bunch of tracking to ensure that enabling PCH
in the config matches the toolchain it's being compiled into. As of now this
isn't an issue because PCH is only supported on Mac and Windows native
toolchains, so the condition is trivial.

So I still lean toward fixing the flags writer instead.

Powered by Google App Engine
This is Rietveld 408576698