jkleinsc

#54847: build: skip exporting patches for targets that are not checked out

Merged
Created: Oct 12, 2026, 9:30:12 AM
Merged: Oct 12, 2026, 11:56:27 AM
2 comments
Target: main

Requested by John Kleinschmidt · Slack thread

Description of Change

Patch export now skips any target whose repo has no .git entry, in both script/export_all_patches.py (e patches all) and git.export_patches (e patches <target>).

When a dep is gated behind a checkout condition that is off, like src/third_party/fontconfig/src (checkout_linux) on macOS and Windows, gclient leaves an empty directory where the gitlink points. The old check only tested that the path existed, so export ran git inside the empty directory. Git then resolved to the parent Chromium src repo, wrote Chromium's patches into that target's patch dir and deleted its real patches. This matches the apply-side fix in #54741.

I tested this against a local repro: a fake src repo with an unfetched fontconfig gitlink, plus a real fontconfig clone. With the fix, patches/fontconfig stays untouched on the empty checkout, and the chromium and real-fontconfig targets still export the same patches as before.

This needs a backport to 44-x-y. There, the fontconfig target added in #54666 makes e patches all hit this bug on macOS and Windows checkouts.

Checklist

Release Notes

Notes: none

🤖 Generated with Claude Code

https://claude.ai/code/session_01VtCqxtcRjyqNbTVx5BPteM


Generated by Claude Code

Backports

44-x-y
Merged
PR Number
#54856
Merged At
Oct 12, 2026, 1:13:42 PM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron