build: rebuild when the compile command changes - #524
Draft
TurkeyMan wants to merge 1 commit into
Draft
Conversation
TurkeyMan
force-pushed
the
agent/build-command-stamp
branch
from
August 17, 2026 02:12
f4165c9 to
0ff81c1
Compare
Record COMPILE_CMD in the object directory and make the target depend on it. Flag-only changes now invalidate an existing binary without forcing every invocation to rebuild.
TurkeyMan
force-pushed
the
agent/build-command-stamp
branch
from
August 17, 2026 05:07
0ff81c1 to
4f686b7
Compare
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.
What changed
Record the complete compiler command in
$(OBJDIR)/build-flagsand make the output target depend on that stamp.Root cause
Source timestamps alone do not capture flag-only changes. Updating a version flag or platform compiler option could therefore leave an existing binary built with the previous command.
Impact
The stamp timestamp changes only when
COMPILE_CMDchanges, so normal incremental builds remain quiet while flag-only changes rebuild the target.Validation
make -q CONFIG=debugreturned up to dateDFLAGS:make -qreturned stalemake -qreturned stale, followed by a successful rebuild