0

I've built the Chromium browser on my Windows from its official source code by following this documentation.

I made some changes and executed my first build and ran into some errors.

The error are as follows:

THE ERROR ON EVERY BUILD:

[298/50478] ACTION //chrome/browser/resource_coordinator:mojo_bindings__parser(//build/toolchain/win:win_clang_x64)
FAILED: gen/chrome/browser/resource_coordinator/lifecycle_unit_state.mojom-module
C:/src/depot_tools/bootstrap-2@3_8_10_chromium_17_bin/python/bin/python.exe ../../mojo/public/tools/mojom/mojom_parser.py --input-root "C:/Users/Paras H S/chromium/src" --input-root "C:/Users/Paras H S/chromium/src/out/Default/gen" --output-root "C:/Users/Paras H S/chromium/src/out/Default/gen" --mojom-file-list=__chrome_browser_resource_coordinator_mojo_bindings__parser___build_toolchain_win_win_clang_x64__rule..rsp --check-imports "C:/Users/Paras H S/chromium/src/out/Default/gen/chrome/browser/resource_coordinator/mojo_bindings.build_metadata" --enable-feature is_win --add-module-metadata webui_module_path=/chrome/browser/resource_coordinator
Traceback (most recent call last):
  File "../../mojo/public/tools/mojom/mojom_parser.py", line 443, in <module>
    Run(sys.argv[1:])
  File "../../mojo/public/tools/mojom/mojom_parser.py", line 435, in Run
    module_metadata, allowed_imports)
  File "../../mojo/public/tools/mojom/mojom_parser.py", line 252, in _ParseMojoms
    for abs_path in mojom_files)
  File "../../mojo/public/tools/mojom/mojom_parser.py", line 252, in <genexpr>
    for abs_path in mojom_files)
  File "../../mojo/public/tools/mojom/mojom_parser.py", line 79, in _RebaseAbsolutePath
    assert os.path.isfile(path)
AssertionError
[307/50478] ACTION //chrome/browser/metrics:expired_histograms_array(//build/toolchain/win:win_clang_x64)
ninja: build stopped: subcommand failed.

I am completely a newbie at this and this is my first time working on Visual Studio(v. 2019). How can I get rid of these errors? Any help would be appreciated!!

Paras
  • 9
  • 4
  • Please post the error message rather than posting screenshots. – Asesh May 16 '21 at 15:06
  • Looks like a mixture of Python 3 and 2 is causing that issue. Try to clean the build folder by running `gn clean out\YourBuildFolder` and start compiling again. That might help – Asesh May 17 '21 at 03:14
  • @Asesh it didn't work. Will uninstalling python2 be of any help? – Paras May 17 '21 at 05:56
  • There's no need to uninstall Python 2, did you follow the instructions properly mentioned in `Install depot_tools`? – Asesh May 17 '21 at 10:41
  • @Asesh Yes, the gclient installed without any errors and the location of python was also showing correctly. However, I am getting some errors when I am syncing my code using ```gclient sync```. I have updated these errors in the post!! – Paras May 17 '21 at 10:58
  • @Asesh, in the documentation it is mentioned that an Intel machine is required to build chromium. Is it strictly limited to that or can we build it on a AMD machine as well? Since I am using an AMD machine, maybe that is causing the error! – Paras May 17 '21 at 12:30
  • It works on AMD machine. Try posting that issue here: https://groups.google.com/a/chromium.org/forum/#!forum/chromium-dev It's an official Chromium developer's group – Asesh May 17 '21 at 13:10
  • Looks like one or more files are missing. What happens when you try `gclient sync -f`? Also Try checking out a stable version of Chromium and try the same thing. The master branch is not stable and might contain bugs in build tools and Chromium. You can follow my answer to checkout a stable version: https://stackoverflow.com/questions/47087970/how-to-checkout-and-build-specific-chromium-tag-branch-without-download-the-full/47093174#47093174 – Asesh May 17 '21 at 16:41
  • @Asesh ``UPDATE 2`` (in the question body) error is displayed when I sync using ```gclient sync -f``` – Paras May 17 '21 at 17:32
  • @Asesh I followed your answer and tried fetching the latest windows stable release ```90.0.4430.212```, but it says that ```Git repo not found```. I have tried uninstalling and reinstalling my Git credential manager, but still facing repo not found issue. :( – Paras May 17 '21 at 18:17
  • You can checkout the current stable version of Chromium from your existing repo by typing: `git checkout tags/90.0.4430.212` – Asesh May 18 '21 at 02:15
  • @Asesh I followed the steps you mentioned in your answer, my project was synced without any errors with the latest stable build, but it is still failing when I build it. There is some issue with ```mojom_parser.py``` file, my build is stuck at this file every time. Also, I was trying to post my doubt on chromium dev group, but was not given access to do so, how to get access to post errors on that dev group? – Paras May 18 '21 at 16:24
  • You have to join that group to post any thing there. – Asesh May 18 '21 at 17:00

0 Answers0