Repository navigation
make: track ip65 blob's libs and cfg content (#309) - #317
Merged
Merged
Conversation
The ip65 blob rule listed only ip65_stub.s and ip65.cfg, though ld65 also links ip65_tcp.lib and ip65_c64.lib. Both libs are now prerequisites (a missing one fails in make, naming it and 'make ip65-libs'), and stub, cfg, both libs and the toolchain id are content-stamped in ip65-build/ip65-c64.stamp at parse time (#305 shape; -n/-q/-t compare only; clean/ip65-libs skip). A stale stamp deletes the blob, its object and (for real goals) the link outputs. make ip65-blob does not force: docs corrected. Tests in test_build_flags_stamp.py, each mutation-checked. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- named-failure lib rule runs under -t (+ prefix): no empty lib files - blob's own sha256 stamped; a same-second byte flip deletes ip65_blob.o and link outputs - dry-run warning mirrors the real branch (names the object, no PRG for maintenance goals); LD65_LIB/LD65_OBJ/CC65_HOME in the digest - Farm tests get a private ip65-build (a symlink let them delete the real blob) - build_prgs.sh bootstraps ip65-libs when the libs are missing - tests for every previously unkilled mutant Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… env (#309 round 2) - the blob rule writes ip65-c64-bin.stamp after ld65, so the FIRST same-second flip after a build reaches the PRG; the block-1 deletion of that stamp is gone - LD65_ENV digest reads the make variables LD65_LIB/LD65_OBJ/CC65_HOME so a command-line value is seen on make 3.81 - tests: first flip without warm-up, no-blob/blob-no-stamps checkouts, one invalidation per input change, absent bin stamp is recorded, bin-stamp -n text - CLAUDE.md sentence corrected Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
flip -> delete the blob -> rebuild left ip65_blob.o and the PRG from the flipped blob permanent when they were not older than the regenerated blob (same second on make 3.81). The blob-bytes block now deletes the object and (for real goals) the link outputs whenever the blob is absent at parse time. Test: test_ip65_deleted_blob_after_a_flip_recovers_the_prg. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… absent (#309 round 4) - bytes block ends with `[ -f ip65_blob.o ] || rm -f $(IP65_RM_LINK)`: after `make ip65-blob` (maintenance, keeps the PRG per #220, deletes the object) the PRG can no longer outlive its object. - a 0-byte blob (`make -t` creates one) is deleted at parse, so the next real build recovers instead of dying on the size assert. - block comment corrected (absent blob no longer "record only"). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Closes #309
What
The ip65 blob rule listed only
ip65_stub.sandip65.cfg; ld65 also linksip65_tcp.libandip65_c64.lib. Now:make ip65-libs. The recipe is+-prefixed somake -talso fails by name instead of creating empty lib files.ip65-build/ip65-c64.stamp(gitignored), Editing a linker cfg does not relink the PRG #305 shape: sha256 of stub, cfg, both libs, TOOLCHAIN_ID and LD65_LIB/LD65_OBJ/CC65_HOME, compared at parse time. A change deletes the blob,build/net/ip65/ip65_blob.oand, for non-maintenance goals, the link outputs.ip65-build/ip65-c64-bin.stamp: the blob's own sha256. blob -> ip65_blob.o was an mtime-only edge, so a same-second byte flip (the documented provenance test) left a stale PRG, on master too. A change now deletes the object and link outputs. Absent blob/stamp = record only, so the rebuild after a lib change does not invalidate twice.BACKEND=ip65only;clean/ip65-libsskip it (build/flags.stamp invalidation is target-independent: a maintenance target that builds no PRG deletes every object and the PRG, and leaves a stale .map behind #220);-n/-q/-tcompare and warn, write nothing (make -ndeletes all objects and the PRG: the flag-stamp compare runs at parse time #174). The-nmessage mirrors the real branch (names the object; lists the PRG only for real goals). A maintenance-only goal (make ip65-blobover a UCI tree) deletes just the blob and its object.Decisions
make ip65-blobdoes not force: docs fixed (CLAUDE.md, README, engineering-notes), not behaviour.Inline fixes (this PR)
make ip65-blobforces a rebuild (3 places); missing-libs failure text updated.make -ton a lib-less tree created 0-byte libs (regression from my first cut): fixed with+.Farmsymlinked the realip65-build/, somake BACKEND=ip65 ...in any Farm test deleted the developer's real blob (reproduced on a pre-make: track ip65 blob's libs and cfg content (#309) #317 tree). Farm now copies it; a last-running guard test asserts the checkout'sip65-build/is untouched by the suite.tools/package/build_prgs.sh: also bootstrapsip65-libswhen libs are missing (not just the blob); header comment corrected..gitignore:ip65-build/*.stamp.Tests (tools/test_build_flags_stamp.py: 34/34 on make 3.81 and gmake 4.4.1)
RED on master's Makefile (first round): tracks / dry-run / missing-lib tests. New this round, each with the Makefile mutant that turns it red:
+prefix removedHash gate (clean builds, identical to master 569274c)
ip65 3fccbeb1, ip65-onchip e69bfce7, uci fe3b6c20, uci-onchip 9e11f570, uci-comb ad85797b, uci-onchip-store 1e824348, uci-comb-store fee4d5b1, PQ onchip 354f70d0, PQ comb b8677dd7, PQ onchip+store 3b4dd718, PQ comb+store 41202de9, uci-m3 c64267c4 (also identical on master's Makefile). Blob stays
cf1a5ff7809af4e4655e385b378b936054f41046ff2b7604828af3240c2d90dd.make packageran: e69bfce7 / 3b4dd718 / 41202de9. Bare pytest 525 passed; test_runner_coverage passed. The other profiles the adversary hashed (wiki, demo-store) I did not reproduce.Round 2 (fixes after adversary)
ip65-c64-bin.stampright after ld65; block 1 no longer deletes it.test_ip65_cases_do_not_depend_on_checkout_stateruns the first-flip and skip-goal cases from "no blob, no stamps" and "blob, no stamps" trees; the byte-flip test has no warm-up parse and starts from "no blob, no stamps". Red on the round-1 Makefile (2eb7a0b): cases_do_not_depend_on_checkout_state, skip_goals; green now.-ntext -> dry_run_message; "absent stamp = invalidate" -> parse_after_a_build_invalidates_nothing; command-lineLD65_LIB=unseen (shell-env form) -> toolchain_change_relinks. "Block 1 keeps the bin stamp" is now moot: the deletion was removed (a rebuilt blob rewrites the stamp, and block 2 skips while the blob is absent).make LD65_LIB=...is seen on 3.81; unset = empty = stable.cf1a5ff7...,make packagee69bfce7 / 3b4dd718 / 41202de9.Round 3
ip65_blob.o(and, for real goals, the link outputs) whenever the blob is absent at parse time; it sits inside the existing -n/-q/-t and STAMP_SKIP gating. Testtest_ip65_deleted_blob_after_a_flip_recovers_the_prg(object and PRG mtimes pushed into the future): red on f79dc28, red with the new branch mutated totrue, green after.cf1a5ff7...identical to master 569274c;make packagee69bfce7 / 3b4dd718 / 41202de9.Round 4
make ip65-blob(keeps the PRG per build/flags.stamp invalidation is target-independent: a maintenance target that builds no PRG deletes every object and the PRG, and leaves a stale .map behind #220, deletes the object) could leave the flipped PRG permanent. The bytes block now ends with[ -f ip65_blob.o ] || rm -f $(IP65_RM_LINK)(empty for maintenance goals). Testtest_ip65_maintenance_rebuild_after_a_flip_recovers_the_prg.make -twith the blob absent created a 0-byte blob (master too) that failed the size assert forever. A 0-byte blob is now deleted at parse (real builds only). Testtest_ip65_dry_run_t_blob_is_recovered_by_the_next_build.make packagee69bfce7 / 3b4dd718 / 41202de9.🤖 Generated with Claude Code