Error when building Chromium on Windows

1,059 views
Skip to first unread message

K. Gordon

unread,
Dec 4, 2016, 9:39:46 AM12/4/16
to Chromium-dev

I'm using Windows 7 with SP1 and Microsoft Visual Studio Community 2015 with Update 3. Chromium version is the latest. I followed this instruction step by step.


Setting up the build:

By Visual Studio Command Prompt I type:

gn gen --target_cpu="x86" --filters=//chrome out\Default

Then I type:

ninja -C out\Default chrome

And when compilation is about 10% done, the build fails with missing file.


Full log:

D:\ChromiumBuild\chromium\src>gn gen --target_cpu="x86" --filters=//chrome o
t\Default
Done. Made 5575 targets from 1215 files in 3469ms

D:\ChromiumBuild\chromium\src>ninja -C out\Default chrome
ninja: Entering directory `out\Default'
[2762/27638] ACTION //third_party/WebK...ue_keywords(//build/toolchain/win:x64)
FAILED: gen/blink/core/CSSValueKeywords.cpp gen/blink/core/CSSValueKeywords.h
D:/Chromium/depot_tools/python276_bin/python.exe ../../third_party/WebKit/Sourc
/build/scripts/make_css_value_keywords.py ../../third_party/WebKit/Source/core/
ss/CSSValueKeywords.in ../../third_party/WebKit/Source/core/css/SVGCSSValueKeyw
rds.in --output_dir gen/blink/core --gperf ../../third_party/gperf/bin/gperf.ex

Traceback (most recent call last):
  File "../../third_party/WebKit/Source/build/scripts/make_css_value_keywords.p
", line 177, in <module>
    in_generator.Maker(CSSValueKeywordsWriter).main(sys.argv)
  File "D:\ChromiumBuild\chromium\src\third_party\WebKit\Source\build\scripts\i
_generator.py", line 108, in main
    writer.write_files(options.output_dir)
  File "D:\ChromiumBuild\chromium\src\third_party\WebKit\Source\build\scripts\i
_generator.py", line 60, in write_files
    self._write_file_if_changed(output_dir, generator(), file_name)
  File "../../third_party/WebKit/Source/build/scripts/make_css_value_keywords.p
", line 172, in generate_implementation
    gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subproce
s.PIPE, universal_newlines=True)
  File "D:\Chromium\depot_tools\python276_bin\lib\subprocess.py", line 709, in
_init__
    errread, errwrite)
  File "D:\Chromium\depot_tools\python276_bin\lib\subprocess.py", line 957, in
execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
[2771/27638] ACTION //third_party/WebK...ual_modules(//build/toolchain/win:x64)
ninja: build stopped: subcommand failed.

D:\ChromiumBuild\chromium\src>


I also tried without targeting x86:

gn gen --filters=//chrome out\Default


But problem is the same.

When I try creating solution and then compile in Visual Studio:

gn gen --ide=vs --filters=//chrome out\Default
devenv out\Default\all.sln


Building seems to have no end. After 4 hours compilation is about 20% done (16 GB RAM and 8 x 4.0 GHz with 100% CPU usage all the time, no antivirus or firewall).

Is there way to fix this missing file?

Jon Pfeffer

unread,
Dec 4, 2016, 10:49:03 AM12/4/16
to snda...@gmail.com, Chromium-dev
I'm fairly new to building Chromium, but from what I understand compilation should be done using Ninja which is designed for speed. Using gn --ide is to generate a solution that I am using to edit the files and also run through the visual studio debugger:

# To run a Visual Studio debug session (via administrator command prompt in chromium/src directory
devenv /debugexe out\Debug\chrome.exe

If you don't limit the size of the solution via filters, it will never load on a normal PC. Here's how I've been limiting it:

gn gen out\Debug --ide=vs --sln=Lockdown --filters=//chrome;//base;//build;//content;

My build environment (Windows 10 , i7-4790 3.6 GHz CPU, 16.0 GB RAM, 1.7 TB disk space) is proving to be in adequate (5 hour build times) mainly because it doesn't have SSD disks. IO seems to be the major bottleneck.

Regards,
Jon

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

Dirk Pranke

unread,
Dec 4, 2016, 9:53:28 PM12/4/16
to snda...@gmail.com, Chromium-dev
It looks like you're missing //third_party/gperf/bin/gperf.exe . Do you have that file in your checkout? 

If not, run `gclient sync` to make sure you have all of the dependencies you need.
 

I also tried without targeting x86:

gn gen --filters=//chrome out\Default


But problem is the same.

When I try creating solution and then compile in Visual Studio:

gn gen --ide=vs --filters=//chrome out\Default
devenv out\Default\all.sln


Building seems to have no end. After 4 hours compilation is about 20% done (16 GB RAM and 8 x 4.0 GHz with 100% CPU usage all the time, no antivirus or firewall).

Building does take a long time, and 16GB is, sadly, not a huge amount of RAM, so you're probably limited by the amount of RAM and/or your I/O throughput if you don't have an SSD.

You might try setting the GN argument `symbol_level=1` which will reduce the amount of debug output being generated, at the cost of not being able to step through the program in a debugger.

-- Dirk
 

Is there way to fix this missing file?

--

K. Gordon

unread,
Dec 5, 2016, 4:08:24 AM12/5/16
to Chromium-dev
I don't have gperf folder. Event after 'gclient sync'. I downloaded it manually by using:
and added to third_party path. But it changes nothing. I still have errors with missing files, for example:
WindowsError: [Error 2] The system cannot find the file specified
[10/23772] ACTION //third_party/WebKit...d_xml_names(//build/toolchain/win:x64)
ninja: build stopped: subcommand failed.

WindowsError: [Error 2] The system cannot find the file specified
[17/23788] ACTION //third_party/WebKit...ue_keywords(//build/toolchain/win:x64)
ninja: build stopped: subcommand failed.

WindowsError: [Error 2] The system cannot find the file specified
[14/23763] ACTION //third_party/WebKit...ility_check(//build/toolchain/win:x64)
ninja: build stopped: subcommand failed.

I noticed that missing files are random deps from this list. But not always.
make_core_generated_xml_names
make_core_generated_css_value_keywords

Should I build them manually? In which way?

Bruce

unread,
Dec 5, 2016, 4:43:09 PM12/5/16
to Chromium-dev
You should not need to manually generate those files. You also shouldn't need to manually clone gperf. The build steps on the website should be complete and you should be very careful about doing manual steps such as syncing new files into the repo - you could easily end up breaking the environment.

On my 24-core/48-thread machine it takes about 40 minutes to build the chrome target. So on a 4-core/8-thread machine it could easily take 240 minutes, or four hours. Do not try building with Visual Studio. The build command you should be using is:

ninja -C out\Default chrome

You could try building the base_unittests target first - make sure that builds and runs before moving on to all of Chrome?

You may need to temporarily modify the scripts that are failing in order to dump more information and figure out what files are missing. The step that is failing appears to be trying to generate files like "gen/blink/core/CSSValueKeywords.cpp" and the failure is because some other file is missing, but it is not apparent what file. Once you know what file is missing the next steps may be more obvious.

Also, the error message logs you have shared are word-wrapped and have missing characters which makes them very hard to read. For example, in this traceback:

Traceback (most recent call last):
  File "../../third_party/WebKit/Source/build/scripts/make_css_value_keywords.p
", line 177, in <module>

the failure is happening in make_css_value_keywords.py but the trailing 'y' got lost. If you redirect the output to a file then you can share the relevant snippets without getting word-wrap from the command window.

Dirk Pranke

unread,
Dec 5, 2016, 9:10:23 PM12/5/16
to Bruce Dawson, Chromium-dev
Also, I'm not 100% sure what you mean by "Visual Studio command prompt". You might try running cmd.exe directly and running `gclient sync` from there, and make sure that completes successfully.

-- Dirk

--

K. Gordon

unread,
Dec 6, 2016, 6:13:05 PM12/6/16
to Chromium-dev
Finally, I did it! 
I deleted all files. I downloaded them again and compiled (it took over 3 hours). It works. Thanks for all replies.  

However I added --target_cpu="x86" parameter, but my Chromium is x64. And memory usage is huge. When I start Chromium, it opens 4 processes and they all together eat about 400 MB.
When I launch Chromium Portable with start page, it takes less memory (about 50 MB). What can be the reason? How can I reduce app memory usage?


 

Scott Graham

unread,
Dec 6, 2016, 7:21:53 PM12/6/16
to snda...@gmail.com, Chromium-dev
It should be --args="target_cpu=\"x86\"". Is that what you meant?

--

Bruce Dawson

unread,
Dec 6, 2016, 9:17:02 PM12/6/16
to Scott Graham, snda...@gmail.com, Chromium-dev
The total for your x64 Chrome is actually about 280 MB. Still a lot, but less than 400 MB.

"Memory" usage is not specific enough to be meaningful - what memory column are you viewing? When you have four Chrome processes they share a non-trivial amount of memory - code especially. Since chrome_child.dll is 46.7 MB for a 32-bit build that means that you could be overcounting by many tens of MBs. I find that private working set is the most meaningful measure of memory usage, so make sure that is what you are displaying. It's not perfect, but it is the easiest to interpret.

Where did you get the --target_cpu="x86" parameter from?

---
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/9GUYQdz-pCw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chromium-dev+unsubscribe@chromium.org.

K. Gordon

unread,
Dec 7, 2016, 12:56:27 PM12/7/16
to Chromium-dev
@Scott Graham

Yes, exactly.

@Bruce Dawson

Where did you get the --target_cpu="x86" parameter from?


@Topic

The problem is solved. I think I should start a new thread to talk about large memory usage. 

Bruce

unread,
Dec 7, 2016, 8:48:39 PM12/7/16
to Chromium-dev
The documentation is, when looked at with fresh eyes, a bit ambiguous. The term 'args' is used without clarifying that this refers to the contents of the args.gn file, aka, the values to be entered into the text editor that appears when you go "gn args out/Default". It's easy to misinterpret them as commandline args to gn, which doesn't work without the non-obvious --args syntax.

I'm not sure how to clarify the documentation, but I think it's worth doing.

Dirk Pranke

unread,
Dec 8, 2016, 3:42:34 PM12/8/16
to Bruce Dawson, Chromium-dev
Okay, I added the following sentence to the end of the "Understanding GN build flags" section:

"GN args" as used on this page are not the command line arguments passed to GN. They refer to the individual variables that are passed as part of the --args command line flag and/or written to the args.gn file.

Hopefully I understood what the confusion was; if not, I welcome alternate suggestions.

-- Dirk


--

Bruce Dawson

unread,
Dec 8, 2016, 3:45:57 PM12/8/16
to Dirk Pranke, Chromium-dev
That should help. Thanks.
Reply all
Reply to author
Forward
0 new messages