Checking out and Building Chromium for Windows

1,315 views
Skip to first unread message

Conor Gorman

unread,
Mar 16, 2017, 12:43:09 PM3/16/17
to Chromium-dev

Hi all, I'm trying to set up the chromium build but keep getting the same error when I try.
I've attached a screenshot also. ( It's when i try the line 'gn gen out/Default')
Any ideas?

Cheers.

Nico Weber

unread,
Mar 16, 2017, 12:47:03 PM3/16/17
to conor...@gmail.com, Chromium-dev
The first error message says that it can't find VS2015. Do you have Visual Studio 2015 installed?

--
--
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/473afc86-ca14-4de4-9c40-cd8a60eaec10%40chromium.org.

Conor Gorman

unread,
Mar 16, 2017, 12:50:38 PM3/16/17
to Chromium-dev, conor...@gmail.com
I've got VS 2017 installed, I assumed the more recent version would not cause any errors.

Nico Weber

unread,
Mar 16, 2017, 12:52:56 PM3/16/17
to conor...@gmail.com, Chromium-dev
Building with 2017 isn't supported yet. https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md has the build instructions, it's pretty explicit about that.

Conor Gorman

unread,
Mar 16, 2017, 3:08:33 PM3/16/17
to Chromium-dev, conor...@gmail.com
Hey, still getting the same error for the 'gn gen out\Default' command.

Nico Weber

unread,
Mar 16, 2017, 3:16:59 PM3/16/17
to conor...@gmail.com, Chromium-dev
Did you run `gclient sync` again? The error was during syncing, and gn errors out because the sync didn't complete.

Conor Gorman

unread,
Mar 16, 2017, 3:41:33 PM3/16/17
to Chromium-dev, conor...@gmail.com
I did yes, and it looked like it ran through successfully. 
Same error. Killing me here. 

Conor Gorman

unread,
Mar 16, 2017, 3:44:28 PM3/16/17
to Chromium-dev

There is a separate error now, I will post another screenshot.

Nico Weber

