Bug 161864 - Building on Win 64 (Windows 10 64 bit)
Summary: Building on Win 64 (Windows 10 64 bit)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Windows 10
: P2 Blocker
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-12 09:45 PDT by Tom Sisson
Modified: 2017-05-30 13:38 PDT (History)
6 users (show)

See Also:


Attachments
Build log files CMakeError.log and CMakeOutput.log (52.14 KB, application/octet-stream)
2016-09-12 09:45 PDT, Tom Sisson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Sisson 2016-09-12 09:45:41 PDT
Created attachment 288573 [details]
Build log files CMakeError.log and CMakeOutput.log

If there is a more appropriate forum or location for this I apologize. If I post this to a CMake forum, they will say this is a source issue.

Clearly, building on Windows shouldn't be this difficult, but it is. I never had these problems on 32-bit Windows.

Below is the output from "perl build-webkit." These are not variables from my environment or OS. Instead, line 100 of OptionsWin.cmake has the line "if (${MSVC_CXX_ARCHITECTURE_ID} STREQUAL "X86")" which it complains about. If I new how to pass an argument to say, "Hey, I'm building for 64-bit Windows," I would. I have replaced my username with *user* just for security or privacy. Note any other words surrounded by asterisks (*).

-----------------------------------------------------
CMake Error at Source/cmake/OptionsWin.cmake:100 (if):
  if given arguments:

    "STREQUAL" "X86"

  Unknown arguments specified
Call Stack (most recent call first):
  Source/cmake/OptionsAppleWin.cmake:1 (include)
  Source/cmake/WebKitCommon.cmake:47 (include)
  CMakeLists.txt:126 (include)


-- Configuring incomplete, errors occurred!
See also "C:/Users/*user*/Source/WebKit/WebKitBuild/Release/CMakeFiles/CMakeOutput.log".
See also "C:/Users/*user*/Source/WebKit/WebKitBuild/Release/CMakeFiles/CMakeError.log".
Run "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat" before build-webkit when using ninja at build-webkit line 254.
------------------------------------------------------------------

Output from set command:
------------------------
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\*user*\AppData\Roaming
APR_ICONV_PATH=C:\Program Files (x86)\Subversion\iconv
asl.log=Destination=file
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=*computername*
ComSpec=C:\WINDOWS\system32\cmd.exe
DXSDK_DIR=C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\
FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer
FPS_BROWSER_USER_PROFILE_STRING=Default
HOMEDRIVE=C:
HOMEPATH=\Users\*user*
LOCALAPPDATA=C:\Users\*user*\AppData\Local
LOGONSERVER=\\*logonserver*
MSBUILDDISABLENODEREUSE=1
NUMBER_OF_PROCESSORS=4
OS=Windows_NT
Path=C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Python27\;C:\Python27\Scripts;C:\Perl64\site\bin;C:\Perl64\bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\WINDOWS\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\nodejs\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\CMake\bin;C:\Program Files\Git\cmd;C:\Program Files (x86)\Subversion\bin;C:\GnuWin32\bin;C:\mingw-w64\x86_64-6.2.0-posix-seh-rt_v5-rev0\mingw64\bin;C:\GnuWin32\bin;C:\msys64;C:\Users\test\AppData\Roaming\Python\Scripts;C:\Ruby23-x64\bin;C:\Users\test\AppData\Local\Microsoft\WindowsApps;C:\Users\test\AppData\Roaming\npm
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.py;.pyw;.RB;.RBW
PreferredToolArchitecture=x64
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=AMD64 Family 18 Model 1 Stepping 0, AuthenticAMD
PROCESSOR_LEVEL=18
PROCESSOR_REVISION=0100
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
PUBLIC=C:\Users\Public
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\Users\*user*\AppData\Local\Temp
TMP=C:\Users\*user*\AppData\Local\Temp
USERDOMAIN=*userdomain*
USERDOMAIN_ROAMINGPROFILE=*roamingprofile*
USERNAME=test
USERPROFILE=C:\Users\*user*
VS110COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\
VS120COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\
VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
VSSDK140Install=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VSSDK\
WEBKIT_LIBRARIES=C:\Users\*user*\Source\WebKit\WebKitLibraries\win
WEBKIT_OUTPUTDIR=C:\Users\*user*\Source\WebKit\WebKitBuild
windir=C:\WINDOWS
_IsNativeEnvironment=true
-------------------------

