3

从源代码设置 chromium 时出现以下错误。
当我跑步时gn gen out/Default

 gn gen out/Default
ERROR at //build/config/linux/pkg_config.gni:103:17: Script returned non-zero exit code.
    pkgresult = exec_script(pkg_config_script, args, "value")
                ^----------
Current dir: /opt/apps/chromium/chromium_src/src/out/Default/
Command: python -- /opt/apps/chromium/chromium_src/src/build/config/linux/pkg-config.py -s /opt/apps/chromium/chromium_src/src/build/linux/debian_stretch_amd64-sysroot -a x64 nss -v -lssl3
Returned 1.
stderr:

Traceback (most recent call last):
  File "/opt/apps/chromium/chromium_src/src/build/config/linux/pkg-config.py", line 232, in <module>
    sys.exit(main())
  File "/opt/apps/chromium/chromium_src/src/build/config/linux/pkg-config.py", line 139, in main
    prefix = GetPkgConfigPrefixToStrip(options, args)
  File "/opt/apps/chromium/chromium_src/src/build/config/linux/pkg-config.py", line 80, in GetPkgConfigPrefixToStrip
    "--variable=prefix"] + args, env=os.environ)
  File "/usr/lib/python2.7/subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

See //third_party/nss/BUILD.gn:15:3: whence it was called.
  pkg_config("system_nss_no_ssl_config") {
  ^---------------------------------------
See //crypto/BUILD.gn:221:25: which caused the file to be included.
    public_configs += [ "//third_party/nss:system_nss_no_ssl_config" ].

我无法弄清楚如何解决这个问题。
我关注了 https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md
也提到了这些
https://groups.google.com/a/chromium.org/forum/#!topic/ chromium-os-dev/360e3QsLH-8
https://groups.google.com/a/chromium.org/forum/#!msg/chromium-os-dev/nM7Af-sJP_I/YoqXPgZ0BQAJ
无法获得更多细节。
这些讨论涉及PKG_CONFIG_LIBDIR但不清楚在哪里设置此值或准确使用它。
关于我可能缺少的任何输入?

4

2 回答 2

6

我通过安装此软件包解决了同样的问题

sudo apt-get update && sudo apt-get install pkg-config
于 2018-10-15T07:42:34.447 回答
0

我遇到了同样的问题,我也尝试过sudo apt-get update && sudo apt-get install pkg-config@Rajan Palani 和许多其他 git 问题评论中提到的方法。但就我而言

sudo apt install libpango1.0-dev
sudo apt install libcogl-pango-dev
sudo apt install libjpeg-dev

上面的命令可以帮助我解决问题

来源: https ://programmer.group/how_to_build_chromium_project_for_linux.html

于 2021-01-12T06:48:03.050 回答