• jbroman@chromium.org's avatar
    GN: (HeaderChecker) Allow any chain to forward direct dependent configs. · 0ded2c41
    jbroman@chromium.org authored
    When finding a dependency chain, the header check will now prefer chains which
    forward direct-dependent configs if the target which provides a header has
    one. Previously an error would be produced because the chain which was found
    did not forward configs, even though another chain did.
    
    A breadth-first search is used instead of a depth-first search because short
    chains are more likely to be intended by the author, and make for both less
    work and clearer diagnostic messages.
    
    This reduces the size of 'gn check' output on the chromium tree and the time
    to execute. (Output directed to 'wc -l' and /dev/null, respectively.)
    
      Before: 104685 lines, 542.36s user, 35.573s total
      After: 36977 lines, 7.10s user, 1.526s total
    
    Manual inspection reveals that the line reduction appears to be from the
    removal of spurious errors when IsDependencyOf selected an indirect chain
    which does not forward direct-dependent configs, even though a direct
    dependency existed. (About 7 cases were examined manually; sheer volume makes
    full manual verification infeasible.)
    
    BUG=391505
    TEST=HeaderCheckerTest, manual
    
    Review URL: https://codereview.chromium.org/424133002
    
    git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288110 0039d316-1c4b-4281-b951-d872f2087c98
    0ded2c41
header_checker.cc 19 KB