Lots of errors when compiling Chromium

860 views
Skip to first unread message

Robert Oschler

unread,
Mar 28, 2017, 4:02:43 PM3/28/17
to Chromium-dev
I checked out the Chromium project and followed the instructions on this page to set up a Visual Studio 2015 Enterprise Update 3 environment:

https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md

Initially I generated the "all" solution for all projects using the full source tree configuration.  That turned out to be too much so I regenerated the "all" solution with the stripped down source tree using this command:

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

Then I did a full build that took around 2 hours, like the documentation said it would.  Unfortunately after it was done the Error List showed 49 Errors and 738 Warnings.  The Warnings are almost all of the type, "premature end of file".  For example:

Severity    Code    Description    Project    File    Line    Suppression State
Warning        premature end of file; recovering    rtc_event_log_proto    C:\Users\current\chromium\src\out\Default\obj\third_party\webrtc\logging\ninja    1   

I have reproduced all the errors at the bottom of this message.  What do I need to do to fix my build environment so I can get a working Chrome.exe image?

ERROR LIST

Severity    Code    Description    Project    File    Line    Suppression State
Error    C1083    Cannot open compiler generated file: 'C:\Users\current\chromium\src\out\Default\obj\native_client\src\trusted\validator_ragel\rdfa_validator\validator_x86_64.obj': Permission denied    tracing_irt_x64    C:\Users\current\chromium\src\native_client\src\trusted\validator_ragel\gen\validator_x86_64.c    1   
Error    C1083    Cannot open compiler generated file: 'C:\Users\current\chromium\src\out\Default\obj\native_client\src\trusted\validator_ragel\rdfa_validator\validator_features_all.obj': Permission denied    i18n_irt_x64    C:\Users\current\chromium\src\native_client\src\trusted\validator_ragel\validator_features_all.c    1   
Error    C1083    Cannot open compiler generated file: 'C:\Users\current\chromium\src\out\Default\obj\native_client\src\tools\tls_edit\tls_edit\tls_edit.obj': Permission denied    i18n_irt_x64    C:\Users\current\chromium\src\native_client\src\tools\tls_edit\tls_edit.c    1   
Error    C1083    Cannot open compiler generated file: 'C:\Users\current\chromium\src\out\Default\obj\native_client\src\trusted\validator_ragel\rdfa_validator\validator_x86_64.obj': Permission denied    i18n_irt_x64    C:\Users\current\chromium\src\native_client\src\trusted\validator_ragel\gen\validator_x86_64.c    1   
Error    MSB3073    The command "call ninja.exe -C ../../../../../out/Default/ irt_x64/obj/base/libbase_i18n.a" exited with code 1.    i18n_irt_x64    C:\Users\current\chromium\src\out\Default\irt_x64\obj\base\i18n_irt_x64.vcxproj    156   
Error    LNK1104    cannot open file 'obj/native_client/src/trusted/validator_ragel/rdfa_validator/validator_x86_64.obj'    base_irt_x64    C:\Users\current\chromium\src\out\Default\irt_x64\obj\base\LINK    1   
Error    MSB3073    The command "call ninja.exe -C ../../../../../out/Default/ irt_x64/obj/base/libbase.a" exited with code 1.    base_irt_x64    C:\Users\current\chromium\src\out\Default\irt_x64\obj\base\base_irt_x64.vcxproj    1303   
Error    LNK1181    cannot open input file 'obj/native_client/src/trusted/validator_ragel/rdfa_validator/validator_features_all.obj'    base_static_irt_x64    C:\Users\current\chromium\src\out\Default\irt_x64\obj\base\LINK    1   
Error    MSB3073    The command "call ninja.exe -C ../../../../../out/Default/ irt_x64/obj/base/libbase_static.a" exited with code 1.    base_static_irt_x64    C:\Users\current\chromium\src\out\Default\irt_x64\obj\base\base_static_irt_x64.vcxproj    65   
Error    D8022    cannot open 'obj/native_client/src/trusted/validator_ragel/rdfa_validator/validator_features_all.obj.rsp'    tracing_irt_x64    C:\Users\current\chromium\src\out\Default\irt_x64\obj\components\tracing\cl    1   
Error    C1083    Cannot open compiler generated file: 'C:\Users\current\chromium\src\out\Default\obj\native_client\src\trusted\validator_ragel\rdfa_validator\validator_x86_64.obj': Permission denied    client_irt_x64    C:\Users\current\chromium\src\native_client\src\trusted\validator_ragel\gen\validator_x86_64.c    1   
Error    MSB3073    The command "call ninja.exe -C ../../../../../../out/Default/ irt_x64/obj/components/tracing/libtracing.a" exited with code 1.    tracing_irt_x64    C:\Users\current\chromium\src\out\Default\irt_x64\obj\components\tracing\tracing_irt_x64.vcxproj    97   
Error    MSB3073    The command "call ninja.exe -C ../../../../../../../out/Default/ irt_x64/obj/gpu/command_buffer/client/client.stamp" exited with code 1.    client_irt_x64    C:\Users\current\chromium\src\out\Default\irt_x64\obj\gpu\command_buffer\client\client_irt_x64.vcxproj    52   
Error    C1083    Cannot open compiler generated file: 'C:\Users\current\chromium\src\out\Default\obj\native_client\src\trusted\validator_ragel\rdfa_validator\validator_x86_64.obj': Permission denied    gles2_cmd_helper_sources_irt_x64    C:\Users\current\chromium\src\native_client\src\trusted\validator_ragel\gen\validator_x86_64.c    1   
Error    MSB3073    The command "call ninja.exe -C ../../../../../../../out/Default/ irt_x64/obj/gpu/command_buffer/client/gles2_cmd_helper_sources.stamp" exited with code 1.    gles2_cmd_helper_sources_irt_x64    C:\Users\current\chromium\src\out\Default\irt_x64\obj\gpu\command_buffer\client\gles2_cmd_helper_sources_irt_x64.vcxproj    61   
Error    MSB3073    The command "call ninja.exe -C ../../../../../../../out/Default/ irt_x64/obj/gpu/command_buffer/common/common.stamp" exited with code 1.    common_irt_x64 ((gpu)\(command_buffer)\(common)\common_irt_x64)    C:\Users\current\chromium\src\out\Default\irt_x64\obj\gpu\command_buffer\common\common_irt_x64.vcxproj    52   
Error    MSB3073    The command "call ninja.exe -C ../../../../../../../out/Default/ irt_x64/obj/gpu/ipc/common/command_buffer_traits.stamp" exited with code 1.    command_buffer_traits_irt_x64    C:\Users\current\chromium\src\out\Default\irt_x64\obj\gpu\ipc\common\command_buffer_traits_irt_x64.vcxproj    52   
Error    MSB3073    The command "call ninja.exe -C ../../../../../../../out/Default/ irt_x64/obj/gpu/ipc/common/command_buffer_traits_sources.stamp" exited with code 1.    command_buffer_traits_sources_irt_x64    C:\Users\current\chromium\src\out\Default\irt_x64\obj\gpu\ipc\common\command_buffer_traits_sources_irt_x64.vcxproj    61   
Error        no such file or directory: 'irt_x64/obj/ui/gfx/geometry/libgeometry.a'    nacl_irt_irt_x64    C:\Users\current\chromium\src\out\Default\irt_x64\obj\ppapi\native_client\x86_64-nacl-clang++.exe    1   
Error    MSB3073    The command "call ninja.exe -C ../../../../../../out/Default/ irt_x64/nacl_irt.nexe" exited with code 1.    nacl_irt_irt_x64    C:\Users\current\chromium\src\out\Default\irt_x64\obj\ppapi\native_client\nacl_irt_irt_x64.vcxproj    54   
Error    LNK1104    cannot open file 'obj/chrome/service/service.lib'    chrome    C:\Users\current\chromium\src\out\Default\obj\chrome\LINK    1   
Error    MSB3073    The command "call ninja.exe -C ../../../../out/Default/ obj/chrome/chrome.stamp" exited with code 1.    chrome    C:\Users\current\chromium\src\out\Default\obj\chrome\chrome.vcxproj    52   
Error    D8022    cannot open 'obj/third_party/pdfium/fxge/cfx_substfont.obj.rsp'    chrome_dll    C:\Users\current\chromium\src\out\Default\obj\chrome\cl    1   
Error    D8022    cannot open 'obj/third_party/pdfium/fxge/cfx_graphstatedata.obj.rsp'    child_dependencies    C:\Users\current\chromium\src\out\Default\obj\chrome\cl    1   
Error    MSB3073    The command "call ninja.exe -C ../../../../out/Default/ obj/chrome/chrome_dll.stamp" exited with code 1.    chrome_dll    C:\Users\current\chromium\src\out\Default\obj\chrome\chrome_dll.vcxproj    52   
Error    MSB3073    The command "call ninja.exe -C ../../../../out/Default/ obj/chrome/child_dependencies.stamp" exited with code 1.    child_dependencies    C:\Users\current\chromium\src\out\Default\obj\chrome\child_dependencies.vcxproj    53   
Error    C1033    cannot open program database 'C:\Users\current\chromium\src\out\Default\obj\chrome\utility\utility_cc.pdb'    utility ((chrome)\(utility)\utility)    C:\Users\current\chromium\src\out\Default\obj\chrome\utility\c1xx    1   
Error    MSB3073    The command "call ninja.exe -C ../../../../../out/Default/ obj/chrome/utility/utility.lib" exited with code 1.    utility ((chrome)\(utility)\utility)    C:\Users\current\chromium\src\out\Default\obj\chrome\utility\utility.vcxproj    222   
Error    C1033    cannot open program database 'C:\Users\current\chromium\src\out\Default\obj\extensions\renderer\renderer_cc.pdb'    renderer ((chrome)\(renderer)\renderer)    C:\Users\current\chromium\src\out\Default\obj\chrome\renderer\c1xx    1   
Error    MSB3073    The command "call ninja.exe -C ../../../../../out/Default/ obj/chrome/renderer/renderer.lib" exited with code 1.    renderer ((chrome)\(renderer)\renderer)    C:\Users\current\chromium\src\out\Default\obj\chrome\renderer\renderer.vcxproj    470   
Error    LNK1104    cannot open file 'obj/third_party/pdfium/fpdfdoc/cpdf_filespec.obj'    chrome_initial    C:\Users\current\chromium\src\out\Default\obj\chrome\LINK    1   
Error    MSB3073    The command "call ninja.exe -C ../../../../out/Default/ ./initialexe/chrome.exe" exited with code 1.    chrome_initial    C:\Users\current\chromium\src\out\Default\obj\chrome\chrome_initial.vcxproj    95   
Error    MSB3073    The command "call ninja.exe -C ../../../../out/Default/ ./chrome.dll.lib" exited with code 1.    main_dll    C:\Users\current\chromium\src\out\Default\obj\chrome\main_dll.vcxproj    75   
Error    LNK1218    warning treated as error; no output file generated    net_with_v8    C:\Users\current\chromium\src\out\Default\obj\net\LINK    1   
Error    MSB3073    The command "call ninja.exe -C ../../../../out/Default/ ./net_with_v8.dll.lib" exited with code 1.    net_with_v8    C:\Users\current\chromium\src\out\Default\obj\net\net_with_v8.vcxproj    82   
Error    C1083    Cannot open compiler generated file: 'C:\Users\current\chromium\src\out\Default\obj\ppapi\cpp\objects\video_capture_dev.obj': Permission denied    objects    C:\Users\current\chromium\src\ppapi\cpp\dev\video_capture_dev.cc    1   
Error    MSB3073    The command "call ninja.exe -C ../../../../../out/Default/ obj/ppapi/cpp/objects.stamp" exited with code 1.    objects    C:\Users\current\chromium\src\out\Default\obj\ppapi\cpp\objects.vcxproj    601   
Error    C1083    Cannot open compiler generated file: 'C:\Users\current\chromium\src\out\Default\obj\third_party\cld_3\src\src\cld_3\base.obj': Permission denied    cld    C:\Users\current\chromium\src\third_party\cld_3\src\src\base.cc    1   
Error    LNK1104    cannot open file 'obj/third_party/cld_3/src/src/protos/feature_extractor.pb.obj'    protos ((third_party)\(cld)\(cld_3)\(src)\(src)\protos)    C:\Users\current\chromium\src\out\Default\obj\third_party\cld_3\src\src\LINK    1   
Error    MSB3073    The command "call ninja.exe -C ../../../../../out/Default/ obj/third_party/cld/cld.stamp" exited with code 1.    cld    C:\Users\current\chromium\src\out\Default\obj\third_party\cld\cld.vcxproj    53   
Error    MSB3073    The command "call ninja.exe -C ../../../../../../../out/Default/ obj/third_party/cld_3/src/src/protos.lib" exited with code 1.    protos ((third_party)\(cld)\(cld_3)\(src)\(src)\protos)    C:\Users\current\chromium\src\out\Default\obj\third_party\cld_3\src\src\protos.vcxproj    78   
Error    D8022    cannot open 'obj/third_party/pdfium/fxcrt/fx_basic_buffer.obj.rsp'    fpdfapi    C:\Users\current\chromium\src\out\Default\obj\third_party\pdfium\cl    1   
Error    MSB3073    The command "call ninja.exe -C ../../../../../out/Default/ obj/third_party/pdfium/fpdfapi.lib" exited with code 1.    fpdfapi    C:\Users\current\chromium\src\out\Default\obj\third_party\pdfium\fpdfapi.vcxproj    759   
Error    C1083    Cannot open compiler generated file: 'C:\Users\current\chromium\src\out\Default\obj\third_party\pdfium\fxcrt\fx_basic_util.obj': Permission denied    fxcodec    C:\Users\current\chromium\src\third_party\pdfium\core\fxcrt\fx_basic_util.cpp    1   
Error    MSB3073    The command "call ninja.exe -C ../../../../../out/Default/ obj/third_party/pdfium/fxcodec.lib" exited with code 1.    fxcodec    C:\Users\current\chromium\src\out\Default\obj\third_party\pdfium\fxcodec.vcxproj    192   
Error    C1083    Cannot open compiler generated file: 'C:\Users\current\chromium\src\out\Default\obj\third_party\pdfium\fxcrt\fx_basic_wstring.obj': Permission denied    fx_agg    C:\Users\current\chromium\src\third_party\pdfium\core\fxcrt\fx_basic_wstring.cpp    1   
Error    MSB3073    The command "call ninja.exe -C ../../../../../../out/Default/ obj/third_party/pdfium/third_party/fx_agg.lib" exited with code 1.    fx_agg    C:\Users\current\chromium\src\out\Default\obj\third_party\pdfium\third_party\fx_agg.vcxproj    90   
Error    LNK1181    cannot open input file 'obj/third_party/pdfium/fxcrt/fx_basic_wstring.obj'    pdfwindow    C:\Users\current\chromium\src\out\Default\obj\third_party\pdfium\LINK    1   
Error    MSB3073    The command "call ninja.exe -C ../../../../../out/Default/ obj/third_party/pdfium/pdfwindow.lib" exited with code 1.    pdfwindow    C:\Users\current\chromium\src\out\Default\obj\third_party\pdfium\pdfwindow.vcxproj    125   

