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

Issue 606432 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

NACL roll broke GN in simple chrome

Project Member Reported by steve...@chromium.org, Apr 25 2016

Issue description

This CL:

https://codereview.chromium.org/1911393002

Introduced this error when board=amd64-generic:

~/Work/chrome/src ((9ce787a...)) $ cros chrome-sdk --board=amd64-generic
(sdk amd64-generic R52-8186.0.0-b16234) stevenjb@stevenjb3 ~/Work/chrome/src $ gn gen out_$SDK_BOARD/Release --args="$GN_ARGS"
ERROR at //build/config/linux/pkg_config.gni:85:17: Script returned non-zero exit code.
    pkgresult = exec_script(pkg_config_script, args, "value")
                ^----------
Current dir: /usr/local/google/home/stevenjb/Work/chrome/src/out_amd64-generic/Release/
Command: python -- /usr/local/google/home/stevenjb/Work/chrome/src/build/config/linux/pkg-config.py -s /usr/local/google/home/stevenjb/Work/chrome/.cros_cache/chrome-sdk/tarballs/amd64-generic+8186.0.0+sysroot_chromeos-base_chromeos-chrome.tar.xz -a x64 freetype2
Returned 1.
stderr:

Traceback (most recent call last):
  File "/usr/local/google/home/stevenjb/Work/chrome/src/build/config/linux/pkg-config.py", line 219, in <module>
    sys.exit(main())
  File "/usr/local/google/home/stevenjb/Work/chrome/src/build/config/linux/pkg-config.py", line 138, in main
    prefix = GetPkgConfigPrefixToStrip(args)
  File "/usr/local/google/home/stevenjb/Work/chrome/src/build/config/linux/pkg-config.py", line 80, in GetPkgConfigPrefixToStrip
    env=os.environ)
  File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['pkg-config', '--variable=prefix', 'freetype2']' returned non-zero exit status 1

See //build/config/linux/BUILD.gn:36:1: whence it was called.
pkg_config("freetype2") {
^------------------------

Note: x86-generic works fine
 
Cc: steve...@chromium.org
Owner: hashimoto@chromium.org
Status: Assigned (was: Started)
Actually, I'm not sure where to begin on this. I am guessing that this change to NaCl is involved?

    2016-04-20 hashimoto Set bootstrap toolchain's toolchain_os to target_os

Comment 2 by msw@chromium.org, Apr 25 2016

I had a similar error on my first attempt to do simple chrome, etc.:

(sdk link R52-8232.0.0) msw@mwasserman /work/chrome-git/src $ gn gen out_$SDK_BOARD/Release --args="$GN_ARGS"
ERROR at //build/config/linux/pkg_config.gni:85:17: Script returned non-zero exit code.
    pkgresult = exec_script(pkg_config_script, args, "value")
                ^----------
Current dir: /work/chrome-git/src/out_link/Release/
Command: python -- /work/chrome-git/src/build/config/linux/pkg-config.py -s /work/chrome-git/.cros_cache/chrome-sdk/tarballs/link+8232.0.0+sysroot_chromeos-base_chromeos-chrome.tar.xz -a x64 glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0
Returned 1.
stderr:

Traceback (most recent call last):
  File "/work/chrome-git/src/build/config/linux/pkg-config.py", line 219, in <module>
    sys.exit(main())
  File "/work/chrome-git/src/build/config/linux/pkg-config.py", line 138, in main
    prefix = GetPkgConfigPrefixToStrip(args)
  File "/work/chrome-git/src/build/config/linux/pkg-config.py", line 80, in GetPkgConfigPrefixToStrip
    env=os.environ)
  File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['pkg-config', '--variable=prefix', 'glib-2.0', 'gmodule-2.0', 'gobject-2.0', 'gthread-2.0']' returned non-zero exit status 1

See //build/config/linux/BUILD.gn:86:1: whence it was called.
pkg_config("glib") {
^-------------------
IIUC what is broken is build/config/linux/pkg-config.py

https://codereview.chromium.org/1901353002/ and https://codereview.chromium.org/1902683004/ made GN use the correct sysroot (e.g. amd64-generic+8186.0.0+sysroot_chromeos-base_chromeos-chrome.tar.xz) instead of the debian sysroot under build/linux.

On my workstation, pkg-config-wrapper (the script used by GYP) work fine with a cros sysroot.
 % build/linux/pkg-config-wrapper /usr/local/ssd2/chrome/.cros_cache/chrome-sdk/tarballs/link+8186.0.0+sysroot_chromeos-base_chromeos-chrome.tar.xz arm lib64 --cflags freetype2
 -I/usr/local/ssd2/chrome/.cros_cache/chrome-sdk/tarballs/link+8186.0.0+sysroot_chromeos-base_chromeos-chrome.tar.xz/usr/include/freetype2

OTOH, pkg-config.py (the script used by GN) cannot find the package in the cros sysroot.
 % build/config/linux/pkg-config.py -s /usr/local/ssd2/chrome/.cros_cache/chrome-sdk/tarballs/link+8186.0.0+sysroot_chromeos-base_chromeos-chrome.tar.xz -a x64 freetype2
 Traceback (most recent call last):
   File "build/config/linux/pkg-config.py", line 219, in <module>
     sys.exit(main())
   File "build/config/linux/pkg-config.py", line 138, in main
     prefix = GetPkgConfigPrefixToStrip(args)
   File "build/config/linux/pkg-config.py", line 80, in GetPkgConfigPrefixToStrip
     env=os.environ)
   File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
     raise CalledProcessError(retcode, cmd, output=output)
 subprocess.CalledProcessError: Command '['pkg-config', '--variable=prefix', 'freetype2']' returned non-zero exit status 1
Status: Started (was: Assigned)
Made a fix https://codereview.chromium.org/1914103002/
Project Member

Comment 5 by bugdroid1@chromium.org, Apr 26 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a82baa163c5969ef8f4733ecfeb5fe20cf51cd13

commit a82baa163c5969ef8f4733ecfeb5fe20cf51cd13
Author: hashimoto <hashimoto@chromium.org>
Date: Tue Apr 26 18:57:36 2016

GN: Respect system libdir whenever building with the traget sysroot

Nacl uses its own toolchain with the target sysroot.
System libdir should be respected with that toolchain too.

BUG= 606432 

Review URL: https://codereview.chromium.org/1914103002

Cr-Commit-Position: refs/heads/master@{#389830}

[modify] https://crrev.com/a82baa163c5969ef8f4733ecfeb5fe20cf51cd13/build/config/linux/pkg_config.gni

Status: Fixed (was: Started)
Bulk verified
Status: Verified (was: Fixed)
bulk verified

Sign in to add a comment