Following this instruction page - https://www.electronjs.org/docs/development/build-instructions-gn to build electron.
I made testing build config successfully using
gn gen out/Testing --args="import(\"//electron/build/args/testing.gn\")"
In the next step when I tried to build using ninja -C out/Testing electron
it failed with following error -
FileNotFoundError: [Errno 2] No such file or directory: 'gen/third_party/dom_distiller_js/test_sample_json_converter.h'
Complete error log
ninja: Entering directory `out/Testing'
[2353/26014] ACTION
//third_party/dom_distiller_js:json_values_converter_tests(//build/toolchain/win:win_clang_x64)
FAILED: gen/third_party/dom_distiller_js/json_values_converter_tests.stamp
C:/depot_tools/bootstrap-2@3_8_10_chromium_17_bin/python3/bin/python3.exe ../../third_party/dom_distiller_js/protoc_plugins/json_values_converter_tests.py --stamp gen/third_party/dom_distiller_js/json_values_converter_tests.stamp gen/third_party/dom_distiller_js/test_sample_json_converter.h ../../third_party/dom_distiller_js/test_sample_json_converter.h.golden
Traceback (most recent call last):
File "../../third_party/dom_distiller_js/protoc_plugins/json_values_converter_tests.py", line 48, in <module> sys.exit(main())
File "../../third_party/dom_distiller_js/protoc_plugins/json_values_converter_tests.py", line 40, in main passed = passed and CompareFiles(i, j)
File "../../third_party/dom_distiller_js/protoc_plugins/json_values_converter_tests.py", line 17, in CompareFiles
return open(file1, 'r').read() == open(file2, 'r').read()
FileNotFoundError: [Errno 2] No such file or directory: 'gen/third_party/dom_distiller_js/test_sample_json_converter.h'
[2358/26014] CXX obj/third_party/webrtc/call/bitrate_allocator/bitrate_allocator.obj
ninja: build stopped: subcommand failed.
I searched entire directory there is a file name with test_sample_json_converter.h.golden only.
I had the same issue, and it was due to the tag that I used (92.0.4505.0) missed this commit: https://chromium.googlesource.com/chromium/src.git/+/96ec10dd20f2d23e98f93c48991c6ad106308644.
(The problematic target was
gen/third_party/dom_distiller_js/json_values_converter_tests.stamp
)