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

Issue 770508 link

Starred by 2 users

Issue metadata

Status: Archived
Owner:
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

Building Chrome inside CrOS chroot fails due to depot_tools self-update

Project Member Reported by michae...@chromium.org, Sep 30 2017

Issue description

emerge'ing chromeos-chrome from source will fail inside CrOS chroot if certain binaries have not already been downloaded by depot_tools.

Same root cause as issue 769369 but the fix for the bots does not affect the developer build process.

> cros_sdk --chrome_root=$CHROME_ROOT
> rm -rf /mnt/host/depot_tools/.cipd*
> CHROME_ORIGIN=LOCAL_SOURCE emerge-samus -v1 --nodeps chromeos-chrome

gclient runhooks will fail.

WORKAROUND: Run ensure_bootstrap from inside your chroot (if it isn't found, update depot_tools first). This is only necessary once.


Output pasted below so searches lead to this bug:


________ running '/usr/bin/python2.7 src/third_party/binutils/download.py' in '/home/me/chrome_root'
 * ACCESS DENIED:  open_wr:      /home/me/depot_tools/tmp.bf3RuTjCt8
 * ACCESS DENIED:  open_wr:      /home/me/depot_tools/.cipd_client.OxBiqgK
Failed to fetch file gs://chromium-binutils/0cb5726d9701f8be6a81b199899de1de552922f2 for /home/me/chrome_root/src/third_party/binutils/Linux_x64/binutils.tar.bz2. [Err: /home/me/depot_tools/vpython: line 12: /home/me/depot_tools/.cipd_bin/vpython: No such file or directory
]
0> Failed to fetch file gs://chromium-binutils/0cb5726d9701f8be6a81b199899de1de552922f2 for /home/me/chrome_root/src/third_party/binutils/Linux_x64/binutils.tar.bz2, skipping. [Err: /home/me/depot_tools/vpython: line 12: /home/me/depot_tools/.cipd_bin/vpython: No such file or directory
]
Downloading 1 files took 1.229377 second(s)
Downloading /home/me/chrome_root/src/third_party/binutils/Linux_x64/binutils.tar.bz2
Traceback (most recent call last):
  File "src/third_party/binutils/download.py", line 130, in <module>
    sys.exit(main(sys.argv[1:]))
  File "src/third_party/binutils/download.py", line 117, in main
    return FetchAndExtract(arch)
  File "src/third_party/binutils/download.py", line 82, in FetchAndExtract
    '-s', sha1file])
  File "/usr/lib64/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['download_from_google_storage', '--no_resume', '--no_auth', '--bucket', 'chromium-binutils', '-s', '/home/me/chrome_root/src/third_party/binutils/Linux_x64/binutils.tar.bz2.sha1']' returned non-zero exit status 1
Error: Command '/usr/bin/python2.7 src/third_party/binutils/download.py' returned non-zero exit status 1 in /home/me/chrome_root
 * ERROR: chromeos-base/chromeos-chrome-63.0.3223.0_rc-r1::chromiumos failed (configure phase):
 *   (no error message)
 *
 * Call stack:
 *     ebuild.sh, line  93:  Called src_configure
 *   environment, line 3864:  Called die
 * The specific snippet of code:
 *           CFLAGS="${CFLAGS} ${EBUILD_CFLAGS[*]}" CXXFLAGS="${CXXFLAGS} ${EBUILD_CXXFLAGS[*]}" "${cmd[@]}" || die;
 *
 * If you need support, post the output of `emerge --info '=chromeos-base/chromeos-chrome-63.0.3223.0_rc-r1::chromiumos'`,
 * the complete build log and the output of `emerge -pqv '=chromeos-base/chromeos-chrome-63.0.3223.0_rc-r1::chromiumos'`.
 * The complete build log is located at '/build/samus/tmp/portage/logs/chromeos-base:chromeos-chrome-63.0.3223.0_rc-r1:20170930-211055.log'.
 * For convenience, a symlink to the build log is located at '/build/samus/tmp/portage/chromeos-base/chromeos-chrome-63.0.3223.0_rc-r1/temp/build.log'.
 * The ebuild environment file is located at '/build/samus/tmp/portage/chromeos-base/chromeos-chrome-63.0.3223.0_rc-r1/temp/environment'.
 * Working directory: '/build/samus/tmp/portage/chromeos-base/chromeos-chrome-63.0.3223.0_rc-r1/work/chromeos-chrome-63.0.3223.0_rc'
 * S: '/build/samus/tmp/portage/chromeos-base/chromeos-chrome-63.0.3223.0_rc-r1/work/chromeos-chrome-63.0.3223.0_rc'
 * --------------------------- ACCESS VIOLATION SUMMARY ---------------------------
 * LOG FILE: "/var/log/sandbox/sandbox-882.log"
 *
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: open_wr
S: deny
P: /home/me/depot_tools/tmp.bf3RuTjCt8
A: /home/me/depot_tools/tmp.bf3RuTjCt8
R: /mnt/host/depot_tools/tmp.bf3RuTjCt8
C: mktemp -p /home/me/depot_tools

