Skip to content

build: rebuild when the compile command changes - #524

Draft
TurkeyMan wants to merge 1 commit into
masterfrom
agent/build-command-stamp
Draft

build: rebuild when the compile command changes#524
TurkeyMan wants to merge 1 commit into
masterfrom
agent/build-command-stamp

Conversation

@TurkeyMan

Copy link
Copy Markdown
Member

What changed

Record the complete compiler command in $(OBJDIR)/build-flags and 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_CMD changes, so normal incremental builds remain quiet while flag-only changes rebuild the target.

Validation

  • native Windows debug build passed
  • unchanged command: make -q CONFIG=debug returned up to date
  • overridden DFLAGS: make -q returned stale
  • restoring normal flags: make -q returned stale, followed by a successful rebuild

@TurkeyMan
TurkeyMan force-pushed the agent/build-command-stamp branch from f4165c9 to 0ff81c1 Compare August 17, 2026 02:12
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
TurkeyMan force-pushed the agent/build-command-stamp branch from 0ff81c1 to 4f686b7 Compare August 17, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant