<windows.h> inclusion in gfx/range/range.h causing compilation errors. |
|||||||||
Issue descriptionFor CLs that includes gfx/range/range.h, Windows bots are failing to compile. The issue seems unrelated to the CLs. See [1] [2] for example Looking at it the cause appears to be related to a system header that is doing `#define small char` which break anything that uses small as a variable name. We should either a. Removes the inclusion of <windows.h> in range.h, or b. Rename any variable currently named as "small" [1] https://logs.chromium.org/v/?s=chromium%2Fbuildbucket%2Fcr-buildbucket.appspot.com%2F8943000771312178672%2F%2B%2Fsteps%2Fcompile__with_patch_%2F0%2Flogs%2Fraw_io.output_failure_summary_%2F0 [2] https://logs.chromium.org/v/?s=chromium%2Fbuildbucket%2Fcr-buildbucket.appspot.com%2F8943000771312178672%2F%2B%2Fsteps%2Fcompile__with_patch_%2F0%2Flogs%2Fraw_io.output_failure_summary_%2F0
,
Jun 25 2018
This bug is preventing me from landing patches. Can someone from Infra team please take a look? Thanks!
,
Jun 25 2018
I'm not sure what infra is supposed to do here. Don't call your variables "small", for it conflicts with system headers.
,
Jun 25 2018
There is already code that has "small" in it [1]. The new CL does not introduce any AFAICT. [1] https://codesearch.chromium.org/chromium/src/cc/trees/layer_tree_host_pixeltest_scrollbars.cc?q=layer_tree_host_pixeltest_scrollbars.cc&sq=package:chromium&dr&l=67
,
Jun 25 2018
Have you made sure you're still seeing this in a CL that doesn't add any includes to any .h files? If not, I'm guessing the additional .h files cause that header to be pulled in, causing the collision.
,
Jun 25 2018
Auditing the includes is a good idea. The new CL adds a few includes: - "base/optional.h" - "ui/gfx/range/range_f.h" - <algorithm> I suspect the <algorithm> may potentially pull in some unrelated stuff. We can check this.
,
Jun 25 2018
optional.h also includes <utility> and some other header that I can't remember now but saw when I checked earlier.
,
Jun 25 2018
Actuall /ui/gfx/range/range.h is including <windows.h>, but I have no idea why! That is a much more likely suspect. We should start with that.
,
Jun 25 2018
(taking out of infra queue then)
,
Jun 25 2018
Probably for the CHARRANGE typedef. We could add it to base/win/windows_types.h and include that instead, maybe that's enough.
,
Jun 25 2018
(But I'd also rename the variable, else this is just a landmine for the next person to run into this unintentionally)
,
Jun 26 2018
Removing from sheriff queue.
,
Jun 26 2018
,
Jun 26 2018
,
Jun 27 2018
+brucedawson since this partially falls under the "include windows.h less" umbrella
,
Jun 27 2018
Removing #include of windows.h from range.h is definitely the sane way forwards. If necessary it can include windows_types.h instead. The master windows.h bug is crbug.com/796644
,
Jun 27 2018
I've created crrev.com/c/1117739 which removes the #include of windows.h from range.h which should help. Let me know. Either way I'll try to land it since it is a (small) step in the right direction.
,
Jun 28 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3c41dd4c6f6ab218366dbe4557910245e3f31bda commit 3c41dd4c6f6ab218366dbe4557910245e3f31bda Author: Bruce Dawson <brucedawson@chromium.org> Date: Thu Jun 28 16:22:59 2018 Don't include Windows.h from range.h Including Windows.h causes namespace pollution and build-time costs due to the heavy use of macros and the large size of the headers. This removes a #include of Windows.h from range.h that is currently causing problems. Bug: 855717 , 796644 Change-Id: I26abd068ed1c4a5ca65092258dd45ccd076c2b20 Reviewed-on: https://chromium-review.googlesource.com/1117739 Commit-Queue: Nico Weber <thakis@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Reviewed-by: Robert Sesek <rsesek@chromium.org> Cr-Commit-Position: refs/heads/master@{#571155} [modify] https://crrev.com/3c41dd4c6f6ab218366dbe4557910245e3f31bda/ui/gfx/range/range.h [modify] https://crrev.com/3c41dd4c6f6ab218366dbe4557910245e3f31bda/ui/gfx/range/range_win.cc [modify] https://crrev.com/3c41dd4c6f6ab218366dbe4557910245e3f31bda/ui/gfx/range/range_win_unittest.cc
,
Nov 19
Mass UI Triage.
,
Jan 4
|
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by majidvp@chromium.org
, Jun 22 2018