F: open_wr
S: deny
P: /home/me/depot_tools/.cipd_client.OxBiqgK
A: /home/me/depot_tools/.cipd_client.OxBiqgK
R: /mnt/host/depot_tools/.cipd_client.OxBiqgK
C: mktemp /home/me/depot_tools/.cipd_client.XXXXXXX
 * --------------------------------------------------------------------------------

>>> Failed to emerge chromeos-base/chromeos-chrome-63.0.3223.0_rc-r1 for /build/samus/, Log file:

>>>  '/build/samus/tmp/portage/logs/chromeos-base:chromeos-chrome-63.0.3223.0_rc-r1:20170930-211055.log'

 * Messages for package chromeos-base/chromeos-chrome-63.0.3223.0_rc-r1 merged to /build/samus/:

 * CHROME_ORIGIN VALUE is LOCAL_SOURCE
 * /home/me/chrome_root should be set here properly
 * ERROR: chromeos-base/chromeos-chrome-63.0.3223.0_rc-r1::chromiumos failed (configure phase):
 *   (no error message)
 *
 * Call stack:
 *     ebuild.sh, line  93:  Called src_configure
 *   environment, line 3864:  Called die
 * The specific snippet of code:
 *           CFLAGS="${CFLAGS} ${EBUILD_CFLAGS[*]}" CXXFLAGS="${CXXFLAGS} ${EBUILD_CXXFLAGS[*]}" "${cmd[@]}" || die;
 *
 * If you need support, post the output of `emerge --info '=chromeos-base/chromeos-chrome-63.0.3223.0_rc-r1::chromiumos'`,
 * the complete build log and the output of `emerge -pqv '=chromeos-base/chromeos-chrome-63.0.3223.0_rc-r1::chromiumos'`.
 * The complete build log is located at '/build/samus/tmp/portage/logs/chromeos-base:chromeos-chrome-63.0.3223.0_rc-r1:20170930-211055.log'.
 * For convenience, a symlink to the build log is located at '/build/samus/tmp/portage/chromeos-base/chromeos-chrome-63.0.3223.0_rc-r1/temp/build.log'.
 * The ebuild environment file is located at '/build/samus/tmp/portage/chromeos-base/chromeos-chrome-63.0.3223.0_rc-r1/temp/environment'.
 * Working directory: '/build/samus/tmp/portage/chromeos-base/chromeos-chrome-63.0.3223.0_rc-r1/work/chromeos-chrome-63.0.3223.0_rc'
 * S: '/build/samus/tmp/portage/chromeos-base/chromeos-chrome-63.0.3223.0_rc-r1/work/chromeos-chrome-63.0.3223.0_rc'
 
Owner: vapier@chromium.org
I'm not the right owner for this.

The best fix I know is to have the cros_sdk scripts run ensure_bootstrap on entry, or self to add some kind of pre-emerge requirement in the ebuild to run the prep script.

vapier@ will know where to redirect ownership of those workarounds.
Cc: drinkcat@chromium.org
Potential fix here: https://chromium-review.googlesource.com/#/c/chromiumos/platform/crosutils/+/803196

AFAICT cros_sdk has it's own copy of depot_tools, so it should be ok to just run ensure_bootstrap in update_chroot.
Cc: vapier@chromium.org
Owner: drinkcat@chromium.org
Status: Started (was: Assigned)
Project Member

Comment 5 by bugdroid1@chromium.org, Dec 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosutils/+/03a6305ffc8128a8a48b0e6e5c0a794e1a46d2ba

commit 03a6305ffc8128a8a48b0e6e5c0a794e1a46d2ba
Author: Nicolas Boichat <drinkcat@google.com>
Date: Wed Dec 06 11:45:55 2017

update_chroot: Call ensure_bootstrap

To be able to emerge chromeos-chrome, the cros chroot needs to make
sure that depot_tools has already downloaded some binaries,
otherwise, emerging chromeos-chrome would fail with a sandbox
error that does not really tell the developer how to fix the issue.

Calling ensure_bootstrap in update_chroot should do the trick.

BUG= chromium:770508 
TEST=cros_sdk --chrome_root=$CHROME_ROOT
     rm -rf /mnt/host/depot_tools/.cipd*
     ./update_chroot
     CHROME_ORIGIN=LOCAL_SOURCE emerge-$BOARD chromeos-chrome
     cd ~/chrome_root/src/third_party/depot_tools; git status
        => no change

Change-Id: I7aebb6dd3f0b4bce9650a3a23943a6ce88c3689f
Reviewed-on: https://chromium-review.googlesource.com/803196
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/03a6305ffc8128a8a48b0e6e5c0a794e1a46d2ba/update_chroot

Status: Fixed (was: Started)
Status: Archived (was: Fixed)

Sign in to add a comment