• Dirk Pranke's avatar
    set compute_grit_inputs_for_analyze=True in the analyze step. · a3727f9e
    Dirk Pranke authored
    Normally when grit actions are defined during `gn gen`, we don't
    include all of the files that the .grd file depends on as inputs,
    because we don't need to; grit generates a .d file for dependencies
    so that rebuilds will happen correctly. And, computing the 
    dependencies is slow (it's equivalent to calling grit).
    
    However, if we don't include the dependencies in the gn build graph,
    then `analyze` doesn't know about them, and hence a change to a file
    that grit dependencies on will be ignored.
    
    This CL changes things such that when `gn gen` is being run as part
    of the `analyze` step, we do set the extra flag to compute the
    dependencies. This'll slow GN down, but that's better than 
    misreporting dependencies.
    
    In some cases, the .grd files try to include generated files
    (which may not exist at GN time). To work around this, you can
    mark the grit targets as `source_is_generated = true`; the
    downside of that is that that target will be skipped just as if
    compute_grit_inputs_for_analyze=False, however, this is still an
    improvement over not checking *any* of the grit targets. A better
    fix would be to have grit_info ignore any paths in the generated
    directory if they don't exist, and I'll try to do that in a 
    follow-up patch.
    
    R=brettw@chromium.org
    BUG=639328
    
    Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
    Change-Id: I9f6702b06f8a41a159e4599bf192db0abf9e77eb
    Reviewed-on: https://chromium-review.googlesource.com/545150
    Commit-Queue: Dirk Pranke <dpranke@chromium.org>
    Reviewed-by: default avatarBrett Wilson <brettw@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#487135}
    a3727f9e
BUILD.gn 4.1 KB