Bug 156825 - WebKit doesn't compile with Visual Studio 2015 Update 2
Summary: WebKit doesn't compile with Visual Studio 2015 Update 2
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Windows 10
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-04-20 17:13 PDT by ewmailing
Modified: 2021-09-09 00:18 PDT (History)
5 users (show)

See Also:


Attachments
VS2015 WTF.lib error output (123.93 KB, text/plain)
2016-04-22 17:04 PDT, ewmailing
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description ewmailing 2016-04-20 17:13:25 PDT
This is an FYI bug. I gave a quick pass to try to build JavaScriptCore (I don't need all of WebKit, but I think all of WebKit has the same problem) with Visual Studio 2015 Update 2. It doesn't compile.

So the biggest "problem" I see is that Microsoft finally fixed their broken compiler to support a bunch of C99 things they have dragged their feet on for a decade. So things like snprintf I think finally exist. But the problem is that there are a lot of workarounds to redefine this missing functions for Visual Studio which result in duplicate definitions now and break the compile.

I think the solution is to start looking for the #if _MSC_VER cases and explicitly compare for < 1900 when it looks like it is a C/C++ language/standard-library workaround for Visual Studio.
Comment 1 Brent Fulgham 2016-04-20 20:35:23 PDT
(In reply to comment #0)
> This is an FYI bug. I gave a quick pass to try to build JavaScriptCore (I
> don't need all of WebKit, but I think all of WebKit has the same problem)
> with Visual Studio 2015 Update 2. It doesn't compile.
> 
> So the biggest "problem" I see is that Microsoft finally fixed their broken
> compiler to support a bunch of C99 things they have dragged their feet on
> for a decade. So things like snprintf I think finally exist. But the problem
> is that there are a lot of workarounds to redefine this missing functions
> for Visual Studio which result in duplicate definitions now and break the
> compile.
> 
> I think the solution is to start looking for the #if _MSC_VER cases and
> explicitly compare for < 1900 when it looks like it is a C/C++
> language/standard-library workaround for Visual Studio.

Well! This is good and bad news. Let's try to get those changes started. I can get our Windows builders updated to Update 2 and see what happens

Do you intend to post any patches for this?
Comment 2 Radar WebKit Bug Importer 2016-04-21 13:51:03 PDT
<rdar://problem/25861699>
Comment 3 Radar WebKit Bug Importer 2016-04-21 13:51:29 PDT
<rdar://problem/25861703>
Comment 4 Brent Fulgham 2016-04-21 14:31:18 PDT
I just upgraded to Visual Studio 2015 Update 2, and had no problem building WebKit. Can you attach a build log of your failure so I can see what's going on?
Comment 5 ewmailing 2016-04-22 17:03:45 PDT
(In reply to comment #4)
> I just upgraded to Visual Studio 2015 Update 2, and had no problem building
> WebKit. Can you attach a build log of your failure so I can see what's going
> on?

I'm still having problems, but I might have been a little inaccurate/imprecise in my original description. First to clarify any possible confusion, I am following the Windows without Cygwin instructions.

So the first problem with snprintf example was actually in the WinCairo support project, which might fall outside WebKit.

However, after I move to actual webkit, I see a lot of compile errors. Below is my output from building just WTF.lib. Since I saw the snprintf problem earlier, and these messages seem to be redeclaration errors, I assumed something similar is going on.

I should also point out that my code is probably a few months stale. Building for Windows is so hard, I kept a VM snapshot of my last successful build with VS2013, and then forked it to try with VS2015.


(Note: I'm going to try an attachment for the errors. I get an error saying this message is too long.)
Comment 6 ewmailing 2016-04-22 17:04:48 PDT
Created attachment 277117 [details]
VS2015 WTF.lib error output
Comment 7 Alex Christensen 2016-04-25 11:35:22 PDT
This looks like an old revision of WebKit.  What SVN revision are you using?  Does it still reproduce with what is currently in the repository?