I have attached the two referenced log files from the build output as one text file called
Comment 1 Tom Sisson 2016-09-12 10:13:05 PDT
I commented out the offending section with and without commenting out variables setting lib64 and bin64 as the defined directories.

---------------------
# if (${MSVC_CXX_ARCHITECTURE_ID} STREQUAL "X86")
    # set(WEBKIT_LIBRARIES_LINK_DIR "${WEBKIT_LIBRARIES_DIR}/lib32")
    # # FIXME: Remove ${WEBKIT_LIBRARIES_LINK_DIR} when find_library is used for everything
    # link_directories("${CMAKE_BINARY_DIR}/lib32" "${WEBKIT_LIBRARIES_LINK_DIR}")
    # set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib32)
    # set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib32)
    # set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin32)
# else ()
    # set(WEBKIT_LIBRARIES_LINK_DIR "${WEBKIT_LIBRARIES_DIR}/lib64")
    # # FIXME: Remove ${WEBKIT_LIBRARIES_LINK_DIR} when find_library is used for everything
    # link_directories("${CMAKE_BINARY_DIR}/lib64" "${WEBKIT_LIBRARIES_LINK_DIR}")
    # set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib64)
    # set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib64)
    # set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin64)
# endif ()
-------------------

-- Looking for include file features.h
-- Looking for include file features.h - not found
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
CMake Error at Source/cmake/FindICU.cmake:106 (message):
  Could not find ICU
Call Stack (most recent call first):
  Source/cmake/OptionsWin.cmake:193 (find_package)
  Source/cmake/OptionsAppleWin.cmake:1 (include)
  Source/cmake/WebKitCommon.cmake:47 (include)
  CMakeLists.txt:126 (include)


-- Configuring incomplete, errors occurred!
See also "C:/Users/test/Source/WebKit/WebKitBuild/Release/CMakeFiles/CMakeOutput.log".
See also "C:/Users/test/Source/WebKit/WebKitBuild/Release/CMakeFiles/CMakeError.log".
Run "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat" before build-webkit when using ninja at build-webkit line 254.
-------------------------------------

I don't need an international version of Webkit. Perhaps someone should consider just posting installers for prebuilt, stable versions of Webkit for Windows. If Apple simply had continued making Safari available.

It seems that I simply need to start from scratch. Trying my best to uninstall as much as possible and creating a new source tree. Otherwise, I should give up. There are Webkit browsers available for Windows, but they are very limited, unmaintained, or unusable on Windows 10.
Comment 2 Brent Fulgham 2016-09-12 14:06:05 PDT
I think you are running into an annoyance with Windows/CMake.

If you are using a command line that was launched with the 32-bit build tools in their path, that is the kind of build CMake will create for you. If you attempt to do a 64-bit build, you get a mix of build tools, and bad things happen.

Instead, you have to start from the 64-bit build environment, either by using the console shortcut provided by Visual Studio, or by calling VCVARSALL.BAT with the right flags.
Comment 3 Tom Sisson 2016-09-13 17:06:06 PDT
What are the right flags? I deleted the source tree, started from scratch, and ran vcvarsall.bat. What about "features.h not found?" Is that an unimportant error?

I ran vcvarsall.bat amd64, reran perl update-webkit, and got the same error. At worst, it should build the wrong architecture. I opted to download all SDKs when I install Visual Studio. I should theoretically be able to build for iOS if I want, but I'm starting to think that the perl script needs to be smart enough to know what architecture it is running on. Even if it's can't be sure of the exact architecture, it should know it's on Windows and default to Win32.

