Bug 190791 - Some internal projects include wtf headers and build with C++11
Summary: Some internal projects include wtf headers and build with C++11
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Miller
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-10-22 05:54 PDT by Keith Miller
Modified: 2018-10-26 01:26 PDT (History)
9 users (show)

See Also:


Attachments
Patch (1.62 KB, patch)
2018-10-22 05:56 PDT, Keith Miller
no flags Details | Formatted Diff | Diff
Patch (1.62 KB, patch)
2018-10-22 13:06 PDT, Keith Miller
no flags Details | Formatted Diff | Diff
Patch (1.70 KB, patch)
2018-10-24 02:10 PDT, Keith Miller
no flags Details | Formatted Diff | Diff
Patch (1.68 KB, patch)
2018-10-24 15:30 PDT, Keith Miller
no flags Details | Formatted Diff | Diff
Patch (1.71 KB, patch)
2018-10-25 00:30 PDT, Keith Miller
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Miller 2018-10-22 05:54:24 PDT
Some internal projects include wtf headers and build with C++11
Comment 1 Keith Miller 2018-10-22 05:56:25 PDT
Created attachment 352887 [details]
Patch
Comment 2 Alex Christensen 2018-10-22 07:34:21 PDT
Comment on attachment 352887 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=352887&action=review

> Source/WTF/ChangeLog:3
> +        Some internal projects include wtf headers and build with C++11

Those projects should probably update *and* stop including wtf headers.
Comment 3 Keith Miller 2018-10-22 13:06:06 PDT
Created attachment 352903 [details]
Patch
Comment 4 Keith Miller 2018-10-22 13:07:52 PDT
Comment on attachment 352887 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=352887&action=review

>> Source/WTF/ChangeLog:3
>> +        Some internal projects include wtf headers and build with C++11
> 
> Those projects should probably update *and* stop including wtf headers.

Ugh, I agree... I'm working on it internally <rdar://problem/45395767> but for now we need to make sure B&I doesn't roll us back again.
Comment 5 Alexey Proskuryakov 2018-10-22 15:00:56 PDT
Comment on attachment 352903 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=352903&action=review

> Source/WTF/wtf/MathExtras.h:215
>  template <typename T> constexpr unsigned getLSBSet(T value)

Downstream projects don't need getLSBSet. Would this more straightforward fix work?

// FIXME: Remove the #if check once downstream projects stop including WTF, and/or they upgrade to C++14 (rdar://........)
#if WTF_CPP_STD_VER >= 14
template <typename T> constexpr unsigned getLSBSet(T value)
{
...
}
#endif
Comment 6 Keith Miller 2018-10-22 15:06:38 PDT
Comment on attachment 352903 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=352903&action=review

>> Source/WTF/wtf/MathExtras.h:215
>>  template <typename T> constexpr unsigned getLSBSet(T value)
> 
> Downstream projects don't need getLSBSet. Would this more straightforward fix work?
> 
> // FIXME: Remove the #if check once downstream projects stop including WTF, and/or they upgrade to C++14 (rdar://........)
> #if WTF_CPP_STD_VER >= 14
> template <typename T> constexpr unsigned getLSBSet(T value)
> {
> ...
> }
> #endif

In theory but there's always the risk that some other header in WebKit uses getLSBSet and you'd get an undefined identifier build error.
Comment 7 Alexey Proskuryakov 2018-10-22 16:41:09 PDT
Sure, but in theory some other header in WebKit could be using it and expecting it to be constexpr.
Comment 8 Keith Miller 2018-10-22 21:47:01 PDT
(In reply to Alexey Proskuryakov from comment #7)
> Sure, but in theory some other header in WebKit could be using it and
> expecting it to be constexpr.

True, but then neither solution would work. This is mostly just a stopgap until projects including WTF headers either stop or switch to C++14.
Comment 9 Keith Miller 2018-10-24 02:10:04 PDT
Created attachment 353029 [details]
Patch
Comment 10 Alexey Proskuryakov 2018-10-24 09:23:30 PDT
The latest patch breaks the build.

Have you considered adding a canary file to WTF that builds these headers with C++11? That way we can catch build failures earlier.
Comment 11 Keith Miller 2018-10-24 15:30:48 PDT
Created attachment 353059 [details]
Patch
Comment 12 Keith Miller 2018-10-25 00:30:43 PDT
Created attachment 353078 [details]
Patch
Comment 13 WebKit Commit Bot 2018-10-26 01:25:51 PDT
Comment on attachment 353078 [details]
Patch

Clearing flags on attachment: 353078

Committed r237448: <https://trac.webkit.org/changeset/237448>
Comment 14 WebKit Commit Bot 2018-10-26 01:25:53 PDT
All reviewed patches have been landed.  Closing bug.
Comment 15 Radar WebKit Bug Importer 2018-10-26 01:26:38 PDT
<rdar://problem/45581277>