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

Issue 671191 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

GN: "gn path" not really useful to debug "gn check"

Project Member Reported by sdefresne@chromium.org, Dec 5 2016

Issue description

I was asked today by a coworker why "gn check" was not complaining about missing dependency on "//url" when they included "url/gurl.h" in one of the file from the "//foo" target (target renamed as it was in the downstream iOS repository).

Inspecting "gn path" told us there was no public path between "//foo" and "//url" which confounded us:

$ gn path ../out/Debug-iphonesimulator //foo //url
//foo:foo --[private]-->
//components/metrics:net --[private]-->
//url:url

Showing one of 15 "interesting" non-data paths. 0 of them are public.
Use --all to print all paths.

When debugging "gn check", we found that "//net" has a public dependency on "//url" and "//foo" had a public dependency on "//net". This explain why "gn check" is not complaining (since we have "//foo" --[private]--> "//net" --[public]--> "//url") but make "gn path" a poor tool to debug "gn check".

The issue is that "gn check" allows the first dependency to be private if all the others are public, but "gn path" do not consider those path as privileged. Maybe "gn path" should favour non-public path if all but the first is public when selecting the path to display or maybe an option could be added to use the same rule for "gn check" and "gn path".

Or maybe we should add "--explain" option to "gn check" to have it explain why a given include is valid/invalid.
 
Cc: olivierrobin@chromium.org
I'm not quite sure what the request is. Are you saying that you'd expect `gn check` to fail if there were no public paths between the components, and so the fact that check told you of a path wasn't helpful enough? 
I think the request is to have a way to understand why "gn check" does not complain about a missing deps when I expect it to do. This is the second time in a week that I debug "gn check" to try to answer that question, and each time this was due to the same  pattern ("//foo" --[private]--> "//net" --[public]--> "//url").

Maybe we can have a --as-gn-check option to gn path, that would use the same meaning as "gn check" for considering a path as allowing a include.
Labels: Build-Tools-GN
Components: Build

Sign in to add a comment