gn-deps-debugging
यह क्या करती है
यह स्किल आपके AI को GN build निर्भरता की त्रुटियाँ खोजने और ठीक करने में मदद करती है। यह उन डेवलपर्स के लिए है जिन्हें बड़ा प्रोजेक्ट बनाते समय include फ़ाइलों या निर्भरता जाँच की त्रुटियाँ दिखती हैं।
कब इस्तेमाल करें
- ✓जब आपकी build GN निर्भरता या include visibility त्रुटि से विफल हो।
- ✓जब gn check बताए कि किसी target से कोई header फ़ाइल अनुमति प्राप्त नहीं है।
- ✓जब आपको build targets के बीच चक्रीय निर्भरता ठीक करनी है।
Skill का लिंक
https://github.com/chromium/chromium/blob/main/agents/skills/gn-deps-debugging/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरी build कहती है कि मेरे target से एक header दिखाई नहीं देता। क्या आप इसे ठीक करने वाली सही निर्भरता खोज सकते हैं?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
AI सटीक त्रुटि पढ़ता है, वह build target खोजता है जिसमें फ़ाइल है और जिसमें header है, और सबसे छोटी सही निर्भरता जोड़ता है। वह प्लेटफ़ॉर्म नियम बनाए रखता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
GN Dependency Debugging
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.
Core principles
- Read the exact error first. Identify the including source file, the included header, the failing target, and the diagnostic category before editing.
- Find both owning targets. Determine which GN target owns the including file and which GN target owns the included header.
- Prefer the narrowest dependency. Add the dependency to the smallest target that needs it, not a parent or aggregate target.
- Preserve platform conditions. If the failing include is in a
platform-specific file such as
*_win.cc, add the dependency inside the matching platform block such asif (is_win). - Use
depsfor implementation-only dependencies. If a symbol is used only in.ccfiles, keep the dependency private. - Use
public_depsonly 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. - Prefer forward declarations in headers. If a header only needs a pointer,
reference, or return type declaration, forward declare and move the include
to the
.ccfile when possible. - Do not paper over architecture issues. Circular dependencies usually indicate the need to split an interface target, move shared abstractions, or invert dependencies.
- Avoid
// nogncheck. Use it only for known GN limitations with conditional includes, and include the required bug reference if the local codebase already documents one.
Workflow
Capture the failing command and output.
- If the user provided a truncated error, ask for or rerun the relevant
gn checkor build command when an output directory and target are known. - Do not start a broad build just to reproduce unless the output directory and target are established.
- If the user provided a truncated error, ask for or rerun the relevant
Classify the failure.
- Read common-errors.md and map the diagnostic to one of the supported categories.
- Extract the including file, included header, and target names from the diagnostic.
Find the target that owns the including file.
- Inspect nearby
BUILD.gnfiles first. - Use GN queries when an output directory is known:
gn refs out/Default //path/to/file.cc --all - Prefer the most specific non-aggregate target that directly lists the file or owns the source set containing it.
- Check whether the file is platform-specific, such as
*_win.cc,*_mac.mm,*_linux.cc,*_android.cc, or*_ios.mm. Platform-specific files usually require platform-specific dependencies.
- Inspect nearby
Find the target that owns the included header.
- Search for the header in
BUILD.gnsources lists. - If several targets list it, prefer the public/interface target intended for consumers.
- Check whether the header belongs to a generated target, a
publicvariable, or a private implementation target.
- Search for the header in
Choose the correct fix.
- Read dependency-patterns.md for
depsvspublic_deps, forward declaration, DEPS, and cycle handling rules. - If the include appears only in
.cc, add a privatedepsentry. - If the include appears only in a platform-specific source file, add the
private
depsentry inside the matching platform condition, for exampleif (is_win). - If the include appears in a public header, first try to remove the include
using a forward declaration. If the header must expose the dependency, add
or promote the dependency to
public_deps. - If a
DEPSfile blocks the include, verify whether the dependency direction is allowed by the architecture before adding include rules. - If adding the dependency creates a cycle, stop and redesign the dependency
boundary instead of adding broader deps. When an output directory is known,
use
gn path <out_dir> //target_a //target_bto inspect the dependency chain that connects the targets.
- Read dependency-patterns.md for
Validate the narrow change.
- Run
git cl formatifBUILD.gnorDEPSfiles were edited. - Re-run the smallest relevant
gn checkor build command that reproduced the issue. - If
- Run
अक्सर पूछे जाने वाले सवाल
GN क्या है?
GN एक build टूल है, जिसे बड़े सॉफ़्टवेयर प्रोजेक्ट यह तय करने के लिए इस्तेमाल करते हैं कि कोड फ़ाइलें कैसे compile और link होंगी।
त्रुटि हटाने के लिए बस एक बड़ी निर्भरता क्यों न जोड़ें?
बड़ी निर्भरता असली समस्या छिपा सकती है और build धीमी कर सकती है। यह स्किल इसके बजाय सबसे संकीर्ण सुधार माँगती है।
मुझे यह स्किल कब इस्तेमाल नहीं करनी चाहिए?
निर्भरता और include त्रुटियों के लिए इसे इस्तेमाल करें। compile, link या runtime विफलताओं के लिए दूसरा तरीका बेहतर है।
जानकारी
लेखक का मूल विवरण
Diagnose Chromium GN dependency and include-visibility failures, including BUILD.gn deps/public_deps, DEPS include rules, private headers, and circular dependencies. Use for build or gn check dependency errors, not C++/link/runtime/test failures.
repo: chromium/chromium
लोकप्रियता
- GitHub स्टार
- 25k
- रैंकिंग में स्थान
- #10058
- लाइसेंस
- BSD-3-Clause
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
fuzzing
25kयह आपके एजेंट को फ़ज़ टेस्ट लिखने में मदद करती है, जो कोड में बहुत से यादृच्छिक इनपुट डालकर C++ कोड में क्रैश और बग खोजते हैं।
java-memory-leaks
25kयह आपके एजेंट को LeakCanary की लीक रिपोर्ट पढ़कर Android ऐप्स में Java मेमोरी लीक खोजने और ठीक करने में मदद करती है।
jni-type-conversion
25kयह आपके एजेंट को Android कोड में हाथ से लिखे Java-से-C++ रूपांतरण कोड की जगह सरल @JniType annotations लगाने में मदद करती है।
loadline
25kयह आपके एजेंट को LoadLine बेंचमार्क चलाने में मदद करती है, जो मापते हैं कि Android और डेस्कटॉप Chrome पर वेब पेज कितनी तेज़ी से लोड होते हैं।
मिलती-जुलती skills
openclaw-update
394kयह आपके एजेंट को चल रहे OpenClaw Gateway को अपडेट करने में मदद करती है, इंस्टॉल के तरीके के अनुसार सही विधि चुनकर और सेशन बनाए रखकर।
diagnose-gateway
394kयह आपके एजेंट को सेटिंग्स, चैनल और पोर्ट जांचकर पता लगाने देती है कि OpenClaw Gateway क्यों फ़ेल हो रहा है, बिना कुछ बदले।
crabbox-apps
394kयह आपके एजेंट को किसी अस्थायी क्लाउड मशीन पर ऐप खोलने और चलाने देती है, फिर उसका व्यू आपके चैट के साइड पैनल में दिखाती है।