Repository navigation
Report when a build runs against stale framework headers - #694
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A built
ObjectiveGit.frameworkcarries its own copy of libgit2's headers, which Xcode puts there inObjectiveGit-Mac's "Copy git2 Headers" phase. That phase runs after the same target'sSourcesphase, 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_HEXSZandgit_strarray_free, none of which the sources are actually wrong about. Nothing in the tree said so; #652 explains why those symbols normally resolve.framework-checktarget comparing the framework's copy ofgit2/version.hagainst 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.git-submodule-checkalready does for drift.framework-cleantarget 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.framework-checka prerequisite ofbuild, the test targets andarchive, and report it again once the build ends, since by then the first report is buried under tens of thousands of lines.Test plan
make framework-checkwarns and exits 0;GITHUB_ACTIONS=1 make framework-checkprints the annotation and exits 1. With the two in step both are silent, as they are when nothing is built yet.make framework-cleanremoves the framework, and themake buildthat follows copies current headers back in and succeeds, so the state the check reports is one the fix actually clears.make helpandmake maplist the new targets and their edges, and every recipe still expands intact under the GNU Make 3.81 that ships with macOS.