gn gen problem - can't run pkg-config

408 views
Skip to first unread message

Dave Mielke

unread,
Mar 23, 2021, 12:56:45 PM3/23/21
to Chromium Browser Development
I'm unable to figure out a "gn gen" problem in preparation for building the browser and would appreciate some advice on how to proceed.

The command that's failing is: gn gen out_amd64-generic/Release

The error is:

Could not run pkg-config.
See //build/config/linux/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 += [ "//build/config/linux/nss:system_nss_no_ssl_config" ]
^--------------------------------------------------

The context of line 15 of build/config/linux/nss/BUILD.gn is:

* pkg_config("system_nss_no_ssl_config") {
packages = [ "nss" ]
extra_args = [
"-v",
"-lssl3",
]
}

The context of line 221 of crypto/BUILD.gn is:

if (use_nss_certs) {
public_configs = [ ":platform_config" ]
* public_configs += [ "//build/config/linux/nss:system_nss_no_ssl_config" ]
}

When I run gn gen with its -v option, it says that the failing comand is:

Command: python /Google/Browser/src/build/config/linux/pkg-config.py -p x86_64-pc-linux-gnu-pkg-config nss -v -lssl3
Returned 1.

When I run this command manually, I do get the same error.

The command implies that I need the nss package, which I do. I also have the nss development package (nss-devel). In case it matters, I have version 3.62.0 of nss.

The -lssl3 operand imlies that I need libssl3, and, yes, I do have /usr/lib64/libssl3.so.

Also, in case it matters, this is a Fedora (not a Debian) system. And, yes, I've ensured that all of the packages listed in the Fedora section of the Chromium OS Docs - Building Chrome for Chrome OS (Simple Chrome) document are installed.

Does anyone have any idea(s) regarding what might be wrong and/or what else I might try?

--
I believe the Bible to be the very Word of God: http://Mielke.cc/bible/
Dave Mielke | 2213 Fox Crescent | WebHome: http://Mielke.cc/
EMail: Da...@Mielke.cc | Ottawa, Ontario | Twitter: @Dave_Mielke
Phone: +1 613 726 0014 | Canada K2A 1H7 |

Dave Mielke

unread,
Mar 23, 2021, 12:58:27 PM3/23/21
to Chromium Browser Development
I'm sorry if the following has already been seen. I posted it yesterday morning from an unsubscribed email address and haven't seen it posted back to me or received any kind of rejection.

Dave Mielke

unread,
Mar 28, 2021, 11:21:06 AM3/28/21
to Chromium Browser Development
It's been a week or so with no response so I hope it's okay for me to repost my question (see attached message). Please let me know if there's a more appropriate place to ask it.

David Tseng

unread,
Mar 28, 2021, 2:16:09 PM3/28/21
to dave.a...@gmail.com, Chromium Browser Development
>  Command: python /Google/Browser/src/build/config/linux/pkg-config.py -p x86_64-pc-linux-gnu-pkg-config nss -v -lssl3

It looks like this script has a debug flag (-d), maybe run it and post back here.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
    http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/YFn/GXZ6XTaD1wnc%40beta.private.mielke.cc.

Dave Mielke

unread,
Mar 28, 2021, 6:15:05 PM3/28/21
to David Tseng, Chromium Browser Development
[quoted lines by David Tseng on 2021/03/28 at 11:14 -0700]

>It looks like this script has a debug flag (-d), maybe run it and post back
>here.

Thanks. That was indeed helpful. It wasn't trying to run the pkg-config command, but, rather, the x86_64-pc-linux-gnu-pkg-config command (too bad that the error message didn't say that). I guess its a way someone tried to generalize cross-building for the same platform. Anyway, I created a symbolic link in /usr/local/bin/ for it to /usr/bin/pkg-config, and the command now runs.

Dave Mielke

unread,
Mar 28, 2021, 8:55:31 PM3/28/21
to Chromium Browser Development, David Tseng
[quoted lines by Dave Mielke on 2021/03/28 at 18:13 -0400]

>It wasn't trying to run the pkg-config command, but, rather, the x86_64-pc-linux-gnu-pkg-config command (too bad that the error message didn't say that).

Further investigation shows that Python2 works and that it was Python3 which is having this problem. Python3's pkg-config function isn't handling the native build case very well. :-(

So, yes, I do remember reading in the documents that Python2 should be used. I also, however, remember reading that the document was known to be out-of-date so whatever it said couldn't be totally trusted anymore. Putting those two things together, and knowing that Python2 is so old now and that no self-respecting system defaults to it these days, I simply didn't believe it. I even checked with a Debian dude who told me that that distribution doesn't even have a versionless python command (i.e. they only have python2 and python3 commands) these days.

So, anyway, as my previous message indicates, I tried switching to Python 2.7 and was unsuccessful. Perhaps I'm missing a Python2 package. That problem, for those who haven't read it yet, is that the value "unicode" isn't defined. This is on line 39 of src/third_party/dom_distiller_js/dist/python/plugin_pb2.pZ:

has_default_value=False, default_value=unicode("", "utf-8"),

Dirk Pranke

unread,
Mar 29, 2021, 12:47:53 PM3/29/21
to da...@mielke.cc, Chromium Browser Development, David Tseng
Chromium still requires Python2 in the build. 

If you can't find a package that distributes a `python` binary, we distribute a copy as part of depot_tools, in depot_tools/python2-bin/python2. You'll need to create an shell wrapper or something called `python` that points to it.

-- Dirk

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
    http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
Reply all
Reply to author
Forward
0 new messages