Bruce

unread,
Mar 29, 2017, 2:20:41 PM3/29/17
to Chromium-dev
The recommended way to build Chromium is directly using ninja. If you build it from Visual Studio then it invokes ninja (it doesn't use MSBuild) so the results should be the same, but building from VS opens up the possibility of new types of errors.

So, the "--ide" flag is not required. Feel free to use it, but don't think that you have to. If there is documentation that suggests that it is required or recommended then we should rephrase it.

So, try building with ninja and see if that makes any difference. In particular:

> ninja -C out\Default chrome

You can also try smaller initial builds, such as:

> ninja -C out\Default base_unittests
> out\Default\base_unittests.exe

This builds and then runs the unit tests. This should just take a few minutes and is a much better starting point than building and running all of Chrome.

I have not seen those premature end of file warnings, and I also never get those "cannot open input file" errors. My best guess would be that VS is running multiple build commands in parallel and they are fighting over the output files. If you want to build from the VS IDE you have to make sure that you launch exactly one copy of ninja.exe.

Maybe ninja should somehow detect this scenario? Acquire a lock on the main .ninja file and fail if it cannot acquire the lock?

Robert Oschler

unread,
Mar 29, 2017, 2:38:25 PM3/29/17
to Chromium-dev
Hi Bruce,

Thank you for your reply. Regarding your statement "If you want to build from the VS IDE you have to make sure that you launch exactly one copy of ninja.exe."  Do you know how I modify/check the all.sln project settings to enforce that constraint?

>> If there is documentation that suggests that it is required or recommended then we should rephrase it.

The document below suggests using that flag.  See below:


Text:

If you want to use the Visual Studio IDE, use the --ide command line argument to gn gen when you generate your output directory (as described on the get the code page):

$ gn gen --ide=vs out\Default
$ devenv out\Default\all.sln


As far as the build problems I was having, I found the root cause.  Hopefully my answer here helps others.  If you have an answer for my Ninja question at the end of this message, please reply.

The problem happened because I executed the install steps from a Windows 8.1 Administrator command window.  This caused file ownership permission errors when I attempted to build the project from Visual Studio, since I run VS in User mode (i;e - under a user account).  

To fix this I took the following steps:

- deleted my entire install directory ("/chromium") while leaving the depot tools install and system PATH entries intact
- opened a User mode/account command window this time
- (Re)-followed the install document commands to re-fetch and regen the entire source tree.  
- Executed the Ninja command directly to build the project instead of building through VS.  I might have been able to rebuild the project from within VS but I wasn't taking any chances

This resulted in a working chrome.exe executable that ran fine.

The only problem I had was that Ninja kept trying to open/access some files on a removable drive that didn't happen to have a drive loaded.  Every time that happened I clicked the Continue button many times until Ninja resumed the build.  If anybody knows what I can change so that Ninja stops trying to access an unavailable drive, please reply.  Because of this I can't do an unattended build (obviously).

Bruce Dawson

unread,
Mar 29, 2017, 2:48:24 PM3/29/17
to robert....@gmail.com, Chromium-dev
I'm glad you got that figured out. I'll think about how we could phrase the documentation to explain how to use the VS IDE while not suggesting that it is necessarily recommended.

I never build Chrome from the IDE but I think that selecting "Build Solution" can result in multiple ninja processes being launched, while "build selected-project" does not. But I'm not sure. Maybe that is a non-problem.

Regarding the references to a removable drive, I don't know where those would be coming from. It may be a problem with your VS install, or it may be some references in the .ninja files. Search for that drive letter in the generated .ninja files and in the VS portion of the registry. Good luck.

--
--
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/Sbi0G83IW6M/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/ef103702-683e-4688-8d7d-ea83d7d78686%40chromium.org.

Reply all
Reply to author
Forward
0 new messages