Failed to Build WebKit-r161259 on Win7/VS2010 - visual-studio-2010

I've build WebKit-r128959 successfully on Win7/VS2010, but now the source (WebKit-r161259) has changed a lot and my experience doesn't work any longer...
I met this first error.
WebKitSupportLibrary is up-to-date.
Building results into: /cygdrive/c/cygwin_dir/home/LioMoon/WebKit-r161249/WebKitBuild
WEBKIT_OUTPUTDIR is set to: C:\cygwin_dir\home\LioMoon\WebKit-r161249\WebKitBuild
WEBKIT_LIBRARIES is set to: C:\cygwin_dir\home\LioMoon\WebKit-r161249\WebKitLibraries\win
/cygdrive/c/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/devenv.com WebKit.vcxproj\WebKit.sln /build Release|Win32
Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
------ Build started: Project: WTFGenerated, Configuration: Release Win32 ------
Build started 1/4/2014 7:05:45 AM.
Build:
/usr/bin/which: no bash in ((null))
'nmake' is not recognized as an internal or external command,
operable program or batch file.
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "%SystemDrive%\cygwin\bin\which.exe bash
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: set PLATFORMARCHITECTURE=32
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: nmake /nologo -f WTFGenerated.make" exited with code 9009.
Build FAILED.
I just don't understand why the path is (null) and why the devenv executable cannot find nmake. The following lines are the path variable in VS2010:
Path=C:\Program Files\Microsoft F#\v4.0\;C:\Program Files\Microsoft Visual Studi
o 10.0\VSTSDB\Deploy;C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\;
c:\Program Files\Microsoft Visual Studio 10.0\VC\BIN;C:\Program Files\Microsoft
Visual Studio 10.0\Common7\Tools;c:\Windows\Microsoft.NET\Framework\v4.0.30319;c
:\Windows\Microsoft.NET\Framework\v3.5;c:\Program Files\Microsoft Visual Studio
10.0\VC\VCPackages;C:\Program Files\HTML Help Workshop;C:\Program Files\Microsof
t Visual Studio 10.0\Team Tools\Performance Tools;C:\Program Files\Microsoft SDK
s\Windows\v7.0A\bin\NETFX 4.0 Tools;C:\Program Files\Microsoft SDKs\Windows\v7.0
A\bin;c:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\..\..\VC\bin;C
:\cygwin\bin;C:\Program Files\Parallels\Parallels Tools\Applications;C:\Windows\
system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShe
ll\v1.0\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\
Microsoft SQL Server\100\DTS\Binn" /f;c:\Program Files\Microsoft Visual Studio 1
0.0\Common7\Tools\..\..\VC\bin;
Obviously it's not null. How can I fix the problem?

