BuildAndTestChromium

Building and Testing Chromium under Wine

UnitTestSuites asks the musical question "Can Wine be used as a Win32 development platform?"

For Chromium, it looks like the answer is a qualified "yes".

Building Chromium under Wine using Visual C++ 2005

For the moment, to work around some msi bugs, you'll need to install Visual C++ and its service packs and hotfixes on a Windows system and copy its directory tree over to Wine. Here's how:

  • Boot Windows, then install cygwin with cabextract, unzip, and wget.
  • Using cygwin, do

wget http://winezeug.googlecode.com/svn/trunk/attic/winetricks 
sh winetricks vc2005trial vc2005sp1 vc2005hotfix vc2005save
  • This creates a tarball named vc8.tgz which you will need later.
  • Boot Linux, then get a copy of the Winezeug repository (it's small) with

svn checkout http://winezeug.googlecode.com/svn/trunk/ winezeug 
  • Put a copy of the vc8.tgz you created earlier in winezeug/testsuites/chromium
  • Read winezeug/testsuies/chromium/build.sh before you run it in the following steps

  • In winezeug/testsuites/chromium, do

sh build.sh setup 

This will get the Chromium source code, and install visual C++ and the Windows SDK in ~/.wine-chromium-test. It takes 40 minutes (on a cable modem in California) to download the source, and a couple hours to install the tools.

  • In winezeug/testsuites/chromium, do

sh build.sh chrome 

This will build chrome. This takes 3.5 hours on a Q9330, 2 hours if you enable parallel build (see top of build.sh).

  • Do

sh build.sh run 

to try out your newly built chromium.

devenv.exe may put up a crash dialog during build, but it sometimes keeps building until you dismiss the dialog. Doesn't seem to harm the resulting binaries, you just have to run the build again, and it will pick up where it left off. The crashes seem to happen during "sh build.sh build webcore_bindings_sources" and possibly again at the very end of linking.

Testing Chromium under Wine

Once the above steps are working, you can build and run Chromium unit tests, either with or without Valgrind, e.g.

sh build.sh tests
sh chromium-runtests.sh base_unittests net_unittests unit_tests
sh chromium-runtests.sh --valgrind base_unittests

See 'sh chromium-runtests.sh --help' for more options. (Note: you may need to edit this script to point it to your valgrind and wine!)

The 'tests' and 'chrome' verbs in build.sh are convenient, but they're kind of demos. Read the script if you want more control.

Wine bugs currently exposed by the above recipe

Draft patches attached where indicated; the recipe works around the others. (Except for speed; Wine is slower than Windows at this task still.)

  • 19668 cmd /c doesn't wait for result before exiting?

  • 19799 cscript crashes if you call WScript.Arguments(0)

  • 21174 cmd does not support /a arithmetic expression evaluation

  • 21259 Visual C++ 2005 Trial build hangs on first run after a reboot

  • 21362 Windows 7 Platform SDK install fails to set important registry keys?

  • 21381 cmd: call + builtin cmd.exe command doesn't work

  • 21423 Visual C++ 2005 slow

  • 21424 cygwin 1.7 bash has errors during startup, can't install gcc

  • 21596 Windows 7 Platform SDK default install fails

The UCLA CS130 students are going to tackle bug 21174 and maybe also 21381.

Wine bugs already fixed

Most of the bugs exposed by building and testing Chromium have already been fixed. Thanks to Codeweavers, Rob Shearman, Juan Lang, Eric Pouech, and everyone else who helped fix them!

Here's a list of the ones fixed since the UnitTestSuites project started (i.e. since about Sept '09):

  • 835 Add support for the new PDB format (e.g. fix backtraces with visual c++ 2005/2008)

  • 11511 Visual C++ 2008 Express edition fails to install

  • 14168 visual studio 2005 installer too slow, msi O(n^2) behavior?

  • 14930 MSI doesn't overwrite readonly files properly (might affect .net 2)

  • 17096 Visual C++ 2005 Trial can't build project, complains when starting mspdbsrv

  • 17810 Base unittests for chromium don't complete under Wine

  • 17813 Net unittests for chromium fail under Wine

  • 18479 can't write to stdout in msys

  • 18921 O(n) hash_table_add causes winedbg to take 20 minutes to dump stack when chromium crashes

  • 19502 Visual Studio 2005 SP1 install seems to fail

  • 19533 reg.exe can't set DWORD values

  • 19581 Visual Studio 2005: "cl : Command line error D8022 : cannot open 'foo.rsp' "; foo.rsp was created with FILE_ATTRIBUTE_TEMPORARY

  • 19636 Vista SDK installer fails in "Microsoft VC Redist 2008" subinstaller

  • 19673 Microsoft Platform Installer 2003 fails to install

  • 19780 MSVC 8 Express's mt.exe doesn't run properly under cygwin bash; breaks firefox build

  • 19781 Visual C++ 2005 Express: -Zi option doesn't work; breaks Firefox build's configure script

  • 19783 Visual C++ 2005 Express: building Firefox: mt.exe crashes while linking mkdepend

  • 19809 all cygwin apps crash on exit if run outside wineconsole

  • 19912 gyp fails its test suite, can't build hello, world with Visual C++ 8's devenv.exe

  • 20227 Visual Studio 2008 Standard install fails

  • 20337 CryptImportKey fails in chromium's base_unittests.exe in HMACTest.HmacSafeBrowsingResponseTest

  • 20353 chromium ipc_tests.exe fails when KERNEL32.GetQueuedCompletionStatus() hangs on peer disconnect of named pipe?)

  • 20358 chromium's base_unittests.exe fails on RSAPrivateKeyUnitTest.*

  • 20368 sockaddr_in6 wrong size; causes chromium's net_unittests HostResolverImplTest.NumericIPv6Address test case to fail

  • 20370 chromium net_unittests.exe fail ssl tests because they can't check for root cert

  • 20372 WS2_register_async_shutdown forgets to initialize local_iosb.Information to zero?

  • 20495 CryptUnprotectData can't handle zero-length payloads

  • 20619 chromium's unit_tests.exe's RenderViewTest.PrintLayoutTest fails with FATAL:image.cc(211)] Check failed: rect.x() == 0 (-1 vs. 0)

  • 20622 chromium's net_unittests.exe hangs in SSLClientSocketTest.Read

  • 20626 Chromium's unit_tests.exe's DownloadManagerTest.TestDownloadFilename fails

  • 20627 chromium's base_unittests's StackTrace.OutputToStream fails (RtlCaptureStackBackTrace unimplemented)

  • 21382 %~dp0 doesn't work properly

  • 21206 cygwin 1.7 doesn't work on Wine

  • 21322 Setting a user-specific PATH cause systemwide one to be ignored (affects Platform SDK)

  • 21490 Debug build of Chromium aborts on startup because GdiInitializeLanguagePack() is too stubby?

Bugs in other packages exposed by the above recipe:

  • 21484 The "make -j2" invoked by chromium's webkit build aborts early? (invalid, Cygwin's doc says "don't use -j")

BuildAndTestChromium (last edited 2011-11-04 16:36:52 by fracting)