Skip to content

Report when a build runs against stale framework headers - #694

Merged
hannesa2 merged 1 commit into
masterfrom
report-stale-framework-headers
Sep 19, 2026
Merged

hannesa2 merged 1 commit into
masterfrom
report-stale-framework-headers

Conversation

@goneng

@goneng goneng commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

A built ObjectiveGit.framework carries its own copy of libgit2's headers, which Xcode puts there in ObjectiveGit-Mac's "Copy git2 Headers" phase. That phase runs after the same target's Sources phase, so once the copy and the tree disagree the compile meets both sets of git2 headers and dies on them before the phase that would refresh the copy ever runs. The build directory cannot repair itself, however many times it is rebuilt, and the only way out is to delete the framework or the whole of DerivedData.

This is not hypothetical: the 0.28.5 to 1.x jump in gitx/objective-git#101 stranded a local build directory on 0.28.5 headers, and the failure reads as a wall of errors over git_transfer_progress, GIT_OID_HEXSZ and git_strarray_free, none of which the sources are actually wrong about. Nothing in the tree said so; #652 explains why those symbols normally resolve.

  • Add a framework-check target comparing the framework's copy of git2/version.h against the submodule's, which the copy phase writes verbatim, across every configuration, since a Release framework left behind by an archive goes stale just as a Debug one does.
  • Warn and carry on locally, and fail under GitHub Actions with an annotation instead, as git-submodule-check already does for drift.
  • Add a framework-clean target dropping the framework alone rather than the whole build directory, so the next build copies the current headers back in and everything else stays warm.
  • Make framework-check a prerequisite of build, the test targets and archive, and report it again once the build ends, since by then the first report is buried under tens of thousands of lines.

Test plan

  • With a framework deliberately left on libgit2 0.28.5 against a 1.9.7 tree, make framework-check warns and exits 0; GITHUB_ACTIONS=1 make framework-check prints the annotation and exits 1. With the two in step both are silent, as they are when nothing is built yet.
  • make framework-clean removes the framework, and the make build that follows copies current headers back in and succeeds, so the state the check reports is one the fix actually clears.
  • make help and make map list the new targets and their edges, and every recipe still expands intact under the GNU Make 3.81 that ships with macOS.

A built ObjectiveGit.framework carries its own copy of libgit2's headers,
which Xcode puts there in a phase that runs after the compile that reads
them. So once the copy and the tree disagree, the compile meets both sets
of git2 headers and dies on them before the phase that would refresh the
copy ever runs, and no amount of rebuilding gets out of it.

* Add a framework-check target comparing the framework's copy of
  git2/version.h against the submodule's, which the copy phase writes
  verbatim, across every configuration, since a Release framework left
  behind by an archive goes stale just as a Debug one does.
* Warn and carry on locally, and fail under GitHub Actions with an
  annotation instead, as git-submodule-check already does for drift.
* Add a framework-clean target dropping the framework alone rather than
  the whole build directory, so that the next build copies the current
  headers back in and everything else stays warm.
* Make framework-check a prerequisite of build, the test targets and
  archive, and report it again once the build ends, since by then the
  first report is buried under tens of thousands of lines.
@goneng goneng added the WIP Work in progress label Sep 19, 2026
@goneng goneng added pipeline CI pipeline and removed WIP Work in progress labels Sep 19, 2026
@goneng
goneng marked this pull request as ready for review September 19, 2026 16:47
@goneng goneng added the bugfix label Sep 19, 2026
@hannesa2
hannesa2 merged commit 4a7341c into master Sep 19, 2026
6 checks passed
@hannesa2
hannesa2 deleted the report-stale-framework-headers branch September 19, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants