You can now build chrome/win on your linux box

596 views
Skip to first unread message

Nico Weber

unread,
Oct 23, 2017, 4:07:50 PM10/23/17
to Chromium-dev
Hi,

as of #510853 it's possible to build chrome/win and all test binaries on your linux box. You can also run test binaries you build that way on swarming.

https://chromium.googlesource.com/chromium/src/+/master/docs/win_cross.md tells you how to do this. It's easy to set up too.

Let me know if this is useful, and if you end up using this for anything.

Nico

Scott Graham

unread,
Oct 23, 2017, 4:26:24 PM10/23/17
to Nico Weber, Chromium-dev
That's great!

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAMGbLiFxSXCwC4Gm6kpj7fYUR7YiQy6Uq_rf2-ATwqPNbX8SBA%40mail.gmail.com.

Roger Wang

unread,
Oct 23, 2017, 8:09:44 PM10/23/17
to Chromium-dev
This is great news. In terms of performance should it be the same with Windows native build if I don't use PGO?

Nico Weber

unread,
Oct 23, 2017, 8:15:52 PM10/23/17
to wen...@gmail.com, Chromium-dev
I haven't done build benchmarking. I'd expect it to be about as fast: Linux tends to be a bit faster for builds, but then again you now need to build a few things twice, once for the host and once for the target, so it might roughly even out. I haven't measured though.

On Mon, Oct 23, 2017 at 8:09 PM, Roger Wang <wen...@gmail.com> wrote:
This is great news. In terms of performance should it be the same with Windows native build if I don't use PGO?
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
    http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.

Roger

unread,
Oct 23, 2017, 8:18:16 PM10/23/17
to Nico Weber, Chromium-dev
I should say I meant the performance of the final chrome binary, not build time performance. Thanks in advance.

Michael Giuffrida

unread,
Oct 23, 2017, 8:34:47 PM10/23/17
to Chromium-dev
Awesome! But how does this work? Can the binaries actually run on Windows? (the swarming example seems to imply yes)

I thought building on Windows required Visual Studio and some of the used the Visual C++ toolchain.

Michael

Tom Anderson

unread,
Oct 23, 2017, 9:22:54 PM10/23/17
to mich...@chromium.org, Chromium-dev
Great work!  I'll definitely be a user of this feature!

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/34639336-6bdf-4ee5-8ec4-682184b52477%40chromium.org.

Nico Weber

unread,
Oct 23, 2017, 11:05:42 PM10/23/17
to Roger, Chromium-dev
On Tue, Oct 24, 2017 at 12:17 AM, Roger <wen...@gmail.com> wrote:
I should say I meant the performance of the final chrome binary, not build time performance. Thanks in advance.

The final chrome binary should be identical to what you get when you build with clang on Windows, with one exception: The skia software rendering fast path is not active, as described on https://chromium.googlesource.com/chromium/src/+/master/docs/win_cross.md (this will hopefully work too eventually though).

Nico Weber

unread,
Oct 23, 2017, 11:12:44 PM10/23/17
to Michael Giuffrida, Chromium-dev
On Tue, Oct 24, 2017 at 12:34 AM, Michael Giuffrida <mich...@chromium.org> wrote:
Awesome! But how does this work? Can the binaries actually run on Windows? (the swarming example seems to imply yes)

Yes, you get the same binary as if you built on Windows.
 
I thought building on Windows required Visual Studio and some of the used the Visual C++ toolchain.

It requires the Windows SDK to get .h and .lib files, yes. If you follow the steps on https://chromium.googlesource.com/chromium/src/+/master/docs/win_cross.md, then `gclient sync` will automatically put the SDK in third_party/depot_tools/win_toolchain/vs_files/<some hash> (if you're on the Google network. Else, you have to get it on your Linux box yourself somehow.) It automatically gets added to a case-insensitive user space mount so that `#include <windows.h>` can find Windows.h.

The build then uses the Linux clang binary as compiler, which in addition to being able to produce Linux ELF files, can just as well produce Windows COFF files (or Mac Mach-O files). The build uses the same lld binary that we use to link chrome/linux to produce the chrome/win PE/COFF binary. Compiler and linker were the big parts, but we also reimplemented the resource compiler (see build/toolchain/win/rc/README.md), taught lld to do the work of cvtres.exe and mt.exe, stubbed out the handful uses of rc.exe and midl.exe (see third_party/win_build_output/README.chromium), and stubbed out the three dependencies on ml.exe (see the note on .asm files on https://chromium.googlesource.com/chromium/src/+/master/docs/win_cross.md). Also, there was a long tail of smaller issues, see https://crbug.com/495204 and blockers for details.

As a result, we don't have to run any binaries from the Windows SDK, all work can be done by open-source tools.

Thanks for the question :-)
 

