Repository navigation
Report when a build runs against drifted submodules - #668
Merged
Merged
Conversation
goneng
marked this pull request as ready for review
September 18, 2026 07:49
goneng
force-pushed
the
warn-on-submodule-drift
branch
3 times, most recently
from
September 18, 2026 09:30
788dbc3 to
7fc80e6
Compare
Which commit each submodule sits on decides what gets compiled, but git status reports a drifted submodule and a merely dirty one the same way, so building against the wrong revision is easy to miss. * Add a git-submodule-check target to report any submodule that is not at the revision this tree records, recursively, since libgit2 sits under objective-git and its pin leaves a stale framework behind. * Warn and carry on locally, where parking a submodule on a commit of your own is a normal thing to be doing, and say it again once the build ends, keeping the status the build returned, since by then the first report is buried under tens of thousands of lines. * Fail under GitHub Actions instead, where the checkout is the only thing that places submodules and drift is a defect rather than a choice, and raise it as an annotation the run summary shows. * Have the help target accept the names the map target already accepts, so one carrying a digit or an underscore is listed.
goneng
force-pushed
the
warn-on-submodule-drift
branch
from
September 18, 2026 09:59
7fc80e6 to
f6710ec
Compare
Contributor
This was referenced Sep 19, 2026
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.

Which commit each submodule sits on decides what gets compiled, but
git statusreports a drifted submodule and a merely dirty one the same way, so building against the wrong revision is easy to miss.git-submodule-checktarget to report any submodule that is not at the revision this tree records. Locally it carries on, since parking one on a commit of your own is a normal thing to be doing mid-change.build,unit-test,ui-test,all-tests,archive), keeping the status the build itself returned.make helpandmappick the new target up on their own.helptarget accept the names themaptarget already accepts, so one carrying a digit or an underscore is listed.Locally: warn, and say it twice
A warning printed once, before a build, is never read. This workflow's last run came to 242,188 log lines, of which the step it would print in was 96,970, and the UI collapses every step by default. The failing build is the moment someone actually reads output, so the report is repeated at the end:
The build's own exit status is preserved, so a failure still fails and a success still succeeds.
On CI: fail
Warning is the wrong response there. Nothing on a runner parks a submodule deliberately,
actions/checkoutis the only thing that puts submodules in place, andrun make git-submodule-syncis advice nobody can act on mid-run. If this ever fires it means the checkout produced the wrong tree, and every artifact from that run should be distrusted rather than the run re-tried. So underGITHUB_ACTIONSit fails instead, with an error annotation that the run summary carries whatever the log does:That lands on the prerequisite, before
xcodebuildstarts, so nothing is built against a tree we do not trust.This should never fire today, and that is the point. Both checkouts that precede a
makeusesubmodules: recursive;script/update_libgit2only runs cmake and copieslibgit2.a, never checking anything out; and there is no cache action in the workflow. It is insurance for the day one of those three changes.Test plan
GITHUB_ACTIONS=true: the error annotation on stdout, which is the stream the runner parses, the readable form on stderr, and a non-zero exit.make unit-testthen stops at the prerequisite withxcodebuildnever invoked, while the same command withoutGITHUB_ACTIONSstill runs the tests.make build XCODEBUILD=trueexits 0,make build XCODEBUILD=falseprints the warning last and still reportsError 1.