I also note when I search for MSVC_CXX_ARCHITECTURE_ID I find many issues mentioned about CMake having problems. I see no clear explanation or solution. Is STREQUAL a defined function or built into Perl?
I'm not trying to be a smarta**, but does anyone actually try to build on Windows anything not specifically built for Windows. I suppose I could just boot up Linux, install mingw and crossbuild (whatever the tool is created by Gimp developers). However, I would prefer to do it on Windows.
Tom
​​perl build-webkit
Installing WebKitSupportLibrary...
The WebKitSupportLibrary has been sucessfully installed in
C:\Users\test\Source\WebKit\WebKitLibraries\win
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 6.2.0
-- The CXX compiler identification is GNU 6.2.0
-- Check for working C compiler: C:/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev0/mingw64/bin/gcc.exe
-- Check for working C compiler: C:/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev0/mingw64/bin/gcc.exe
-- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev0/mingw64/bin/c++.exe
-- Check for working CXX compiler: C:/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev0/mingw64/bin/c++.exe
-- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found BISON: C:/GnuWin32/bin/bison.exe (found suitable version "2.4.1", minimum required is "2.1")
-- Found Gperf: C:/GnuWin32/bin/gperf.exe (Required is at least version "3.0.1")
-- Found Perl: C:/Perl64/bin/perl.exe (found suitable version "5.24.0", minimum required is "5.10.0")
-- Found PythonInterp: C:/Python27/python2.7.exe (found suitable version "2.7.10", minimum required is "2.7.0")
-- Found Ruby: C:/Ruby23-x64/bin/ruby.exe (found suitable version "2.3.0", minimum required is "1.9")
-- Looking for include file features.h
-- Looking for include file features.h - not found
CMake Error at Source/cmake/OptionsWin.cmake:100 (if):
  if given arguments:

    "STREQUAL" "X86"

  Unknown arguments specified

Call Stack (most recent call first):
  Source/cmake/OptionsAppleWin.cmake:1 (include)
  Source/cmake/WebKitCommon.cmake:47 (include)
  CMakeLists.txt:126 (include)


-- Configuring incomplete, errors occurred!
See also "C:/Users/test/Source/WebKit/WebKitBuild/Release/CMakeFiles/CMakeOutput.log".
See also "C:/Users/test/Source/WebKit/WebKitBuild/Release/CMakeFiles/CMakeError.log".
Run "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat" before build-webkit when
using ninja at build-webkit line 254.
Comment 4 Orhun Birsoy 2016-09-14 13:28:50 PDT
adding --no-ninja argument (i.e. 'perl build-webkit --no-ninja') allowed me to 'fix' that cmake error.
Comment 6 Fujii Hironori 2016-09-14 22:08:44 PDT
This is my build log with CMake+Ninja on Windows 10 x64.

> C:\home\fujihiro\work\webkit\webkit1\Tools\Scripts>perl build-webkit
> WebKitSupportLibrary is up-to-date.
> Not searching for unused variables given on the command line.
> -- The C compiler identification is MSVC 19.0.24213.1
> -- The CXX compiler identification is MSVC 19.0.24213.1
> -- Check for working C compiler using: Ninja
> -- Check for working C compiler using: Ninja -- works