Michael

On Monday, October 23, 2017 at 1:07:50 PM UTC-7, Nico Weber wrote:
Hi,

as of #510853 it's possible to build chrome/win and all test binaries on your linux box. You can also run test binaries you build that way on swarming.

https://chromium.googlesource.com/chromium/src/+/master/docs/win_cross.md tells you how to do this. It's easy to set up too.

Let me know if this is useful, and if you end up using this for anything.

Nico

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.

Lei Zhang

unread,
Oct 24, 2017, 12:56:22 AM10/24/17
to Nico Weber, Chromium-dev
Does this mean we are one step closer to having Windows-only code
indexed on cs.chromium.org?

On Mon, Oct 23, 2017 at 1:06 PM, Nico Weber <tha...@chromium.org> wrote:
> --
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
> ---
> You received this message because you are subscribed to the Google Groups
> "Chromium-dev" group.
> To view this discussion on the web visit
> https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAMGbLiFxSXCwC4Gm6kpj7fYUR7YiQy6Uq_rf2-ATwqPNbX8SBA%40mail.gmail.com.

PhistucK

unread,
Oct 24, 2017, 2:14:52 AM10/24/17
to Lei Zhang, Nico Weber, Chromium-dev
Woo hoo! This sounds miraculous. :)
Congratulations!

Can someone elaborate the documentation for non-Googlers a bit more?
"and you’ll need to put a JSON file describing the SDK layout in a certain location"
Is way too vague and lazy to be in the documentation...


PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.

Nico Weber

unread,
Oct 24, 2017, 2:48:08 AM10/24/17
to PhistucK, Lei Zhang, Chromium-dev
Someone motivated needs to figure out how the non Googler bits should work. The chromium build in principle does something like https://github.com/nico/hack/blob/3add7d1a010ac8e2bbc431c9953ecfa243cb975d/res/distrib.py#L47 (see the json file linked from there for what's in the json file). Something needs to create a json file for the VC files on disk, and the location of that json file needs to be communicated to the chromium build. The reason that doc is vague is because it's not done yet :-) It should be fairly easy to do though. If someone feels motivated, feel free to reach out off list to discuss details, or just send me a patch.

Primiano Tucci

unread,
Oct 24, 2017, 6:19:48 AM10/24/17
to tha...@chromium.org, PhistucK, Lei Zhang, Chromium-dev
Woa this is really awesome.
Thanks a lot to all the people who did put / are putting efforts to make this happen!



PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.

Jeremy Roman

unread,
Oct 24, 2017, 10:17:38 AM10/24/17
to Primiano Tucci, Nico Weber, PhistucK, Lei Zhang, Chromium-dev
Amazing.



PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAMGbLiG84jntwfHF-gvWxRENfEALGkFr2wQtH5OANKMpURxaQQ%40mail.gmail.com.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.

Ryan Landay

unread,
Oct 25, 2017, 4:54:58 PM10/25/17
to jbr...@chromium.org, Primiano Tucci, Nico Weber, PhistucK, Lei Zhang, Chromium-dev
Is there a feasible way to actually build Chrome for Windows on Linux and run it on a Windows machine? chrome.exe is one of 74 GB worth of files generated when I build the chrome target, and I’m not sure which files I would need to copy over to a Windows computer to actually run them. The webpage notes that mini_installer does not yet build properly, so that’s out as a potential solution.

Lei Zhang

unread,
Oct 25, 2017, 5:02:30 PM10/25/17
to Ryan Landay, Jeremy Roman, Primiano Tucci, Nico Weber, PhistucK, Chromium-dev
If you are doing a non-component build, then just grab the same list
of files as chrome-win32.zip from the continuous build. e.g. here's a
random example https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/506404/
>>>> an email to chromium-dev...@chromium.org.

Michael Giuffrida

unread,
Oct 25, 2017, 5:53:26 PM10/25/17
to tha...@chromium.org, Chromium-dev
The real question is, can we now use the process of building Chrome for Windows on Linux to build Chrome for Windows in the Windows Subsystem for Linux on Windows, then run that in Windows? We've mostly got Chrome for Linux built in Windows Subsystem for Linux on Windows working from Windows Subsystem for Linux but there are some issues running from an environment without things like dbus and WSL is still incomplete.

