New issue
Advanced search Search tips

Issue 595064 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

INSTALL_MASK isn't respected with 'cros deploy'

Project Member Reported by briannorris@chromium.org, Mar 15 2016

Issue description

The CrOS SDK chroot includes a series of bash hooks that modify INSTALL_MASK for some packages. However, it seems we don't set up INSTALL_MASK properly on devices, so 'cros deploy' fails with file collisions. For example, try running 'cros deploy ... net-dns/avahi', and you will see failures like the following:


$ cros deploy --board=${BOARD} $IP avahi
11:14:53: NOTICE: Cleaning outdated binary packages from /build/samus
11:14:59: NOTICE: These are the packages to emerge:
11:14:59: NOTICE: * 1) net-dns/avahi-0.6.31-r4
 [##############################################################################################################-------------------] 85%Exception during output capturing: RunCommandError("cwd=None, extra env={'LC_MESSAGES': 'C'}", <chromite.lib.cros_build_lib.CommandResult object at 0x7fa608add150>, None)
Captured stdout was:
sending incremental file list
avahi-0.6.31-r4.tbz2

sent 244,671 bytes  received 35 bytes  163,137.33 bytes/sec
total size is 251,169  speedup is 1.03

*** emerging by path is broken and may not always work!!!

Calculating dependencies  ... done!

>>> Emerging binary (1 of 1) net-dns/avahi-0.6.31-r4::portage-stable
 * avahi-0.6.31-r4.tbz2 size ;-) ...                                     [ ok ]
>>> Extracting info
 * Running stacked hooks for pre_pkg_setup
 *    sysroot_build_bin_dir ...
 [ ok ]
>>> Extracting net-dns/avahi-0.6.31-r4

>>> Installing (1 of 1) net-dns/avahi-0.6.31-r4::portage-stable
 * This package will overwrite one or more files that may belong to other
 * packages (see list below). You can use a command such as `portageq
 * owners / <filename>` to identify the installed package that owns a
 * file. If portageq reports that only one package owns a file then do
 * NOT file a bug report. A bug report is only useful if it identifies at
 * least two or more packages that are known to install the same file(s).
 * If a collision occurs and you can not explain where the file came from
 * then you should simply ignore the collision since there is not enough
 * information to determine if a real problem exists. Please do NOT file
 * a bug report at http://bugs.gentoo.org unless you report exactly which
 * two packages install the same file(s). See
 * http://wiki.gentoo.org/wiki/Knowledge_Base:Blockers for tips on how to
 * solve the problem. And once again, please do NOT file a bug report
 * unless you have completely understood the above message.
 * 
 * Detected file collision(s):
 * 
 * 	/etc/avahi/avahi-daemon.conf
 * 
 * Searching all installed packages for file collisions...
 * 
 * Press Ctrl-C to Stop
 * 
 * chromeos-base/chromeos-base-0-r132:0::chromiumos
 * 	/etc/avahi/avahi-daemon.conf
 * 
 * Package 'net-dns/avahi-0.6.31-r4' NOT merged due to file collisions.
 * If necessary, refer to your elog messages for the whole content of the
 * above message.

>>> Failed to install net-dns/avahi-0.6.31-r4, Log file:
[...]
 
Just learned about this one: seems like it might be a sufficient workaround to use PKG_INSTALL_MASK in addition to/instead of INSTALL_MASK? AIUI, that would prevent the file from being included in the tarball at all, so it wouldn't produce conflicts in cros deploy.

Seems like that strategy is still a bit fragile, since we'd have to remember to do that for all future uses of INSTALL_MASK. But we can at least patch things up today. What do you think?
Cc: briannorris@chromium.org
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 25 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/b82bac8249f3629ee623955981efb54132fee5de

commit b82bac8249f3629ee623955981efb54132fee5de
Author: Brian Norris <briannorris@chromium.org>
Date: Thu Mar 24 17:32:13 2016

always set PKG_INSTALL_MASK when setting INSTALL_MASK

INSTALL_MASK excludes files from being installed from an ebuild during
the install phase.

PKG_INSTALL_MASK excludes files from being included into the ebuild
binary/tarball at all.

The latter is ostensibly for reducing binary size (e.g., for embedded
systems), but it also has the benefit of working properly with 'cros
deploy', where the binary tarball is sent over to a dev-mode device for
installation. So, let's be consistent in always using both
PKG_INSTALL_MASK and INSTALL_MASK.

This resolves problems with, e.g., cros-deploying avahi, since emerge on
the DUT used to fail, complaining about conflicts on the
/etc/avahi/avahi-daemon.conf file, which we override in
chromeos-base/chromeos-base.

Also while I'm at it, 'unset' a few temporary ${FOO_mask} variables to
avoid polluting the variable space, and to match the style of other
similar constructs.

BUG= chromium:595064 
TEST=`cros deploy IP avahi`

Change-Id: Ie862e5dea2ce74b4c51aebeb7d8dab7590200f4c
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/334761
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/b82bac8249f3629ee623955981efb54132fee5de/chromeos/config/env/media-sound/alsa-utils
[modify] https://crrev.com/b82bac8249f3629ee623955981efb54132fee5de/chromeos/config/env/sys-apps/hwids
[modify] https://crrev.com/b82bac8249f3629ee623955981efb54132fee5de/chromeos/config/env/net-dns/avahi
[modify] https://crrev.com/b82bac8249f3629ee623955981efb54132fee5de/chromeos/config/env/sys-apps/util-linux

Labels: M-51
Status: Fixed (was: Untriaged)
OK, well I've fixed it up myself for now. I guess we can do the same fix if any more breakages like this appear again.
Labels: VerifyIn-54

Comment 6 by ka...@chromium.org, Aug 31 2016

Labels: Bulk-Verified
Status: Verified (was: Fixed)

Sign in to add a comment