Comparing to your build log, I guess you have a 'gcc' in your PATH.
Comment 7 Tom Sisson 2016-09-15 18:07:54 PDT
(In reply to comment #6)
> This is my build log with CMake+Ninja on Windows 10 x64.
> 
> > C:\home\fujihiro\work\webkit\webkit1\Tools\Scripts>perl build-webkit
> > WebKitSupportLibrary is up-to-date.
> > Not searching for unused variables given on the command line.
> > -- The C compiler identification is MSVC 19.0.24213.1
> > -- The CXX compiler identification is MSVC 19.0.24213.1
> > -- Check for working C compiler using: Ninja
> > -- Check for working C compiler using: Ninja -- works
> 
> Comparing to your build log, I guess you have a 'gcc' in your PATH.

The choice of C compiler should not make a difference, and GCC is a good C compiler. However, it may be best practice to use a compiler designed for Microsoft. It does seem that in the past there were many C compilers out there that did a good job when Windows was only 32 bit, though some 16-bit programs were still around. Borland had a working C compiler, but I have heard they have dropped out of the market with 64-bit Windows becoming commonplace and Visual Studio being available for free and much improved.

I also believe that programmers write sources and scripts with the assumption that Visual Studio will be used for Microsoft Windows, GCC will be used *nix programs, and XTools will be used for Apple programs that will use Apple libraries. One cannot simply write generic source code for a program and expect the build tools to compile the program without instructions.

Keeping this in mind, I would not expect GCC to build perfectly for Windows any more than Visual Studio to build perfectly for Linux. I know I can pass parameters on the command line in Linux to use specific tools. However, I have little experience in doing this in Windows. Perhaps, I should simply change the environment variables to hide undesirable tools, reboot and compile. 

In conclusion it seems that the answer is to pass parameters or hide GCC.
Comment 8 Tom Sisson 2016-09-15 18:22:50 PDT
(In reply to comment #5)
> Have you tried Otter browser?
> 
> https://otter-browser.org/
> https://sourceforge.net/projects/otter-browser/files/otter-browser-weekly141/

I did like Opera in the past, and I like QT better than GTK. Though I find that GTK actually looks better on Windows than Linux flavors I've used in the past. However, my goal is to have a 64-bit browser on Windows that is as close to Safari as possible. Though, I may install it and try it out just to see what it's like.

Just a thought, can you imagine Microsoft adopting GTK3 after working with Ubuntu and Canonical? Perhaps they could be available as alternatives and sit right alongside other libraries in the Windows folder.
Comment 9 Don Olmstead 2017-05-30 13:38:25 PDT
(In reply to Tom Sisson from comment #7)
> (In reply to comment #6)
> > This is my build log with CMake+Ninja on Windows 10 x64.
> > 
> > > C:\home\fujihiro\work\webkit\webkit1\Tools\Scripts>perl build-webkit
> > > WebKitSupportLibrary is up-to-date.
> > > Not searching for unused variables given on the command line.
> > > -- The C compiler identification is MSVC 19.0.24213.1
> > > -- The CXX compiler identification is MSVC 19.0.24213.1
> > > -- Check for working C compiler using: Ninja
> > > -- Check for working C compiler using: Ninja -- works
> > 
> > Comparing to your build log, I guess you have a 'gcc' in your PATH.
> 
> The choice of C compiler should not make a difference, and GCC is a good C
> compiler. However, it may be best practice to use a compiler designed for
> Microsoft. It does seem that in the past there were many C compilers out
> there that did a good job when Windows was only 32 bit, though some 16-bit
> programs were still around. Borland had a working C compiler, but I have
> heard they have dropped out of the market with 64-bit Windows becoming
> commonplace and Visual Studio being available for free and much improved.
> 
> I also believe that programmers write sources and scripts with the
> assumption that Visual Studio will be used for Microsoft Windows, GCC will
> be used *nix programs, and XTools will be used for Apple programs that will
> use Apple libraries. One cannot simply write generic source code for a
> program and expect the build tools to compile the program without
> instructions.
> 
> Keeping this in mind, I would not expect GCC to build perfectly for Windows
> any more than Visual Studio to build perfectly for Linux. I know I can pass
> parameters on the command line in Linux to use specific tools. However, I
> have little experience in doing this in Windows. Perhaps, I should simply
> change the environment variables to hide undesirable tools, reboot and
> compile. 
> 
> In conclusion it seems that the answer is to pass parameters or hide GCC.

I recently fixed https://bugs.webkit.org/show_bug.cgi?id=172570 which should get you past that issue if you are using mingw. I don't compile on mingw so no clue how much further it will get you.

I do know that if you do not set CC and CXX if you are using Ninja then it will search the path. If it finds mingw or another compiler first then it will attempt to use that.