首页 > 解决方案 > 电子构建 - FileNotFoundError test_sample_json_converter.h

问题描述

按照此说明页面 - https://www.electronjs.org/docs/development/build-instructions-gn构建电子。

我成功地使用了测试构建配置

gn gen out/Testing --args="import(\"//electron/build/args/testing.gn\")"

在下一步中,当我尝试使用ninja -C out/Testing electron它进行构建时失败并出现以下错误 -

FileNotFoundError: [Errno 2] No such file or directory: 'gen/third_party/dom_distiller_js/test_sample_json_converter.h'

完整的错误日志

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.

我搜索了整个目录,只有一个带有test_sample_json_converter.h.golden的文件名。

标签: electronchromiumgn

解决方案


我有同样的问题,这是由于我使用的标签(92.0.4505.0)错过了这个提交:https ://chromium.googlesource.com/chromium/src.git/+/96ec10dd20f2d23e98f93c48991c6ad106308644 。

(有问题的目标是gen/third_party/dom_distiller_js/json_values_converter_tests.stamp


推荐阅读