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

Issue 1724533002: clang/gn/win: Stop running the compiler through `ninja -t msvc -e environment.foo` (Closed)

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

Description

clang/gn/win: Stop running the compiler through `ninja -t msvc -e environment.foo` The compiler only needs the INCLUDE environment var, and those contents can just be passed via flags. clang-cl's -imsvc flag adds include directories as-if they're from INCLUDE (i.e. they're in the right place in the directory search order, and they're treated as system headers that don't emit warnings). In 64-bit builds, this would also work for MSVC, but MSVC happily warns about questionable code in system headers if enough warnings are turned on, so we would just use /I there (and make sure the flags are early on the compile command so that these directories are searched at the same time as they would be with INCLUDE). However, in 32-bit builds, MSVC needs PATH to contain both the 32-bit and the 64-bit bin directories to load dlls. Since invoking the compiler so differently for 32-bit and 64-bit is strange, only do this simplification for clang-cl for now. goma doesn't yet know the -imsvc flag flag, so this is blocked on goma learning about this clang-cl flag (https://b//28179421). Build time impact: 64-bit debug builds symbol_level=1, building some binary ("gn") before: clang-cl: 34.9s, 35.1s, 35.1s cl: 26.3s, 26.1s, 27.6s after: clang-cl: 33.8s, 33.7s, 34s cl: 27s, 34.5s, 26.7s So no discernible build perf difference, but fewer processes and less reliance on these environment files seems like a good change anyhow. It also helps with a potential cross-compile of chrome/win, since ninja's -t msvc only exists in ninja/win. BUG=588831 Committed: https://crrev.com/8435ab74b05929d290a11808a0a94ea7536531d7 Cr-Commit-Position: refs/heads/master@{#392624}

Patch Set 1 #

Patch Set 2 : . #

Total comments: 7

Patch Set 3 : no msvc #

Patch Set 4 : comment, nicer, put in rspfile #

Patch Set 5 : actually #

Total comments: 7

Patch Set 6 : foo #

Total comments: 2

Patch Set 7 : comment #

Patch Set 8 : durrrr #

Patch Set 9 : poc #

Total comments: 4

Patch Set 10 : rebase #

Patch Set 11 : rebase #

Patch Set 12 : imsvc #

Patch Set 13 : formatting #

Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -8 lines) Patch
M build/toolchain/win/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 8 chunks +29 lines, -4 lines 0 comments Download
M build/toolchain/win/setup_toolchain.py View 1 2 3 4 5 6 7 8 9 10 3 chunks +11 lines, -4 lines 0 comments Download

Messages

Total messages: 36 (9 generated)
Nico
I think this is pretty neat. Once a json-env-equipped toolchain lands, it should be fairly ...
4 years, 10 months ago (2016-02-22 21:17:03 UTC) #4
Nico
(ps: Take your time with this one; as mentioned in the CL description landing it ...
4 years, 10 months ago (2016-02-22 21:17:27 UTC) #5
scottmg
https://codereview.chromium.org/1724533002/diff/20001/build/toolchain/win/BUILD.gn File build/toolchain/win/BUILD.gn (right): https://codereview.chromium.org/1724533002/diff/20001/build/toolchain/win/BUILD.gn#newcode78 build/toolchain/win/BUILD.gn:78: command = "$cl /nologo $include_flags /showIncludes /FC @$rspfile /c ...
4 years, 10 months ago (2016-02-25 03:40:15 UTC) #6
Nico
thanks! https://codereview.chromium.org/1724533002/diff/20001/build/toolchain/win/BUILD.gn File build/toolchain/win/BUILD.gn (right): https://codereview.chromium.org/1724533002/diff/20001/build/toolchain/win/BUILD.gn#newcode78 build/toolchain/win/BUILD.gn:78: command = "$cl /nologo $include_flags /showIncludes /FC @$rspfile ...
4 years, 10 months ago (2016-02-25 03:45:41 UTC) #7
scottmg
https://codereview.chromium.org/1724533002/diff/20001/build/toolchain/win/BUILD.gn File build/toolchain/win/BUILD.gn (right): https://codereview.chromium.org/1724533002/diff/20001/build/toolchain/win/BUILD.gn#newcode78 build/toolchain/win/BUILD.gn:78: command = "$cl /nologo $include_flags /showIncludes /FC @$rspfile /c ...
4 years, 10 months ago (2016-02-25 18:16:23 UTC) #8
scottmg
On 2016/02/25 18:16:23, scottmg (slow until 25feb) wrote: > https://codereview.chromium.org/1724533002/diff/20001/build/toolchain/win/BUILD.gn > File build/toolchain/win/BUILD.gn (right): > ...
4 years, 10 months ago (2016-02-25 18:18:30 UTC) #9
Nico
On 2016/02/25 18:16:23, scottmg (slow until 25feb) wrote: > https://codereview.chromium.org/1724533002/diff/20001/build/toolchain/win/BUILD.gn > File build/toolchain/win/BUILD.gn (right): > ...
4 years, 10 months ago (2016-02-25 18:24:13 UTC) #10
Nico
On 2016/02/25 18:16:23, scottmg (slow until 25feb) wrote: > https://codereview.chromium.org/1724533002/diff/20001/build/toolchain/win/BUILD.gn > File build/toolchain/win/BUILD.gn (right): > ...
4 years, 10 months ago (2016-02-25 18:24:13 UTC) #11
Nico
Ok, this does indeed not work for 32-bit builds. Options: * Keep using environment file ...
4 years, 10 months ago (2016-02-25 20:55:50 UTC) #12
scottmg
On 2016/02/25 20:55:50, Nico wrote: > Ok, this does indeed not work for 32-bit builds. ...
4 years, 10 months ago (2016-02-25 21:06:13 UTC) #13
scottmg
+bruce for fyi on comments ~8-13.
4 years, 10 months ago (2016-02-25 21:07:04 UTC) #15
brucedawson
On 2016/02/25 21:07:04, scottmg wrote: > +bruce for fyi on comments ~8-13. It seems like ...
4 years, 10 months ago (2016-02-25 21:11:59 UTC) #16
Nico
On 2016/02/25 21:11:59, brucedawson wrote: > On 2016/02/25 21:07:04, scottmg wrote: > > +bruce for ...
4 years, 10 months ago (2016-02-25 21:14:23 UTC) #17
Nico
Ok, now clang-cl-only. Makes the build so much nicer, msvc is really missing out here ...
4 years, 10 months ago (2016-02-25 22:41:56 UTC) #19
scottmg
https://codereview.chromium.org/1724533002/diff/80001/build/toolchain/win/BUILD.gn File build/toolchain/win/BUILD.gn (right): https://codereview.chromium.org/1724533002/diff/80001/build/toolchain/win/BUILD.gn#newcode67 build/toolchain/win/BUILD.gn:67: # %PATH) -- e.g. 32-bit builds require %PATH% to ...
4 years, 10 months ago (2016-02-25 22:56:37 UTC) #20
Nico
thanks! https://codereview.chromium.org/1724533002/diff/80001/build/toolchain/win/BUILD.gn File build/toolchain/win/BUILD.gn (right): https://codereview.chromium.org/1724533002/diff/80001/build/toolchain/win/BUILD.gn#newcode67 build/toolchain/win/BUILD.gn:67: # %PATH) -- e.g. 32-bit builds require %PATH% ...
4 years, 10 months ago (2016-02-26 03:00:44 UTC) #21
scottmg
lgtm https://codereview.chromium.org/1724533002/diff/80001/build/toolchain/win/BUILD.gn File build/toolchain/win/BUILD.gn (right): https://codereview.chromium.org/1724533002/diff/80001/build/toolchain/win/BUILD.gn#newcode69 build/toolchain/win/BUILD.gn:69: if (defined(invoker.sys_include_flags)) { On 2016/02/26 03:00:44, Nico wrote: ...
4 years, 10 months ago (2016-02-26 03:32:04 UTC) #22
Nico
Thanks, done. I also changed setup_toolchain.py to always expect 7 args since it's always called ...
4 years, 10 months ago (2016-02-26 15:16:26 UTC) #23
Nico
Actually, I didn't test this carefully enough and this isn't ready yet :-/ See diff ...
4 years, 10 months ago (2016-02-26 18:33:56 UTC) #24
Nico
Patch set 9 seems to work, but it's kind of ugly. But I might want ...
4 years, 10 months ago (2016-02-26 18:39:29 UTC) #25
scottmg
lgtm-ish https://codereview.chromium.org/1724533002/diff/160001/build/toolchain/win/BUILD.gn File build/toolchain/win/BUILD.gn (right): https://codereview.chromium.org/1724533002/diff/160001/build/toolchain/win/BUILD.gn#newcode72 build/toolchain/win/BUILD.gn:72: # -nostdlibinc so that clang-cl _only_ looks in ...
4 years, 10 months ago (2016-02-26 19:55:23 UTC) #26
Nico
https://codereview.chromium.org/1724533002/diff/160001/build/toolchain/win/BUILD.gn File build/toolchain/win/BUILD.gn (right): https://codereview.chromium.org/1724533002/diff/160001/build/toolchain/win/BUILD.gn#newcode72 build/toolchain/win/BUILD.gn:72: # -nostdlibinc so that clang-cl _only_ looks in sys_include_flags, ...
4 years, 10 months ago (2016-02-26 19:58:22 UTC) #27
Nico
Ok, I've regrouped bit: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160411/155377.html The patch now uses the new -imsvc flag, which doesn't ...
4 years, 8 months ago (2016-04-17 02:46:23 UTC) #29
scottmg
lgtm
4 years, 8 months ago (2016-04-18 16:20:04 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1724533002/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1724533002/240001
4 years, 7 months ago (2016-05-10 14:56:22 UTC) #32
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 7 months ago (2016-05-10 16:35:58 UTC) #34
commit-bot: I haz the power
4 years, 7 months ago (2016-05-10 16:37:29 UTC) #36
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/8435ab74b05929d290a11808a0a94ea7536531d7
Cr-Commit-Position: refs/heads/master@{#392624}

Powered by Google App Engine
This is Rietveld 408576698