New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 892239 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Oct 5
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

BUILD.gn should allow empty pkg_deps

Project Member Reported by ahass...@chromium.org, Oct 4

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.
 
Description: Show this description
Could you explain which part of bsdiff/BUILD.gn causing the issue?
I think pkg_config having no pkg_deps is same as config.

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

Thank you the conversion!
I commented on the CL.
Status: WontFix (was: Untriaged)
Thanks, your recommendation fixed it. closing this.
Project Member

Comment 6 by bugdroid1@chromium.org, 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

Status: Fixed (was: WontFix)
I realized sometime empty package is useful. So fixed it.

Sign in to add a comment