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

Issue 623501 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: iOS , Mac
Pri: 3
Type: Bug



Sign in to add a comment

GN: too many files needs to be copied in bundle during incremental build

Project Member Reported by sdefresne@chromium.org, Jun 27 2016

Issue description

The create_bundle collects all bundle_data sources and arranges for them to be copied in the final bundle. However, it does not remember the link between the bundle_data deps and the sources, and mark all file copy as depending on the union of the bundle_data deps.

This means that all files are unnecessarily copied if the binary is relinked. This should be fixed.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 30 2016

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

commit 4c75ba4852a79bde5ce03ebff7065282c9fd8977
Author: sdefresne <sdefresne@chromium.org>
Date: Thu Jun 30 21:59:03 2016

Fix dependencies rules for create_bundle and bundle_data ninja steps.

Record the "bundle_data" target corresponding to a BundleFileRule object
so that the dependencies can be correctly computed when generating the
ninja steps for the "create_bundle" target.

Change the "stamp" step of "bundle_data" target in the generated ninja
to depends on the target dependencies and source files.

Change the "copy_bundle_data" steps of "create_bundle" target in the
generated ninja to depends on the "bundle_data" target that defined
the corresponding source files.

Change the "compile_xcassets" step of "create_bundle" target in the
generated ninja to depends on all the "bundle_data" targets that defined
the corresponding source files.

Change the rule used to determine whether a "bundle_data" source file
is part of an assets catalog (some file where incorrectly omitted causing
them to be incorrectly copied to the final bundle).

All those changes will allow the "copy_bundle_data" and "compile_xcassets"
steps to only depends on the targets that generate them (if any) and will
reduce the number of file copied into the final bundle during incremental
builds.

Fix unit tests with new expectations.

BUG= 623501 

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

[modify] https://crrev.com/4c75ba4852a79bde5ce03ebff7065282c9fd8977/tools/gn/BUILD.gn
[modify] https://crrev.com/4c75ba4852a79bde5ce03ebff7065282c9fd8977/tools/gn/bundle_data.cc
[modify] https://crrev.com/4c75ba4852a79bde5ce03ebff7065282c9fd8977/tools/gn/bundle_data.h
[modify] https://crrev.com/4c75ba4852a79bde5ce03ebff7065282c9fd8977/tools/gn/bundle_file_rule.cc
[modify] https://crrev.com/4c75ba4852a79bde5ce03ebff7065282c9fd8977/tools/gn/bundle_file_rule.h
[modify] https://crrev.com/4c75ba4852a79bde5ce03ebff7065282c9fd8977/tools/gn/gn.gyp
[modify] https://crrev.com/4c75ba4852a79bde5ce03ebff7065282c9fd8977/tools/gn/ninja_bundle_data_target_writer.cc
[add] https://crrev.com/4c75ba4852a79bde5ce03ebff7065282c9fd8977/tools/gn/ninja_bundle_data_target_writer_unittest.cc
[modify] https://crrev.com/4c75ba4852a79bde5ce03ebff7065282c9fd8977/tools/gn/ninja_create_bundle_target_writer.cc
[modify] https://crrev.com/4c75ba4852a79bde5ce03ebff7065282c9fd8977/tools/gn/ninja_create_bundle_target_writer.h
[modify] https://crrev.com/4c75ba4852a79bde5ce03ebff7065282c9fd8977/tools/gn/ninja_create_bundle_target_writer_unittest.cc
[modify] https://crrev.com/4c75ba4852a79bde5ce03ebff7065282c9fd8977/tools/gn/runtime_deps_unittest.cc
[modify] https://crrev.com/4c75ba4852a79bde5ce03ebff7065282c9fd8977/tools/gn/target_unittest.cc

Status: Fixed (was: Assigned)

Sign in to add a comment