--

Marc-Antoine Ruel

unread,
Oct 25, 2017, 6:00:34 PM10/25/17
to rla...@chromium.org, Jeremy Roman, Primiano Tucci, Nico Weber, PhistucK, Lei Zhang, Chromium-dev
The "right" answer is to use the GN data deps description, as it is what is used for Swarming based isolated testing, so it is guaranteed to work correctly as this is tested as part of the commit queue. The "right" frontend for this is mb.py, but improvements are needed (and help is appreciated!) in this area.

M-A

Christian Dullweber

unread,
Oct 26, 2017, 4:24:40 AM10/26/17
to mich...@chromium.org, Nico Weber, Chromium-dev
According to https://bugs.winehq.org/show_bug.cgi?id=21232 it might be possible to build Chrome for Windows on Linux and run it (without a sandbox) in Wine on Linux ;)

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.

Nico Weber

unread,
Oct 26, 2017, 7:35:38 AM10/26/17
to Christian Dullweber, Michael Giuffrida, Chromium-dev
I haven't tried it, but https://bugs.winehq.org/show_bug.cgi?id=43415 suggests that running doesn't work. And building now works naively, without need for wine.

Jamie Madill

unread,
Oct 26, 2017, 3:14:43 PM10/26/17
to Nico Weber, wen...@gmail.com, Chromium-dev
Following up to the performance question, specifically for build times, is it possible to build only once for the cross-compiled Windows target? I'm curious, if this is much faster, could we use it on some testing bots to speed up the compile step?

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.

Joel Hockey

unread,
Nov 15, 2017, 6:16:01 PM11/15/17
to jma...@google.com, Nico Weber, wen...@gmail.com, Chromium-dev
I've just tried building now and I get error: unable to find mt.exe in PATH

It looks like this is being tracked in crbug.com/781873


Nico Weber

unread,
Jan 15, 2018, 9:58:26 AM1/15/18
to Ryan Landay, Jeremy Roman, Primiano Tucci, PhistucK, Lei Zhang, Chromium-dev
On Wed, Oct 25, 2017 at 4:53 PM, Ryan Landay <rla...@chromium.org> wrote:
Is there a feasible way to actually build Chrome for Windows on Linux and run it on a Windows machine? chrome.exe is one of 74 GB worth of files generated when I build the chrome target, and I’m not sure which files I would need to copy over to a Windows computer to actually run them. The webpage notes that mini_installer does not yet build properly, so that’s out as a potential solution.

Short update: As of last week, building mini_installer works in cross builds. (I still need to update the win_cross.md doc to mention this.)

Nico Weber

unread,
Jun 25, 2018, 7:58:50 AM6/25/18
to PhistucK, Lei Zhang, Chromium-dev, Henrique Ferreiro
hferreiro made it so that non-Googlers can use the cross build too -- thanks much! https://chromium.googlesource.com/chromium/src/+/master/docs/win_cross.md#gclient-setup documents how to do it, look for "If you are not at Google".



PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

Min Qin

unread,
Jun 28, 2018, 7:05:20 PM6/28/18
to tha...@chromium.org, PhistucK, the...@chromium.org, chromium-dev, hfer...@igalia.com
I build mini_installer and copied the file to a windows 10 machine, but it complains "unable to find local data files, please reinstall"
I also copied chrome.exe to the same windows 10 machine, and it complains "the application failed to start because side-by-side configutation is incorrect". 

Am I missing something?

Thanks
Min

Nico Weber

unread,
Jun 28, 2018, 7:34:57 PM6/28/18
to Min Qin, PhistucK, Lei Zhang, Chromium-dev, Henrique Ferreiro
Can you file a bug with your args.gn and the exact commands you ran? Thanks!

Min Qin

unread,
Jun 28, 2018, 7:57:46 PM6/28/18
to tha...@chromium.org, PhistucK, the...@chromium.org, chromium-dev, hfer...@igalia.com
Done. 858874 filed

Nico Weber

unread,
Feb 28, 2019, 10:37:59 AM2/28/19
to Chromium-dev
Short update: goma now works for win/cross builds, with some env vars set. https://chromium.googlesource.com/chromium/src/+/HEAD/docs/win_cross.md#goma has the details.

Albert J. Wong (王重傑)

unread,
Feb 28, 2019, 2:16:53 PM2/28/19
to Nico Weber, Chromium-dev
Okay, that's pretty awesome.

Thank you.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
Reply all
Reply to author
Forward
0 new messages