首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何解决TemplateRuntimeError:编译chromium时没有名为'>‘的测试?

如何解决TemplateRuntimeError:编译chromium时没有名为'>‘的测试?
EN

Stack Overflow用户
提问于 2021-06-10 16:29:46
回答 1查看 48关注 0票数 0

编译chromium时,我得到以下错误消息:

代码语言:javascript
复制
ninja: Entering directory `out/Cros'
[44/32769] ACTION //components/exo/wayland/compatibility_test:generated_client_event_receiver_version_tests(//build/toolchain/linux:clang_x64)
FAILED: gen/components/exo/wayland/compatibility_test/all_generated_client_event_receiver_version_tests.cc 
python3 ../../components/exo/wayland/compatibility_test/wayland_protocol_codegen.py ../../third_party ../../buildtools/linux64/clang-format ../../components/exo/wayland/compatibility_test/template_client_event_receiver_version_tests.cc.tmpl gen/components/exo/wayland/compatibility_test/all_generated_client_event_receiver_version_tests.cc ../../components/exo/wayland/protocol/aura-shell.xml ../../third_party/wayland/src/protocol/wayland.xml ../../third_party/wayland-protocols/src/stable/presentation-time/presentation-time.xml ../../third_party/wayland-protocols/src/stable/viewporter/viewporter.xml ../../third_party/wayland-protocols/src/stable/xdg-shell/xdg-shell.xml ../../third_party/wayland-protocols/src/unstable/fullscreen-shell/fullscreen-shell-unstable-v1.xml ../../third_party/wayland-protocols/src/unstable/input-timestamps/input-timestamps-unstable-v1.xml ../../third_party/wayland-protocols/src/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml ../../third_party/wayland-protocols/src/unstable/linux-explicit-synchronization/linux-explicit-synchronization-unstable-v1.xml ../../third_party/wayland-protocols/src/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml ../../third_party/wayland-protocols/src/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml ../../third_party/wayland-protocols/src/unstable/relative-pointer/relative-pointer-unstable-v1.xml ../../third_party/wayland-protocols/src/unstable/text-input/text-input-unstable-v1.xml ../../third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v6.xml ../../third_party/wayland-protocols/unstable/alpha-compositing/alpha-compositing-unstable-v1.xml ../../third_party/wayland-protocols/unstable/color-space/color-space-unstable-v1.xml ../../third_party/wayland-protocols/unstable/cursor-shapes/cursor-shapes-unstable-v1.xml ../../third_party/wayland-protocols/unstable/gaming-input/gaming-input-unstable-v2.xml ../../third_party/wayland-protocols/unstable/keyboard/keyboard-configuration-unstable-v1.xml ../../third_party/wayland-protocols/unstable/keyboard/keyboard-extension-unstable-v1.xml ../../third_party/wayland-protocols/unstable/notification-shell/notification-shell-unstable-v1.xml ../../third_party/wayland-protocols/unstable/remote-shell/remote-shell-unstable-v1.xml ../../third_party/wayland-protocols/unstable/secure-output/secure-output-unstable-v1.xml ../../third_party/wayland-protocols/unstable/stylus/stylus-unstable-v2.xml ../../third_party/wayland-protocols/unstable/stylus-tools/stylus-tools-unstable-v1.xml ../../third_party/wayland-protocols/unstable/vsync-feedback/vsync-feedback-unstable-v1.xml
Traceback (most recent call last):
  File "../../components/exo/wayland/compatibility_test/wayland_protocol_codegen.py", line 120, in <module>
    main()
  File "../../components/exo/wayland/compatibility_test/wayland_protocol_codegen.py", line 111, in main
    expanded = expand_template(args.template,
  File "../../components/exo/wayland/compatibility_test/wayland_protocol_codegen.py", line 58, in expand_template
    return env.get_template(os.path.basename(template)).render(context)
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 989, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 754, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "../../components/exo/wayland/compatibility_test/template_client_event_receiver_version_tests.cc.tmpl", line 32, in <module>
    {% if interface.events|selectattr("since")|selectattr("since", ">", min_version)|list|length %}
  File "/usr/lib/python3/dist-packages/jinja2/filters.py", line 750, in do_list
    return list(value)
  File "/usr/lib/python3/dist-packages/jinja2/filters.py", line 942, in _select_or_reject
    if modfunc(func(transfunc(item))):
  File "/usr/lib/python3/dist-packages/jinja2/filters.py", line 935, in <lambda>
    func = lambda item: context.environment.call_test(
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 449, in call_test
    raise TemplateRuntimeError('no test named %r' % name)
jinja2.exceptions.TemplateRuntimeError: no test named '>'
[61/32769] CXX obj/mojo/public/tools/fuzzers/fuzz_mojom_blink/fuzz.mojom-blink.o
ninja: build stopped: subcommand failed.

我不确定这是否与jinja2的版本有关。而我的版本肯定是v2.8。

autoninja -C out/Default对我来说没问题。当我尝试在我的Ubuntu16.04上编译CrOS时,这个问题出现了。

而且autoninja -C out/Cros chrome也很好。@_@

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-06-11 16:49:42

找出原因!这是因为忍者在系统中使用jinja2,而不是src/third_party目录下的版本。

我通过卸载system jinja2解决了这个问题。

感谢tikuta@chromium.org的指导。\o/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67917508

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档