New issue
Advanced search Search tips

Issue 718626 link

Starred by 2 users

Issue metadata

Status: Archived
Owner:
Closed: May 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

packaging of telemetry deps includes tar file from previous build

Project Member Reported by dbehr@chromium.org, May 4 2017

Issue description

When building chromeos-base/telemetry
I encountered this error:
>>> Unpacking ./dep-telemetry_dep.tar.bz2 to /build/kevin/tmp/portage/chromeos-base/telemetry-0.0.1-r6/work
* ACCESS DENIED:  open_wr:      /build/kevin/tmp/portage/chromeos-base/telemetry-0.0.1-r6/work/dep-telemetry_dep.tar.bz2
tar: ./dep-telemetry_dep.tar.bz2: Cannot open: Permission denied
tar: Exiting with failure status due to previous errors
* ERROR: chromeos-base/telemetry-0.0.1-r6::chromiumos failed (unpack phase):
*   failure unpacking ./dep-telemetry_dep.tar.bz2
* 
* Call stack:
*               ebuild.sh, line   93:  Called src_unpack
*             environment, line 3653:  Called unpack './dep-telemetry_dep.tar.bz2'
*        phase-helpers.sh, line  366:  Called __unpack_tar 'pbunzip2 --ignore-trailing-garbage=1'
*        phase-helpers.sh, line  299:  Called __assert_sigpipe_ok 'failure unpacking ./dep-telemetry_dep.tar.bz2'
*   isolated-functions.sh, line   39:  Called die
* The specific snippet of code:
*   [[ $x -ne 0 && $x -ne ${PORTAGE_SIGPIPE_STATUS:-141} ]] && die "$@"
* 
* If you need support, post the output of `emerge --info '=chromeos-base/telemetry-0.0.1-r6::chromiumos'`,
* the complete build log and the output of `emerge -pqv '=chromeos-base/telemetry-0.0.1-r6::chromiumos'`.
* The complete build log is located at '/build/kevin/tmp/portage/logs/chromeos-base:telemetry-0.0.1-r6:20170504-015252.log'.
* For convenience, a symlink to the build log is located at '/build/kevin/tmp/portage/chromeos-base/telemetry-0.0.1-r6/temp/build.log'.
* The ebuild environment file is located at '/build/kevin/tmp/portage/chromeos-base/telemetry-0.0.1-r6/temp/environment'.
* Working directory: '/build/kevin/tmp/portage/chromeos-base/telemetry-0.0.1-r6/work'
* S: '/build/kevin/tmp/portage/chromeos-base/telemetry-0.0.1-r6/work'
* --------------------------- ACCESS VIOLATION SUMMARY ---------------------------
* LOG FILE: "/var/log/sandbox/sandbox-187758.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: ./dep-telemetry_dep.tar.bz2
A: /build/kevin/tmp/portage/chromeos-base/telemetry-0.0.1-r6/work/dep-telemetry_dep.tar.bz2
R: /build/kevin/usr/local/build/autotest/packages/dep-telemetry_dep.tar.bz2
C: tar xof - 

The reason for it is that dep-telemetry_dep.tar.bz2 contains a copy of itself "dep-telemetry_dep.tar.bz2" so when it is decompressing, it tries to overwrite itself.

This happens, if I emerge chromeos-base/chromeos-chrome more than once. (I build chrome from source using LOCAL_SOURCE, it also probably happens with chromeos-chrome-9999).
This is because dep-telemetry_dep.tar.bz2 in /build/${BOARD}/usr/local/build/autotest/client/deps/telemetry_dep/ persists from previous build, so when the package is compressed, it includes old copy. Every time chrome is built, the package grows recursively.

Manually deleting /build/${BOARD}/usr/local/build/autotest/client/deps/telemetry_dep/dep-telemetry_dep.tar.bz2 before building chrome solves the issue, so i think the packager needs to make sure to either exclude the tar (and checksum) file or delete them before creating package.

 
Cc: akes...@chromium.org vapier@chromium.org
This is a weird one. The reason we generate the prebuilt is so that you don't need to download it again, if the MD5 hash is the same.

I suppose if we do reach the compile stage, we can delete the tarballs if any in the very beginning? 
BTW, the packaging logic should be applicable *only* to ebuilds that inehrit autotest.eclass.

I do not understand why it is related here.

AFAICT this ebuild doesn't have any invocations into autotest.
Project Member

Comment 3 by bugdroid1@chromium.org, May 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/ad5e10fa93a3b12c4ab201a35365fecda0b94e88

commit ad5e10fa93a3b12c4ab201a35365fecda0b94e88
Author: Prashant Malani <pmalani@google.com>
Date: Wed May 10 08:43:15 2017

packager: Exclude pre-existing packager tarball and checksum

This patch prevents a pernicious error where repeated builds can lead
to the tar.bz2 files getting included in new tar.bz2 packages, leading
to exponential increases in tarball size and other weird errors in the
unpackaging of these files.

Also use this patch to add tags to some similar log prints, so it is
clear which stage of the build these are coming from.

Finally, the quoting on some of the exclude strings was incorrect. So,
this patch fixes those errors too.

BUG= chromium:718626 
TEST=emerge-veyron_minnie chromeos-base/autotest-tests-wimax

Change-Id: Ibc8aceff2c608700e8bbe22f63b0ef7d0cd94d29
Reviewed-on: https://chromium-review.googlesource.com/498090
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Ilja H. Friedel <ihf@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Tested-by: Prashant Malani <pmalani@google.com>
Commit-Queue: Ilja H. Friedel <ihf@chromium.org>
Commit-Queue: Prashant Malani <pmalani@google.com>
Trybot-Ready: Prashant Malani <pmalani@google.com>

[modify] https://crrev.com/ad5e10fa93a3b12c4ab201a35365fecda0b94e88/utils/packager.py

Change is submitted. I'm marking this as closed. debhr@ kindly lmk if this issue persists.
Status: Fixed (was: Assigned)

Comment 6 by dchan@chromium.org, Aug 1 2017

Labels: VerifyIn-61

Comment 7 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Sign in to add a comment