unread,
Mar 16, 2017, 4:12:22 PM3/16/17
to conor...@gmail.com, Chromium-dev
What's the output of `where python`? What's the output of `echo %PATH%`? Note that the build instructions say that depot_tools must be at the front of your %PATH%. (It contains a python binary that's known to work with the build.)

--
--
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.

Conor Gorman

unread,
Mar 16, 2017, 4:19:04 PM3/16/17
to Chromium-dev, conor...@gmail.com

Nico Weber

unread,
Mar 16, 2017, 4:23:54 PM3/16/17
to conor...@gmail.com, Chromium-dev

Conor Gorman

unread,
Mar 16, 2017, 4:31:45 PM3/16/17
to Chromium-dev, conor...@gmail.com
where gn..

F:\>where gn
F:\Desktop\depot_tools\gn
F:\Desktop\depot_tools\gn.bat
F:\Desktop\depot_tools\gn.py

git status was quite long ill post the end if you need more i can update.


Unmerged paths:
  (use "git reset HEAD <file>..." to unstage)
  (use "git add <file>..." to mark resolution)

        both added:      .gitignore
        both added:      LICENSE
        both added:      OWNERS
        both added:      PRESUBMIT.py
        both added:      WATCHLISTS
        both added:      codereview.settings
        both added:      infra/README.md
        both added:      infra/config/OWNERS
        both added:      infra/config/cq.cfg
        both added:      third_party/colorama/README.chromium
        both added:      third_party/logilab/README.chromium
        both added:      third_party/pylint/README.chromium
        both added:      third_party/simplejson/__init__.py
        both added:      third_party/simplejson/decoder.py
        both added:      third_party/simplejson/encoder.py


It took 3.71 seconds to enumerate untracked files. 'status -uno'
may speed it up, but you have to be careful not to forget to add
new files yourself (see 'git help status').

Nico Weber

unread,
Mar 16, 2017, 4:36:57 PM3/16/17
to conor...@gmail.com, Chromium-dev
Looks like your git checkout is in a bad state for some reason. If `git branch` doesn't say `* master`, run `git rebase --abort` and `git checkout -f master`. Then run `git reset --hard origin/master` (independent of the output of `git branch` in the last sentence). If that doesn't help, run `git clean -f -d` followed by `gclient sync` again and try again.

If things still don't work, paste the output of `type ..\.gclient`.

--
--
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.

Conor Gorman

unread,
Mar 16, 2017, 5:20:48 PM3/16/17
to Chromium-dev
F:\Desktop\chromium2\src>type ..\.gclient
solutions = [
  {
    "managed": False,
    "name": "src",
    "deps_file": ".DEPS.git",
    "custom_deps": {},
  },
]

Conor Gorman

unread,
Mar 16, 2017, 5:21:31 PM3/16/17
to Chromium-dev
also 

F:\Desktop\chromium2\src>gn gen out/Default
ERROR Can't find source root.
I could not find a ".gn" file in the current directory or any parent,
and the --root command-line argument was not specified.

if that helps in any way.

On Thursday, March 16, 2017 at 4:43:09 PM UTC, Conor Gorman wrote:

Nico Weber

unread,
Mar 16, 2017, 6:09:18 PM3/16/17
to Conor Gorman, Chromium-dev
What was the output of all the git commands?

Your checkout sounds super busted if there's no .gn file. Try following the
checkout and build instructions letter by letter anew.

--
--
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.

Conor Gorman

unread,
Mar 16, 2017, 6:16:32 PM3/16/17
to Chromium-dev
Hi Nico,
I've left the workstation where I was operating from, but you're helping a lot and I wondered if it would be ok to pickup tomorrow morning (GMT) where we left off? I should have the git command responses and I can do another fresh checkout if need be?

Thanks very much for your help this far.

Bruce

unread,
Mar 16, 2017, 9:12:07 PM3/16/17
to Chromium-dev
Regarding VS 2017, it is possible to build with VS 2017, I've been doing that for a few days, but it is unsupported and untested and could break at any moment.

The tracking bug is crbug.com/683729. You need:

set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GYP_MSVS_VERSION=2017

And, because there is still one unresolved warning you will need this in your args.gn:

treat_warnings_as_errors = false

If you try this and hit any VS 2017 specific problems then I can try to help resolve them, but because it's unsupported there are no guarantees.

Conor Gorman

unread,
Mar 17, 2017, 11:51:54 AM3/17/17
to Chromium-dev
So I've redone a Checkout and may have ran into another error.



F:\Desktop\chromium>fetch --no-history chromium
Running: 'F:\Desktop\depot_tools\python276_bin\python.exe' 'F:\Desktop\depot_too
ls\gclient.py' root
Running: 'F:\Desktop\depot_tools\python276_bin\python.exe' 'F:\Desktop\depot_too
ls\gclient.py' config --spec 'solutions = [
  {
    "managed": False,
    "name": "src",
    "deps_file": ".DEPS.git",
    "custom_deps": {},
  },
]
'
Running: 'F:\Desktop\depot_tools\python276_bin\python.exe' 'F:\Desktop\depot_too
ls\gclient.py' sync --no-history
Running: 'F:\Desktop\depot_tools\git.bat' submodule foreach 'git config -f $topl
evel/.git/config submodule.$name.ignore all'
Running: 'F:\Desktop\depot_tools\git.bat' config --add remote.origin.fetch '+ref
s/tags/*:refs/tags/*'
Running: 'F:\Desktop\depot_tools\git.bat' config diff.ignoreSubmodules all

F:\Desktop\chromium>cd src

F:\Desktop\chromium\src>gn gen out/Default
Traceback (most recent call last):
  File "F:/Desktop/chromium/src/build/vs_toolchain.py", line 457, in <module>
    sys.exit(main())
  File "F:/Desktop/chromium/src/build/vs_toolchain.py", line 453, in main
    return commands[sys.argv[1]](*sys.argv[2:])
  File "F:/Desktop/chromium/src/build/vs_toolchain.py", line 323, in CopyDlls
    _CopyDebugger(target_dir, target_cpu)
  File "F:/Desktop/chromium/src/build/vs_toolchain.py", line 343, in _CopyDebugg
er
    _CopyRuntimeImpl(target_path, full_path)
  File "F:/Desktop/chromium/src/build/vs_toolchain.py", line 200, in _CopyRuntim
eImpl
    shutil.copy2(source, target)
  File "F:\Desktop\depot_tools\python276_bin\lib\shutil.py", line 130, in copy2
    copyfile(src, dst)
  File "F:\Desktop\depot_tools\python276_bin\lib\shutil.py", line 82, in copyfil
e
    with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: 'C:\\Program Files (x86)\\Windows
Kits\\10\\Debuggers\\x64\\cdb.exe'
ERROR at //build/toolchain/win/BUILD.gn:39:3: Script returned non-zero exit code
.
  exec_script("../../vs_toolchain.py",
  ^----------
Current dir: F:/Desktop/chromium/src/out/Default/
Command: F:/Desktop/depot_tools/python276_bin/python.exe -- F:/Desktop/chromium/
src/build/vs_toolchain.py copy_dlls F:/Desktop/chromium/src/out/Default Debug x6
4
Returned 1 and printed out:

Copying C:\Windows\Sysnative\msvcp140.dll to F:/Desktop/chromium/src/out/Default
\msvcp140.dll...
Copying C:\Windows\Sysnative\vccorlib140.dll to F:/Desktop/chromium/src/out/Defa
ult\vccorlib140.dll...
Copying C:\Windows\Sysnative\vcruntime140.dll to F:/Desktop/chromium/src/out/Def
ault\vcruntime140.dll...
Copying C:\Windows\Sysnative\ucrtbase.dll to F:/Desktop/chromium/src/out/Default
\ucrtbase.dll...
Copying C:\Windows\Sysnative\msvcp140d.dll to F:/Desktop/chromium/src/out/Defaul
t\msvcp140d.dll...
Copying C:\Windows\Sysnative\vccorlib140d.dll to F:/Desktop/chromium/src/out/Def
ault\vccorlib140d.dll...
Copying C:\Windows\Sysnative\vcruntime140d.dll to F:/Desktop/chromium/src/out/De
fault\vcruntime140d.dll...
Copying C:\Windows\Sysnative\ucrtbased.dll to F:/Desktop/chromium/src/out/Defaul
t\ucrtbased.dll...
Copying C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\cdb.exe to F:/Deskt
op/chromium/src/out/Default\cdb.exe...

See //BUILD.gn:73:1: which caused the file to be included.
group("gn_all") {
^----------------

Nico Weber

unread,
Mar 17, 2017, 12:00:56 PM3/17/17
to Conor Gorman, Chromium-dev, Jochen Eisinger, Scott Graham
Hm, the code that copies cdb is relatively new, in https://codereview.chromium.org/2684033010 I guess cdb doesn't get installed by default, we should probably make the script work if it's not there.

In the meantime, things will probably work if you get the debugging kit from https://developer.microsoft.com/en-us/windows/hardware/windows-driver-kit (look for the "If you just need the Debugging Tools for Windows 10, and not WDK 10 or Visual Studio 2015, you can install the debugging tools as a standalone component from Windows SDK. In the installation wizard, select Debugging Tools for Windows, and deselect all other components." paragraph and click the "Get Debugging Tools for Windows (WinDbg) (from the SDK)" link below it.)

--
--
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.

Conor Gorman

unread,
Mar 17, 2017, 12:07:19 PM3/17/17
to Chromium-dev, conor...@gmail.com, joc...@chromium.org, sco...@chromium.org
After running the .exe I tried again.

F:\Desktop\chromium\src>gn gen out/Default
Traceback (most recent call last):
  File "F:/Desktop/chromium/src/build/toolchain/win/setup_toolchain.py", line 21
4, in <module>
    main()
  File "F:/Desktop/chromium/src/build/toolchain/win/setup_toolchain.py", line 17
9, in main
    env = _LoadToolchainEnv(cpu, win_sdk_path)
  File "F:/Desktop/chromium/src/build/toolchain/win/setup_toolchain.py", line 14
0, in _LoadToolchainEnv
    script_path)
Exception: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
is missing - make sure VC++ tools are installed.
ERROR at //build/toolchain/win/BUILD.gn:366:22: Script returned non-zero exit co
de.
x64_toolchain_data = exec_script("setup_toolchain.py",
                     ^----------
Current dir: F:/Desktop/chromium/src/out/Default/
Command: F:/Desktop/depot_tools/python276_bin/python.exe -- F:/Desktop/chromium/
src/build/toolchain/win/setup_toolchain.py "C:\Program Files (x86)\Microsoft Vis
ual Studio 14.0" "C:\Program Files (x86)\Windows Kits\10" "C:\Windows\Sysnative;
C:\Windows\SysWOW64" x64
Returned 1.

Nico Weber

unread,
Mar 17, 2017, 12:10:09 PM3/17/17
to Conor Gorman, Chromium-dev, Jochen Eisinger, Scott Graham
It says:

Exception: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
is missing - make sure VC++ tools are installed.

Does that file exist on your system? Does c:\program files (x86)\microsoft visual studio 14.0 exist?

--
--
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.

Conor Gorman

unread,
Mar 17, 2017, 12:12:24 PM3/17/17
to Chromium-dev, conor...@gmail.com, joc...@chromium.org, sco...@chromium.org

All the way to VC exists, but there is no vcvarsall.bat file in the VC folder.

Nico Weber

unread,
Mar 17, 2017, 12:27:22 PM3/17/17
to Conor Gorman, Chromium-dev, Jochen Eisinger, Scott Graham
Hm, I don't know under which conditions the VS installer installs that bat file. Maybe following the steps in https://social.msdn.microsoft.com/Forums/en-US/1071be0e-2a46-4c30-9546-ea9d7c4755fa/where-is-vcvarsallbat-file?forum=visualstudiogeneral helps, but I don't know. Maybe you deselected too many options during install, or the Community installer doesn't install that bat file.

Conor Gorman

unread,
Mar 17, 2017, 12:54:31 PM3/17/17
to Chromium-dev, conor...@gmail.com, joc...@chromium.org, sco...@chromium.org
I think we've broken ground.



F:\Desktop\chromium\src>gn gen out/Default
Done. Made 5417 targets from 1258 files in 18007ms

Bruce Dawson

unread,
Mar 17, 2017, 1:55:53 PM3/17/17
to conor...@gmail.com, Chromium-dev, Jochen Eisinger, Scott Graham
It is unfortunate that VS 2015 defaults (IIRC) to not installing the C++ compiler. This is a break from previous tradition so it catches many people unaware.

The debugger toolkit is also not installed by default. These are both easily corrected but given that they are moderately common mistakes we should probably specifically detect them and print specific guidance, instead of the generic "file not found" error.

I just filed crbug.com/702697 for this.

--
--
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 a topic in the Google Groups "Chromium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/chromium-dev/ytDwXS42evs/unsubscribe.
To unsubscribe from this group and all its topics, 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/401e15f3-cca1-44aa-a54e-f84dbec148f9%40chromium.org.

Conor Gorman

unread,
Mar 17, 2017, 3:00:52 PM3/17/17
to Chromium-dev, conor...@gmail.com, joc...@chromium.org, sco...@chromium.org
The error is vague but it does say in the online instructions what to do. The instructions have been pretty descriptive, apart from the git issue, but that may have been an issue special to my situation.
Thanks for the help. 


On Friday, March 17, 2017 at 5:55:53 PM UTC, Bruce Dawson wrote:
It is unfortunate that VS 2015 defaults (IIRC) to not installing the C++ compiler. This is a break from previous tradition so it catches many people unaware.

The debugger toolkit is also not installed by default. These are both easily corrected but given that they are moderately common mistakes we should probably specifically detect them and print specific guidance, instead of the generic "file not found" error.

I just filed crbug.com/702697 for this.
On Fri, Mar 17, 2017 at 9:54 AM, Conor Gorman <conor...@gmail.com> wrote:
I think we've broken ground.


F:\Desktop\chromium\src>gn gen out/Default
Done. Made 5417 targets from 1258 files in 18007ms

--
--
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 a topic in the Google Groups "Chromium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/chromium-dev/ytDwXS42evs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chromium-dev...@chromium.org.
Reply all
Reply to author
Forward
0 new messages