BUILD.gn should allow empty pkg_deps |
|||
Issue description
Some packages might not pull packages like libchrome or libbrillo as default. But common-mk/pkg_config.gni:11 forces the pkg_deps exist:
ERROR at //common-mk/pkg_config.gni:11:5: Assertion failed.
assert(defined(pkg_deps), "pkg_deps must be set")
^-----
pkg_deps must be set
See //bsdiff/BUILD.gn:32:1: whence it was called.
pkg_config("target_defaults") {
^------------------------------
See //common-mk/gn_root/BUILD.gn:14:5: which caused the file to be included.
"//${platform_subdir}:all",
^-------------------------
But even if we add the pkg_deps but keep it empty, it fails with this error:
ERROR at //common-mk/pkg_config.gni:13:15: Script returned non-zero exit code.
ldflags = exec_script("//common-mk/args_generator_wrapper.py",
^----------
Current dir: /var/cache/portage/dev-util/bsdiff/out/Default/
Command: python -- /var/tmp/portage/dev-util/bsdiff-9999/work/bsdiff-9999/platform2/common-mk/args_generator_wrapper.py pkg-config --libs-only-L --libs-only-other
Returned 1.
stderr:
Must specify package names on the command line
Traceback (most recent call last):
File "/var/tmp/portage/dev-util/bsdiff-9999/work/bsdiff-9999/platform2/common-mk/args_generator_wrapper.py", line 27, in <module>
output = subprocess.check_output(sys.argv[1:]).strip()
File "/usr/lib64/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['pkg-config', '--libs-only-L', '--libs-only-other']' returned non-zero exit status 1
See //bsdiff/BUILD.gn:32:1: whence it was called.
pkg_config("target_defaults") {
^------------------------------
See //common-mk/gn_root/BUILD.gn:14:5: which caused the file to be included.
"//${platform_subdir}:all",
^-------------------------
One of these issues should be fixed in order to allow empty dependencies.
,
Oct 4
Could you explain which part of bsdiff/BUILD.gn causing the issue? I think pkg_config having no pkg_deps is same as config.
,
Oct 4
So if you look at https://cs.corp.google.com/chromeos_public/src/aosp/external/bsdiff/bsdiff.gyp there is not default dependency to libchrome and we don't want it. I have written an build.gn file for it here: you can test it if you want. https://android-review.googlesource.com/c/platform/external/bsdiff/+/778306
,
Oct 5
Thank you the conversion! I commented on the CL.
,
Oct 5
Thanks, your recommendation fixed it. closing this.
,
Oct 6
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/52f14537a99a33e976a7f70c781e9658a1d78324 commit 52f14537a99a33e976a7f70c781e9658a1d78324 Author: Keigo Oka <oka@chromium.org> Date: Sat Oct 06 06:13:27 2018 common-mk: allow empty pkg_deps in pkg_config Empty pkg_deps can naturally happen on building pkg_config conditionally. libbrillo GN migration (CL:1263999) depends on this CL. BUG=chromium:767517 BUG= chromium:892239 TEST=precq Change-Id: I882604c267756c6e79a70619790534a18b120303 Reviewed-on: https://chromium-review.googlesource.com/1263998 Commit-Ready: Keigo Oka <oka@chromium.org> Tested-by: Keigo Oka <oka@chromium.org> Reviewed-by: Keigo Oka <oka@chromium.org> [modify] https://crrev.com/52f14537a99a33e976a7f70c781e9658a1d78324/common-mk/pkg_config.gni
,
Oct 6
I realized sometime empty package is useful. So fixed it. |
|||
►
Sign in to add a comment |
|||
Comment 1 by ahass...@chromium.org
, Oct 4