.agents/skills/native-dependency-update/references/breaking-changes.md
Guidance for analyzing breaking changes when updating native dependencies.
| Level | Description | Action |
|---|---|---|
| ✅ Safe | No breaking changes | Direct update |
| ⚠️ Minor | New optional features | May need BUILD.gn update |
| 🔴 Breaking | API/ABI changes | Requires code changes |
Most projects document changes in files like CHANGES, CHANGELOG, NEWS, HISTORY, or RELEASE_NOTES. Read through the versions between current and target to understand what changed.
Look for:
Compare the current and target versions to identify file-level changes.
Step 1: Get ALL added/deleted files (no path filter)
cd externals/skia/third_party/externals/{dep}
git diff {old_version}..{new_version} --diff-filter=AD --name-only
⚠️ Do NOT filter by path. Different libraries have different structures—some use
src/, some have files in root, some uselib/. Get the full picture first.
Why this matters: In the libwebp 1.3.2→1.6.0 update, checking only src/dec, src/enc, src/dsp missed the new src/utils/palette.c file, causing a link failure.
Step 2: Cross-reference against BUILD.gn
Open externals/skia/third_party/{dep}/BUILD.gn and examine the sources list. For each new .c/.cpp file:
Step 3: Check deleted files against BUILD.gn
For each deleted file, search BUILD.gn. If referenced, it must be removed.
Flags explained:
--diff-filter=AD — shows only Added (A) and Deleted (D) files--name-only — shows just filenames for easy scanningNew source files - May need to be added to BUILD.gn, especially if they're:
Deleted source files - Will break the build if BUILD.gn still references them.
Modified source files - Usually fine, but worth noting the scope of changes.
Examine changes to public header files to understand API evolution:
Added exports - New functionality, backwards compatible (safe)
Removed exports - Breaking change! Code using these will fail to compile/link.
Changed signatures - Breaking change! Callers need to be updated.
Many libraries have a symbols export file (symbols.def, exports.def, etc.) that clearly shows what's added or removed.
Check if the library's own build configuration changed in ways that affect Skia's BUILD.gn:
Security-only releases - Usually patch the minimum code necessary. Very low risk.
Patch versions (1.2.3 → 1.2.4) - Bug fixes, typically backwards compatible. Low risk.
Minor versions (1.2.x → 1.3.x) - New features, deprecations may be introduced. Medium risk.
Major versions (1.x → 2.x) - Expect breaking changes. High risk, detailed analysis required.
scripts/symbols.def for export changesBUILD.gn changes are typically needed when:
BUILD.gn changes are usually NOT needed for:
The BUILD.gn lives at externals/skia/third_party/{dep}/BUILD.gn. Look at existing patterns—sources are listed explicitly, platform-specific code uses if (current_cpu == "...") conditionals.
When reporting analysis results:
## {dep} {old_version} → {new_version}
**Risk:** ✅ Safe / ⚠️ Minor / 🔴 Breaking
**Changes:**
- New APIs: {description or "None"}
- Removed APIs: {description or "None"}
- New source files: {list or "None"}
- Deleted source files: {list or "None"}
**BUILD.gn Impact:** {description or "No changes needed"}
**Recommendation:** {Safe to upgrade / Needs BUILD.gn update / Needs code changes}