My build experience is as follow. See more at http://blog.csdn.net/lzl124631x/article/details/18098361
Environment:
Operating System: Windows 7 Ultimate 32-bit
Processor: Intel Core i7 860
Installed Memory: 4.00 GB
1. Installing VS2013:
a. Install Win7 SP1 (windows6.1-KB976932-X86.exe)
b. Install 5 patches for IE10
ⅰ. Windows6.1-KB2533623-x86.msu
ⅱ. Windows6.1-KB2670838-x86.msu
ⅲ. Windows6.1-KB2729094-v2-x86.msu
ⅳ. Windows6.1-KB2731771-x86.msu
ⅴ. Windows6.1-KB2786081-x86.msu
c. Install IE10 (IE10-Windows6.1-x86-en-us.exe)
d. Install VS2013 (VS2013_RTM_ULT_ENU.iso)
e. Right click on "C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe", "Properties", "Compatibility", check "Run this program as an administrator".
2. Installing Cygwin
a. Download cygwin-downloader.zip (http://svn.webkit.org/repository/webkit/trunk/Tools/CygwinDownloader/cygwin-downloader.zip) and unzip it.
b. Run cygwin-downloader.exe and wait...
c. Run setup.exe, select "Install from Local Directory" and install.
d. Run setup.exe, select "Install from Internet"
i. In steps before "Select Packages", just select default folder, whatever connection and download site.
ⅱ. Select Packages: Search "gcc", expand Devel, select "gcc-g++: GNU Compiler Collection(C++)"
ⅲ. Select Packages: Search "gdb", expand Devel, select "gdb: The GNU Debugger"
See more at "Installing gcc with Cygwin"(http://www.eecg.utoronto.ca/~aamodt/ece242/cygwin.html)
e. Open C:\cygwin\etc\profile
ⅰ. Modify line 32 to PATH="/bin:${PATH}"
ⅱ. Comment line 44-50 by adding '#' at the beginning of each line.
3. Installing SDKs
a. Install QuickTime SDK (https://developer.apple.com/quicktime/)
b. Install Direct SDK (June 2010 DirectX SDK:http://www.microsoft.com/en-us/download/details.aspx?id=6812)
4. Getting the Code
a. Download Nightly Build (http://nightly.webkit.org/) and unzip it. My version is WebKit-r161524.
b. Suppress Warning 4309: Open "WebKitLibraries/win/tools/vsprops/common.props", find tag , add 4309.
c. Download Support Library (https://developer.apple.com/opensource/internet/webkit_sptlib_agree.html) and copy it into WebKit-r161524. DO NOT unzip it.
d. Open Source/WebCore/platform/LocalizedString.cpp, search "Look Up", delete the DOUBLE-BYTE double quotation marks around “%#” and “”.
5. Save the following lines as a .cmd/.bat file. I named it as Build.cmd.
#echo off
echo Setting up links...
set CYGWIN_DIR=C:\cygwin
set WEBKIT_SOURCE_DIR=%~dp0%
if "%WEBKIT_SOURCE_DIR:~-1%"=="\" set WEBKIT_SOURCE_DIR=%WEBKIT_SOURCE_DIR:~0,-1%
for /R "delims=\" %%a in (%WEBKIT_SOURCE_DIR%) do set WEBKIT_DIR_NAME=%%~nxa
set WEBKIT_LINK_DIR=%CYGWIN_DIR%\home\%username%\%WEBKIT_DIR_NAME%
if exist "%WEBKIT_LINK_DIR%" rmdir "%WEBKIT_LINK_DIR%"
mklink /D "%WEBKIT_LINK_DIR%" "%WEBKIT_SOURCE_DIR%"
echo Exporting environment varibles...
set WEBKIT_OUTPUTDIR=%WEBKIT_LINK_DIR%\WebKitBuildByCygwin
set WEBKIT_LIBRARIES=%WEBKIT_LINK_DIR%\WebKitLibraries\win
set VSINSTALLDIR=%VS120COMNTOOLS%..\..
set PATH=%WEBKIT_LINK_DIR%\Tools\Scripts;%PATH%
echo Running Cygwin...
call "%CYGWIN_DIR%\Cygwin.bat"
:exit
6. Build
a. run Build.cmd
b. update-webkit
c. build-webkit --debug | tee WebKit-r161524/log.txt
Other Material:
a. Building on Windows:http://trac.webkit.org/wiki/BuildingOnWindows (WebKit Team's note on building on windows)
b. ​WebKit Wiki: http://trac.webkit.org/wiki/WikiStart
Error Solutions:
---------------------------------------------------------------------
Error Message:
17> sh: /usr/bin/gcc: No such file or directory
17> Failed to read names from file: /cygdrive/g/WEBKIT~1/Source/WebCore/html/HTMLTagNames.in at /cygdrive/g/WEBKIT~1/Source/WebCore/dom/make_names.pl line 324.
17> /cygdrive/g/WEBKIT~1/Source/WebCore/DerivedSources.make:942: recipe for target 'HTMLElementFactory.cpp' failed
17> make: *** [HTMLElementFactory.cpp] Error 127
17> make: *** Waiting for unfinished jobs....
17> ./CSSGrammar.y:62.1: error: syntax error, unexpected end of file
Solution:
Install gcc to Cygwin (step 2.d).
---------------------------------------------------------------------
Error Message:
17> build-generated-files.sh: line 59: cd: /home/Moon/WEBKIT~1/WEBKIT~2/Debug/obj32/WebCore/DerivedSources: Permission denied
18> c1xx : fatal error C1083: Cannot open source file: 'C:\cygwin\home\Moon\WebKit-r161524\WebKitBuildByCygwin\Debug\obj32\WebCore\DerivedSources\CSSPropertyNames.cpp': No such file or directory
Solution:
Right click on "C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe", "Properties", "Compatibility", check "Run this program as an administrator"
---------------------------------------------------------------------
Error Message:
..\platform\LocalizedStrings.cpp(248): error C2001: newline in constant
Or
..\platform\LocalizedStrings.cpp(250): error C2001: newline in constant
Solution:
Open Source/WebCore/platform/LocalizedString.cpp, search "Look Up", delete the DOUBLE-BYTE double quotation marks around “%#” and “”.

In my case the problems I faced were the following:
Missing cygwin tool such as perl, make python o ruby:
execute the setup of cygwin and install the missing components.
Conflictive components installed in cygwin and windows at the same time. For instance, if you have python installed in your windows and it is also installed in cygwin, then it's possible that depending on which version is specified in the path, you would get errors related to library versions or problems finding files due the different folder separator character used in the paths ("\" vs "/")
remediation: uninstall the conflictive component from windows and let the one installed in cygwin
Build script doesn't found the installed SDK: Consider to edit the script and point to the SDK that you have currently installed. You can use regedit to find out the key that corresponds to your SDK in your machine. In my case I added the key that corresponds to my current windows SDK "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v7.0A" in the script webkitdirs.pm:
line 1523: my #windowsPlatformSDKRegistryEntries = (
line 1524: "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v8.0A",
line 1525: "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v8.0",
line 1526: "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v7.1A",
line 1527: "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v7.1",
line 1528: "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v7.0A",
line 1529: "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1", line 1530:);
Encoding issues: if you see there is some file that prevent the building, open the file and ensure it has not encoding issues related to DOS / Unix encoding types.
Remediation: download the problematic file with the right encoding and try again.
Problems related to missing files or files not found:
Ensure to execute the script with administrator permissions. in some cases 3rd party tools invoked by the script are the ones without permissions. if it is the case consider to edit the settings of the involved application and change the compatibility to "run as administrator"

Related

What runtime dependencies does TLBIMP have?

Setting up a clean build machine I have only installed VS2019 so far, including Windows 10 SDK, as far as 3rd-party software is concerned.
An ODL file has custom compile step:
midl /out ..\dll %(FullPath)
TLBIMP ../dll/%(Filename).tlb /namespace:MyOrg.COM /keyfile:../include/MyOrg.snk /out:../dll/%(Filename).dll
This gives the build error:
1>'TLBIMP' is not recognized as an internal or external command,
1>operable program or batch file. 1>C:\Program Files (x86)\Microsoft
Visual
Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(231,5):
error MSB6006: "cmd.exe" exited with code 9009.
Clearly MIDL is working, what additional Visual Studio/Windows components do I need to install for TMPLIB?
As Simon points out in comments, TLMIMP.exe is a standard VS tool. Depending which Windows SDK is being used it should be found in:
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\TlbImp.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools
You might have multiple versions installed, which is used during a build will depend on your %PATH variable. This would normally be set whenever you run Visual Studio Developer Command Prompt (I assume if you build within the IDE it's done automatically).
My issue was actually that I'm building with Azure Devops and it doesn't automatically add this folder to the build path.

How do I make visual studio 2017 compiler, specifically cl.exe work with luarocks?

I tried to just find a lua rocks library made for lua 5.3 first of all so I come across mathx, I have no idea what this library really does I just wanted to test luarocks installation is working correctly. Everything seems to be working fine but what I believe now in windows by default it is currently looking for cl.exe, in visual studio 2017 I have this file located at:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\cl.exe
However setting this directory in the path does not allow me to initiate the command in eithe command prompt of 'cl'
When installing from lua command prompt:
C:\Users\MYNAMEHERE>luarocks install lmathx Installing luarocks.org/lmathx-20150624-1.src.rock cl /nologo /MD /O2 -c -Folmathx.obj -IC:/lua/include lmathx.c 'cl' is not recognised as an internal or external command, operable program or batch file.
Error: Build error: Failed compiling object lmathx.obj
When installing from visual studio 2017 command prompt:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>luarocks install lmathx Installing luarocks.org/lmathx-20150624-1.src.rock cl /nologo /MD /O2 -c -Folmathx.obj -IC:/lua/include lmathx.c lmathx.c link -dll -def:mathx.def -out:mathx.dll C:/lua/lua53.dll lmathx.obj Microsoft (R) Incremental Linker Version 14.10.25019.0 Copyright (C) Microsoft Corporation. All rights reserved.
C:\lua\lua53.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x430
Error: Build error: Failed compiling module mathx.dll
I think my macbook is doing similar but I will have to look at that another day so I am putting that aside for now.
The module I have tried to install above is: luarocks.org/modules/ignacio/lmathx
C:\Users\MYNAMEHERE>luarocks install luai Installing luarocks.org/luai-1.0-2.src.rock luai 1.0-2 is now installed in C:\lua\systree (license: MIT/X11)
I have managed to get one module installed: luarocks.org/modules/cschen1205/luai
which gave the following output in normal windows command prompt after typing: luarocks install luai
C:\Users\MYNAMEHERE>luarocks install luai Installing zluarocks.org/luai-1.0-2.src.rock luai 1.0-2 is now installed in C:\lua\systree (license: MIT/X11)
However I was struggling to get any lua code to test this even on there github for it.
I am left stumped overall either I can't get windows to pick up the visual studio 2017 compiler to build luarocks files (Please note I do have C:\MinGW installed as a portable version as well with c and c++ compiler in there of gcc but this is already set in path, I can use this instead if vs studio 2017 is to new to work but how to default lua rocks to mingw gcc rather than cl.exe to build libraries????) or something installs then I am struggling to find out how its installed (not from source, presumed though???)or sample code to check such a luarock has installed.

How to compile Boost on Windows 10 with Visual Studio

I'm working on a new project which requires Boost's regex library. I was able to use the no-compile headers, but needed some of the binaries which require being compiled. Boost's documentation for compiling in Visual Studio wasn't very helpful (resulted in several errors) and I've seen a fair number of people online having these same problems, but it took a lot of Googling to get them all, so I've included detailed steps below to help anyone with the same issues.
I'm running Windows 10 preview and Visual Studio 11 (2012), but the steps should work for other versions as well.
Step 1 - Set up a developer command prompt in Visual Studio
You will need this to compile the binaries. The VS Command window (Ctrl+W,A) didn't seem to work.
1. In VS , select "Tools" at the top, then select "External Tools" and enter the following:
-Title: "VS2013 Native Tools-Command Prompt" (your choice)
-Command: C:\Windows\System32\cmd.exe
-Arguments: /k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat" (make sure to use the correct path to your version of VS)
-Initial Directory: Select as suits your needs (if you'll use boost a bunch, I'd select the folder where you dropped boost)
2. Click OK. Now you have command prompt access under the same "Tools" menu, where it will show up as a new option.
Source: https://stackoverflow.com/questions/21476588/where-is-developer-command-prompt-for-vs2013
Step 2 - Run Bootstrap.bat from VS developer command prompt
1. Navigate to your Boost folder (mine is C:\Program Files\boost\boost_1_58_0)
2. Run `.\Bootstrap.bat` which results in the following error:
> 'cl' is not recognized as an internal or external command"
Cl.exe is is a tool that controls the Microsoft C and C++ compilers and linker. This error is because cl.exe is not in your path environment variable; it isn't automatically added when you install VS. Check by running the following:
-In PowerShell - `($env:path).replace(';',"`n")` (easy to read)
-In cmd.exe - `echo %path%` (harder to read)
4. Add cl.exe to your path by adding its parent folder "C:\Program Files (x86)\Microsoft Visual Studio [your version]\VC\bin"
-Hit Win+X -> System -> Advanced System Settings -> Environment Variables -> Select "Path" under System Variables (in bottom pane) -> Edit -> paste the following to the end: ";C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin" (don't forget the semicolon on the front)
-Test by opening a new command prompt or PowerShell window and type `cl.exe -?`
Step 3 - Re-run bootstrap with cl.exe in your path
You may be missing some environment variables for Visual Studio, resulting in the following error:
mspdb110.dll not found
1. Navigate to the Visual Studio path in your Visual Studio developer command prompt (for me it's C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin)
2. Run `.\vcvars32.bat` which automatically sets some variables for you, but there is no output -- lack of error means likely success
Step 4 - Compile the Boost binaries
Now running .\Bootstrap.bat in your Visual Studio developer command prompt should succeed and you can now use the binaries in your project!

SCons - 'rc' is not recognized as an internal or external command, operable program or batch file

I have set-up everything according to instructions on https://github.com/TideSDK/TideSDK/wiki/Windows7-x86-2005
But, scons won't pick up "rc" from PATH:
> scons -s debug=1 sdkinstaller run=1
...
runs fine for a while, until:
...
cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be
removed in a future release
cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be
removed in a future release
boot_win32.cpp
'rc' is not recognized as an internal or external command,
operable program or batch file.
scons: *** [build\win32\objs\boot\support\winboot.res] Error 1
> rc
fatal error RC1107: invalid usage; use RC /? for Help
> echo %path%
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsof
t Visual Studio 8\VC\BIN;C:\Program Files\Microsoft Visual Studio 8\Common7\Tool
s;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin;C:\WINXP\Microsoft.NET
\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages;C
:\Program Files\ImageMagick-6.8.0-Q16;C:\WINXP\system32;C:\WINXP;C:\WINXP\System
32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Git\cmd;C:\Program
Files\Git\bin;C:\Python25\Scripts;C:\Python25
Googling on this matter suggests the solution to add the VC bin directory to PATH, but as you can see, that is already in place.
Note: I installed and used scons 2.2.0 as well, but then it wouldn't even recognize "cl". At least with scons 1.2.0 it recognizes "cl", but unfortunately not "rc"
First time building on Windows, any advice appreciated!
Virtual machines are cheap and accessible. I'd recommend a clean build environment that is not polluted by several SDK versions.
Might help for someone else, but Visual Studio has it's own CMD which will have these path set. Just open corresponding Visual Studio CMD and compile from there.

Windows SDK 7.1 command prompt LNK1104

I just installed Windows SDK 7.1 on Windows XP Professional with SP3. Now I'm checking to see if the installation is OK and, already, I'm having a problem. I still cannot get cl.exe compile a simple hello world C++ code from the Windows SDK 7.1 Command Prompt. Here is a snapshot of command prompt output:
Setting SDK environment relative to C:\Program Files\Microsoft SDKs\Windows\v7.1\.
Targeting Windows XP x86 Debug
C:\Program Files\Microsoft SDKs\Windows\v7.1>cd /d "D:\My Documents\Sources"
D:\My Documents\Sources>cl /EHsc /FeD:\Target\hello hello.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
hello.cpp
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
LINK : fatal error LNK1104: cannot open file 'C:\Documents'
I tried moving hello.cpp to D:\ and ended up with the same result. CSC.exe, on the other hand, compiled a hello world C# code in the same command prompt without a hitch. What should I do now?
Note that I do not have any version of Visual Studio installed. I installed Windows SDK so that I can use Qt Framework 4.8.0 for VS2010 in Qt Creator and learn a little bit of C# in SharpDevelop.
Some people adviced me to wrap all environment variable values containing C:\Documents and Settings\ in double quotes, e.g.: Set ALLUSERSPROFILE="C:\Documents and Settings\All Users", Set USERPROFILE="C:\Documents and Settings\Ant Luc", and so forth. There was no sane way to perform the modification, except for %TEMP% and %TMP%, since they were not available for editing through System Properties > Advanced > Environment Variables. So I edited C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd and added the following lines right below #ECHO OFF:
SET ALLUSERSPROFILE="C:\Documents and Settings\All Users"
SET USERPROFILE="C:\Documents and Settings\Ant Luc"
SET HOMEPATH="C:\Documents and Settings\Ant Luc"
SET APPDATA="%USERPROFILE%\Application Data"
SET TEMP="%USERPROFILE%\Local Settings\Temp"
SET TMP="%USERPROFILE%\Local Settings\Temp"
But I then got Error C1083 when compiling the hello world code with cl.exe. In desperation, I edited C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd again, and changed the value for %TMP% to D:\VSTEMP, created a directory called VSTEMP in D:\, tried to compile the source code again, and sighed in relief because it finally compiled successfully.
I decided to grab and install Visual Studio 2010 Express out of curiosity, opened Visual Studio Command Prompt, tried to compile the same hello world code, and was faced with the same set of problems which I fixed with the same workaround. Conclusion: the compiler (or linker) cannot properly handle whitespace in %TMP% -- assign a directory without a single whitespace to it.
I still do not know what is wrong with my setup, but all this hassle seems stupid anyway. FWIW, this is the first toolchain that made me jump through hoops just to get a hello world code compile successfully.

Resources