Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Issue 2880093002: gn desc: printing public_deps without --all and --tree

Created:
3 years, 7 months ago by mbonadei1
Modified:
3 years, 6 months ago
Reviewers:
brettw
CC:
chromium-reviews, Dirk Pranke, tfarina, agrieve+watch_chromium.org, kjellander_chromium
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

gn desc: printing public_deps without --all and --tree 'gn desc' merges public_deps with deps even if it doesn't merge configs and public_configs. This CL removes this asymmetry only if the command is invoked without --tree and --all. In that case it becomes too complex to split the two different type of dependencies. BUG=None

Patch Set 1 #

Total comments: 6

Patch Set 2 : addressing some comments #

Total comments: 6

Patch Set 3 : adding data_deps and linked_deps #

Total comments: 2

Patch Set 4 : fixing documentation indentation #

Unified diffs Side-by-side diffs Delta from patch set Stats (+88 lines, -15 lines) Patch
M tools/gn/command_desc.cc View 1 2 3 3 chunks +19 lines, -3 lines 0 comments Download
M tools/gn/desc_builder.cc View 1 2 5 chunks +34 lines, -4 lines 0 comments Download
M tools/gn/target.h View 1 2 1 chunk +5 lines, -2 lines 0 comments Download
M tools/gn/target.cc View 1 2 1 chunk +14 lines, -6 lines 0 comments Download
M tools/gn/variables.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M tools/gn/variables.cc View 1 2 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (2 generated)
mbonadei1
3 years, 7 months ago (2017-05-15 07:09:03 UTC) #2
brettw
Sorry I took so long, just rediscovered this. https://codereview.chromium.org/2880093002/diff/1/tools/gn/command_desc.cc File tools/gn/command_desc.cc (right): https://codereview.chromium.org/2880093002/diff/1/tools/gn/command_desc.cc#newcode377 tools/gn/command_desc.cc:377: If ...
3 years, 7 months ago (2017-05-23 17:23:05 UTC) #4
mbonadei1
Thanks for the review. No worries, it isn't time critical. I added a comment to ...
3 years, 7 months ago (2017-05-26 09:29:44 UTC) #5
mbonadei1
On 2017/05/26 09:29:44, mbonadei1 wrote: > Thanks for the review. No worries, it isn't time ...
3 years, 6 months ago (2017-06-07 08:04:59 UTC) #6
brettw
The weirdest thing about deps printing is not that it groups public and private deps, ...
3 years, 6 months ago (2017-06-07 19:59:15 UTC) #7
mbonadei1
Thanks for the detailed comment. I've separated data_deps from private_deps and I've introduced two new ...
3 years, 6 months ago (2017-06-08 11:37:45 UTC) #8
brettw
The separate ability to list deps, public_deps, data_deps, and linked_deps looks good. For the overall ...
3 years, 6 months ago (2017-06-08 17:57:22 UTC) #9
brettw
https://codereview.chromium.org/2880093002/diff/40001/tools/gn/command_desc.cc File tools/gn/command_desc.cc (right): https://codereview.chromium.org/2880093002/diff/40001/tools/gn/command_desc.cc#newcode380 tools/gn/command_desc.cc:380: - deps: if the command is invoked without --tree ...
3 years, 6 months ago (2017-06-08 18:02:52 UTC) #10
mbonadei1
https://codereview.chromium.org/2880093002/diff/40001/tools/gn/command_desc.cc File tools/gn/command_desc.cc (right): https://codereview.chromium.org/2880093002/diff/40001/tools/gn/command_desc.cc#newcode380 tools/gn/command_desc.cc:380: - deps: if the command is invoked without --tree ...
3 years, 6 months ago (2017-06-09 11:16:36 UTC) #11
mbonadei1
> The separate ability to list deps, public_deps, data_deps, and linked_deps looks > good. Ok. ...
3 years, 6 months ago (2017-06-09 11:36:44 UTC) #12
brettw
3 years, 6 months ago (2017-06-09 22:05:24 UTC) #13
On 2017/06/09 11:36:44, mbonadei1 wrote:
> > The separate ability to list deps, public_deps, data_deps, and linked_deps
> looks
> > good.
> 
> Ok.
> 
> > For the overall default summary output I think we should change the current
> > section that says "Direct dependencies (try also "--all", ...)". This should
> be:
> > 
> > linked_deps (Synthetic combination of deps and public_deps, try also
"--all",
> > "--tree", "--all --tree", or explicitly request only "deps" or
"public_deps")
> > 
> > and then it should include the new linked_deps dump you have. It shouldn't
> print
> > public_deps and deps separately.
> 
> I am not 100% sure. DepsHandler in command_desc.cc has a complex behaviour:
> 
> * if the command is invoked with --tree or --all, the second parameter of this
>   function will be generated using the Target::DEPS_LINKED DepsIterationType;
> * if the command is invoked without --tree and --all, the second parameter of
>   this function will be generated using the Target::DEPS_PRIVATE
> DepsIterationType.
> 
> The summary "Direct dependencies (try also "--all", ...)" is printed when
--tree
> and
> --all are not passed by the user so in that case we are not using DEPS_LINKED
> but
> DEPS_PRIVATE.
> 
> So I am not sure that it is a good thing to print "linked deps" in that
> situation.
> Maybe we can explain that with --tree and --all the content of this section is
> created using linked dependencies while without it only shows direct
> dependencies
> and in that case having public_deps is important because they will not show up
> into
> the output of this section.

"Direct" dependencies are ones listed on the target, and so isn't contradictory
with "linked" dependencies.

We should have a linked_deps output, and that should support --all and --tree. I
think this should appear in the "desc" default output rather than "deps" and
"public_deps". I don't think this is contradictory, and this is the same
behavior we have today except it wouldn't include data_deps.

There's a question about what do do if the user says "desc //base deps --tree".
There isn't a lot of value in making a tree or recursively enumerating only
private deps. There is some value in doing this for public deps. To keep things
simple, I think it's best to just say --all and -tree don't work for the
individual types.

Powered by Google App Engine
This is Rietveld 408576698