New issue
Advanced search Search tips

Issue 900871 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Nov 9
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug

Blocking:
issue 900181



Sign in to add a comment

Merge external_files.conf to ebuild

Project Member Reported by nya@chromium.org, Nov 1

Issue description

tl;dr I'll remove external_files.conf and let Tast to read the ebuild directly.


Background:

While we usually have two ebuild files per package (stable and unstable), we have only one files/ directory. This means that, when we make a change to files under files/ directory for the unstable build, it also affects the stable build.

To make the matter worse, this bug is often invisible due to Portage's cache (which I don't have a good understanding of). Let's say we want to register a file to external_files.conf in tast-local-tests-cros.

--- a/chromeos-base/tast-local-tests-cros/files/external_data.conf
+++ b/chromeos-base/tast-local-tests-cros/files/external_data.conf
@@ -38,3 +38,4 @@ video/data/bear_h264_320x180.mp4 gs://chromiumos-test-assets-public/tast/cros/vi
 video/data/bear_vp8_320x180.webm gs://chromiumos-test-assets-public/tast/cros/video/bear_vp8_320x180_20180629.webm
 video/data/bear_vp9_320x240.webm gs://chromiumos-test-assets-public/tast/cros/video/bear_vp9_320x240_20180629.webm
 video/data/traffic-1920x1080-8005020218f6b86bfa978e550d04956e.mp4 gs://chromiumos-test-assets-public/traffic/traffic-1920x1080-8005020218f6b86bfa978e550d04956e.mp4
+video/data/crowd1080.yuv gs://chromiumos-test-assets-public/crowd/crowd1080-96f60dd6ff87ba8b129301a0f36efc58.yuv

--- a/chromeos-base/tast-local-tests-cros/tast-local-tests-cros-9999.ebuild
+++ b/chromeos-base/tast-local-tests-cros/tast-local-tests-cros-9999.ebuild
@@ -39,6 +39,7 @@ TAST_BUNDLE_EXTERNAL_DATA_URLS=(
        "gs://chromiumos-test-assets-public/tast/cros/video/bear_vp8_320x180_20180629.webm"
        "gs://chromiumos-test-assets-public/tast/cros/video/bear_vp9_320x240_20180629.webm"
        "gs://chromiumos-test-assets-public/traffic/traffic-1920x1080-8005020218f6b86bfa978e550d04956e.mp4"
+       "gs://chromiumos-test-assets-public/crowd/crowd1080-96f60dd6ff87ba8b129301a0f36efc58.yuv"
 )
 
 inherit cros-workon tast-bundle

At this point, let's try:

 $ emerge-betty --pretend tast-local-tests-cros

Assuming cros_workon start is not used, this builds the stable build (in a dry run), and it passes.

Everything looks fine, right? But then let's insert just one line comment to eclass/tast-bundle.eclass:

--- a/eclass/tast-bundle.eclass
+++ b/eclass/tast-bundle.eclass
@@ -1,5 +1,6 @@
 # Copyright 2018 The Chromium OS Authors. All rights reserved.
 # Distributed under the terms of the GNU General Public License v2
+# foo
 
 # @ECLASS: tast-bundle.eclass
 # @MAINTAINER:

After making this harmless change, emerge starts to fail with the following error:

 * ERROR: chromeos-base/tast-local-tests-cros-0.0.1-r253::chromiumos failed (depend phase):
 *   'gs://chromiumos-test-assets-public/crowd/crowd1080-96f60dd6ff87ba8b129301a0f36efc58.yuv' in /mnt/host/source/src/third_party/chromiumos-overlay/chromeos-base/tast-local-tests-cros/files/external_data.conf but not in TAST_BUNDLE_EXTERNAL_DATA_URLS

So actually the stable ebuild was broken when we made a change to external_data.conf, but it appeared not because of caches.

Portage has too much freedom. It's not designed for humans like me making errors.

 
Labels: -Pri-3 Pri-1
Blocking: 900181
I've had a lot of trouble around the caching of external_files.conf too, and would also love to see it go away since then people would only need to edit one file instead of two. :-)
Cc: vapier@chromium.org
> While we usually have two ebuild files per package (stable and unstable), we have only one files/ directory. This means that, when we make a change to files under files/ directory for the unstable build, it also affects the stable build.

that applies to every cros-workon package that puts files under files/.  that's why the bots, when they see changes to files/, will perform an uprev on it.  for local development, this is normal behavior ... if you're making changes to files/, you should be using `cros-workon start ...` so that you always build the 9999 version.

> often invisible due to Portage's cache

that's the ebuild global invariant metadata:
https://devmanual.gentoo.org/general-concepts/portage-cache/index.html

> Assuming cros_workon start is not used, this builds the stable build (in a dry run), and it passes.

that's the bug.  we've never supported this flow.  it probably has "just worked" for many packages, but it's never been supported.

> Portage has too much freedom. It's not designed for humans like me making errors.

people complain when `emerge` and related operations are slow to calculate dependencies.  the metadata cache is the only way we can provide reasonable performance.  making changes outside of the ebuild standard breaks the guarantees of the cache.
> > While we usually have two ebuild files per package (stable and unstable), we have only one files/ directory. This means that, when we make a change to files under files/ directory for the unstable build, it also affects the stable build.
> 
> that applies to every cros-workon package that puts files under files/.  that's why the bots, when they see changes to files/, will perform an uprev on it.  for local development, this is normal behavior ... if you're making changes to files/, you should be using `cros-workon start ...` so that you always build the 9999 version.

Thanks, I was not aware that changes to files/ also triggers uprev.

> > Assuming cros_workon start is not used, this builds the stable build (in a dry run), and it passes.
> 
> that's the bug.  we've never supported this flow.  it probably has "just worked" for many packages, but it's never been supported.

Do you mean by "the bug" that it should be supported but not yet?

Do you have any open bug for it, or documentation that refers the restriction?


> > Portage has too much freedom. It's not designed for humans like me making errors.
> 
> people complain when `emerge` and related operations are slow to calculate dependencies.  the metadata cache is the only way we can provide reasonable performance.  making changes outside of the ebuild standard breaks the guarantees of the cache.

Portage has too much freedom, and Chrome OS introduced huge and complex layers like cros-workon on top of it, so it's too difficult for humans to tell what kind of changes violates "the ebuild standard", that's the problem. I guess you're the only person who understands it precisely in the team.

> Do you mean by "the bug" that it should be supported but not yet?

i mean we have supported workflows for cros-workon ebuilds, and what you're describing is not one of them (making changes to a cros-workon ebuild, but not using `cros-workon start`).  i don't think this is a flow we need to support.

> ...

the frameworks on frameworks do produce a complex system that can sometimes be difficult to keep a grasp on.  the ebuild rules can be distilled down to:
only inherited eclasses and the ebuild file itself are tracked for changes.  anything changed outside of those files (like things under files/) are impossible for portage to precisely keep track of while maintaining performance.

i'm not against trying to find improvements/simplifications to the overall system of course.  but what looks like an easy answer can often have unintentional cascading side effects :/.
Maybe we don't need to work on this because crbug.com/900181 may remove references to external files from ebuilds entirely.

Status: WontFix (was: Started)
crbug.com/900181 will fix this issue.

Sign in to add a comment