blob: 9568ee4b7d6c403d92a5092ba88c33b53b175ac4 [file] [log] [blame] [view]
Nico Weberbf97a6d12017-10-13 17:40:021# Cross-compiling Chrome/win
2
Nico Weber495e9552017-10-23 20:03:073It's possible to most parts of the codebase on a Linux (and soon, Mac) host
Nico Weberbf97a6d12017-10-13 17:40:024while targeting Windows. This document describes how to set that up, and
5current restrictions.
6
7What does *not* work:
8
Nico Weber495e9552017-10-23 20:03:079* goma. Sorry. ([internal bug](b/64390790)) You can use the
10 [jumbo build](jumbo.md) for faster build times.
11* mini_installer ([bug](https://crbug.com/762073))
Nico Weberbf97a6d12017-10-13 17:40:0212* linking on Mac ([bug](https://crbug.com/774209)), should change soon
13
Nico Weber495e9552017-10-23 20:03:0714All other targets build fine (including `chrome`, `browser_tests`, ...).
15
16Uses of `.asm` files have been stubbed out. As a result, some of skia's
17software rendering paths are not present in cross builds, crashpad cannot
18report crashes, and NaCl defaults to disabled and cannot be enabled in
19cross builds ([.asm bug](https://crbug.com/762167).
Nico Weberbf97a6d12017-10-13 17:40:0220
21## .gclient setup
22
231. Tell gclient that you need Windows build dependencies by adding
24 `target_os = ['win']` to the end of your `.gclient`. (If you already
25 have a `target_os` line in there, just add `'win'` to the list.)
261. `gclient sync`, follow instructions on screen.
27
28If you're at Google, this will automatically download the Windows SDK for you.
29If you are not at Google, you'll have to figure out how to get the SDK, and
30you'll need to put a JSON file describing the SDK layout in a certain location.
31
32# GN setup
33
34Add `target_os = "win"` to your args.gn. Then just build, e.g.
35
36 ninja -C out/gnwin base_unittests.exe
37
38# Running tests on swarming
39
40You can run the Windows binaries you built on swarming, like so:
41
42 tools/mb/mb.py isolate //out/gnwin base_unittests
43 tools/swarming_client/isolate.py archive \
44 -I https://isolateserver.appspot.com \
45 -i out/gnwin/base_unittests.isolate \
46 -s out/gnwin/base_unittests.isolated
47 tools/swarming_client/swarming.py trigger \
48 -S https://chromium-swarm.appspot.com \
49 -I https://isolateserver.appspot.com \
50 -d os Windows -d pool Chrome -s <hash printed by previous command>
51
52Most tests that build should pass. However, the cross build uses
53the lld linker, and a couple of tests fail when using lld. You can look at
54https://build.chromium.org/p/chromium.clang/builders/CrWinClangLLD%20tester
55to get an idea of which tests fail with lld.
56
57TODO(thakis): It'd be nice if there was a script for doing this. Maybe make
58tools/fuchsa/run-swarmed.py work for win cross builds too, or create
59`run_base_unittests` script targets during the build (like Android).