agents/skills/gn-deps-debugging/SKILL.md
Fix Chromium GN dependency metadata, include visibility, and DEPS rule failures by correcting the dependency graph accurately, not by adding broad dependencies that only make errors disappear.
*_win.cc, add the dependency inside the
matching platform block such as if (is_win).deps for implementation-only dependencies. If a symbol is used only
in .cc files, keep the dependency private.public_deps only for public API exposure. If a public header
exposes a type from another target in its declarations or inline code,
downstream consumers may need that dependency transitively..cc file when possible.// nogncheck. Use it only for known GN limitations with
conditional includes, and include the required bug reference if the local
codebase already documents one.Capture the failing command and output.
gn check or build command when an output directory and target are known.Classify the failure.
Find the target that owns the including file.
BUILD.gn files first.gn refs out/Default //path/to/file.cc --all
*_win.cc,
*_mac.mm, *_linux.cc, *_android.cc, or *_ios.mm. Platform-specific
files usually require platform-specific dependencies.Find the target that owns the included header.
BUILD.gn sources lists.public
variable, or a private implementation target.Choose the correct fix.
deps
vs public_deps, forward declaration, DEPS, and cycle handling rules..cc, add a private deps entry.deps entry inside the matching platform condition, for example
if (is_win).public_deps.DEPS file blocks the include, verify whether the dependency
direction is allowed by the architecture before adding include rules.gn path <out_dir> //target_a //target_b to inspect the dependency
chain that connects the targets.Validate the narrow change.
git cl format if BUILD.gn or DEPS files were edited.gn check or build command that reproduced
the issue.//chrome/browser:browser or another aggregate target
when a smaller target owns the failing file.public_deps because it makes the build pass, without
proving the type is part of a public header API.// nogncheck instead of fixing the dependency graph.When presenting a fix, state:
deps, public_deps, forward declaration, DEPS, or
target split.