New issue
Advanced search Search tips

Issue 855717 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Jan 4
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

<windows.h> inclusion in gfx/range/range.h causing compilation errors.

Project Member Reported by majidvp@chromium.org, Jun 22 2018

Issue description

For 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

 
The system header in question is 

..\..\..\..\win_toolchain\vs_files\3bc0ec615cf20ee342f3bc29bc991b5ad66d8d2c\win_sdk\Include\10.0.17134.0\shared\rpcndr.h(190,15):  note: expanded from macro 'small'
Blocking: 826359
Components: Infra>Platform
Labels: Pri-1 Type-Bug-Regression
Summary: Windows trybots are failing to compile some patches (was: Windowns trybots are failing to compile some patches)
This bug is preventing me from landing patches. Can someone from Infra team please take a look? Thanks!

Comment 3 by thakis@chromium.org, 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.

Comment 5 by thakis@chromium.org, 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.
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.

Comment 7 by thakis@chromium.org, Jun 25 2018

optional.h also includes <utility> and some other header that I can't remember now but saw when I checked earlier.
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.

Comment 9 by thakis@chromium.org, Jun 25 2018

Components: -Infra>Platform UI>GFX
Labels: -Type-Bug-Regression Type-Bug
(taking out of infra queue then)
Probably for the CHARRANGE typedef. We could add it to base/win/windows_types.h and include that instead, maybe that's enough.
(But I'd also rename the variable, else this is just a landmine for the next person to run into this unintentionally)

Comment 12 by grt@chromium.org, Jun 26 2018

Labels: -Sheriff-Chromium
Removing from sheriff queue.
Blocking: -826359
Labels: -Pri-1 Pri-2
Summary: <windows.h> inclusion in gfx/range/range.h causing compilation errors. (was: Windows trybots are failing to compile some patches)
Description: Show this description
Cc: brucedaw...@chromium.org
+brucedawson since this partially falls under the "include windows.h less" umbrella
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
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.
Project Member

Comment 18 by bugdroid1@chromium.org, 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

Labels: Hotlist-DesktopUIToolingRequired Hotlist-DesktopUIChecked
Mass UI Triage.

Status: Fixed (was: Untriaged)

Sign in to add a comment