Skip to content

make: a linker cfg edit relinks the PRG (#305) - #306

Merged
JC-000 merged 3 commits into
masterfrom
fix/prg-depends-on-cfg
Oct 15, 2026
Merged

JC-000 merged 3 commits into
masterfrom
fix/prg-depends-on-cfg

Conversation

@JC-000

@JC-000 JC-000 commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Closes #305

Fix

build/flags.stamp now includes the selected cfg's sha256 (CFG_SHA256). A cfg content change takes the existing parse-time path: stamp rewritten, objects and all four link outputs deleted. Content-based, so the macOS make 3.81 1-second mtime trap does not apply. Edit is two local spots in the stamp block (a variable and one body line), clear of the wildcard lines. Over-invalidation: a cfg edit also rebuilds objects (~0.4 s), the same as any flag change.

Red-green

New test_cfg_edit_relinks_every_link_output (tools/test_build_flags_stamp.py): per cfg, builds in a farm with a private cfg copy, checks an untouched cfg relinks nothing, appends a comment, asserts ld65 runs, PRG/labels/map/dbg all rewritten, PRG sha unchanged. Profiles: uci.cfg (REU and onchip), uci-onchip.cfg (comb COLD_BANK=0), uci-onchip-cold.cfg (comb), uci-m3.cfg. ip65 is not in the test (needs ip65 libs); checked by hand in the worktree, stale before and relinked after.

  • origin/master Makefile: all five profiles STALE ("Nothing to be done"); the test FAILS.
  • With the fix: python3 tools/test_build_flags_stamp.py PASSED, 18/18 (all pre-existing cases still pass, including the dry-run and no-op-rebuild ones).

PRG bytes unchanged

make package under LANG=en_US.UTF-8, before and after the Makefile change, identical:

  • ip65-onchip 810f115800ffb643b455a253ab6b2565e5f5543759ef2bc5c740c2fdd0489bdc
  • uci-onchip ffa47fc32e43a16b995faee0d85d3d9312e1791a568820fedf7c0446bd27dfa6
  • uci-comb 67cb00488543cf3d39051c5035768e482d71e15c254b8db1099b4ef478fdb7ae

No hardware run: the PRGs are byte-identical, so there is nothing new for a device to execute.

CLAUDE.md: one clause in the flags.stamp paragraph.

Amendment (review)

  • The test no longer sleeps between build and cfg edit, so it pins the content property. Mutant ($(PRG): $(PRG_DEPS) $(CFG), no hash): test_cfg_edit_relinks_every_link_output and the new ip65 test FAIL; with the fix 19/19 pass.
  • New test_ip65_cfg_edit_changes_the_stamp_and_clears_outputs (goal build/flags.stamp, no ip65 link).
  • Separate issue for the ip65 blob link: ip65 blob link does not track its libs, and tracks ip65.cfg by mtime only #309

🤖 Generated with Claude Code

JC-000 and others added 3 commits October 15, 2026 09:48
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… wording (#305)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@JC-000
JC-000 merged commit 353f744 into master Oct 15, 2026
@JC-000
JC-000 deleted the fix/prg-depends-on-cfg branch October 15, 2026 19:14
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.

Editing a linker cfg does not relink the PRG

1 participant