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

Issue 611414 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS , Mac
Pri: 1
Type: Bug

Blocking:
issue 297668



Sign in to add a comment

gn desc runtime_deps is wrong for bundled targets

Project Member Reported by rsesek@chromium.org, May 12 2016

Issue description

tools/mb/mb.py uses `gn desc [out] [label] runtime_deps` to find files to isolate for swarming. But the runtime_deps command does not properly handle create_bundle targets. There are two issues:

- The bundle directory is not listed as a dependency.
- The search for runtime_deps recurses into the targets that make up the bundle itself. This causes the intermediate shared_library/executable output to be listed instead.

As an example: If I specify //chrome:chrome_framework as a data_deps on //chrome/test:browser_tests, the "Chromium Framework.framework" is not outputted as a runtime_deps. The only thing that is listed is the intermediate library "obj/chrome/chrome_framework_shared_library/Chromium Framework". That intermediate should not be listed.

I think an appropriate fix would be to:

1) Emit the bundle's root directory as a runtime_deps (similar to what was done for outputs here https://codereview.chromium.org/1892243002/).
2) Stop traversing dependencies if the target is a create_bundle. The search for runtime_deps should not traverse into a create_bundle's deps or public_deps.

I think 2) is appropriate, since if a bundle has any dependencies, it should really just be included in the bundle itself.
 

Comment 1 by rsesek@chromium.org, May 12 2016

Blocking: 297668

Comment 2 by rsesek@chromium.org, May 12 2016

Owner: rsesek@chromium.org
Status: Started (was: Untriaged)
Cc: agrieve@chromium.org
Labels: OS-Android
fwiw, we've had a similar issue w/ APKs on Android. I think some generic mechanism to tell GN that a target is (or will be) self-contained and doesn't need to be recursed into is a good idea.

+agrieve for related thoughts ...

Comment 4 by rsesek@chromium.org, May 13 2016

Does Android use create_bundle for APKs? Should it? It seems pretty analogous to Mac bundles.

CL: https://codereview.chromium.org/1982463002/
No, it doesn't use create_bundle now.

It is close, but it's not quite the same. I hope to figure out how to consolidate much of this logic (including how we handle isolates and some of the things we do for tarring up packages like for blimp), but we were going around in circles trying to work out how to do that a couple months ago, and so it's better to do independent things for the moment.
The android_resources() and android_assets() rules do also have the concept of leaf nodes - android_apk() being the main one.

I do like the idea of having an x-platform way of specifying "I'd like these files available at runtime", but Android Assets being contained within the .apk means the C++ side would need a custom x-platform API for getting at them. I'd love to have this, but it's work no one's taken on yet.
Project Member

Comment 8 by bugdroid1@chromium.org, May 31 2016

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

commit be4da4cd67c068e11bd226979faf1f578dae5a3f
Author: rsesek <rsesek@chromium.org>
Date: Tue May 31 20:10:49 2016

[Mac/GN] Collect a bundle's data_deps when using `gn desc runtime_deps`.

In 903e2b85c71675f83767ac9b1687087382b49f39, GN stopped recursing into bundles
to collect target dependencies. But any explicit data_deps on a bundle should be
included in the runtime_deps output.

BUG= 611414 
R=brettw@chromium.org,sdefresne@chromium.org

Review-Url: https://codereview.chromium.org/2010173004
Cr-Commit-Position: refs/heads/master@{#396910}

[modify] https://crrev.com/be4da4cd67c068e11bd226979faf1f578dae5a3f/tools/gn/runtime_deps.cc
[modify] https://crrev.com/be4da4cd67c068e11bd226979faf1f578dae5a3f/tools/gn/runtime_deps_unittest.cc

Labels: -OS-Android
Status: Fixed (was: Started)
I'm going to call this Fixed, since Android doesn't seem applicable here, given that it doesn't use create_bundle.
Project Member

Comment 11 by bugdroid1@chromium.org, Jun 13 2017

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

commit ff583c8b9182fc8fde41d2ebed27dc49ed92745a
Author: Robert Sesek <rsesek@chromium.org>
Date: Tue Jun 13 20:15:33 2017

Remove explicit data entries for bundled targets in //chrome/test:browser_tests.

Bundled targets specified as data_deps used to not be collected as runtime_deps,
but that was fixed in  https://crbug.com/611414 . Listing these as explicit data
is no longer necessary, and the hard-coded "Chromium" names are wrong when
swarming official build tests.

Bug:  611414 
Bug: 731290
Change-Id: I3cffbc1b13552197524d91be85b49b281116020a
Reviewed-on: https://chromium-review.googlesource.com/533754
Reviewed-by: Michael Moss <mmoss@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#479119}
[modify] https://crrev.com/ff583c8b9182fc8fde41d2ebed27dc49ed92745a/chrome/test/BUILD.gn

Sign in to add a comment