Repository navigation
Build: an assembled object keys on every file its source .incbin's; embedded-objects objects declare their blobs (#1423, #1435) - #1509
Merged
Conversation
…he embedded-objects objects declare their blobs (#1423, #1435) An EmbedObjectFiles target's assembly names each blob by `.incbin "<path>"`, so a blob whose bytes change (a .wo bundle rebuilt for a new ABI, a runtime object) leaves the assembly text identical. Early cutoff (D50) then kept the CompileAsmObject that assembles it fresh: its only declared input was the .s. stage2 linked out/stage/lib/embedded_objects.o with the previous bundles ("embedded bundle 'tommyds' was built for ABI 787e9ad4... but this compiler is b735dbd0..."), and every battery since has deleted the object by hand. Two halves, because build.w runs on the pinned seed: - build.w: embedded_objects_object() builds each embedded-objects object (bootstrap, stage, release, cross linux x86_64/aarch64, cross windows x86_64/aarch64) from its embed target and declares every blob as an input. Under the current seed, `build --explain bootstrap-embedded-objects-object` goes from `fresh` to `stale: input changed: out/bootstrap-lib/empty_rt_linux_x86_64.bin` when that blob's bytes change. - runner: a CompileAsmObject records the files its source pulls in by `.incbin`/`.include` as discovered dependencies (build_graph_discovered_inputs), so any user's assembled object keys on them too, declared or not. test/behavior/behav_build_asm_incbin_inputs.w: an embed target + object and a hand-written .s with a relative .incbin. With the pinned seed as the driver the embedded blob's change is cut off and the object keeps the old bytes (assertion at line 50); with the tree's runner both objects are reassembled, and neither runs when nothing changed.
Contributor
Author
|
Stack #1516 battery (seed-driven, new seed, cold c_import cache, with :drop-audit/:move-audit) on main + #1509 → … → #1515 (head 63e8340): build ok, :fixpoint ok (stage2 == stage3 with DWARF variables), :drop-audit ok, :move-audit ok, :test ok (no reds), :test-green ok, :last-green ok. Merge the stack: |
ehartford
marked this pull request as ready for review
September 23, 2026 16:30
This was referenced Sep 23, 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.
Closes #1423. Closes #1435.
Root cause. An
EmbedObjectFilestarget's assembly names each blob by.incbin "<path>", so a blob whose bytes change (a.wobundle rebuilt for a new ABI, a runtime object) leaves the.sidentical. Early cutoff (D50) then keeps theCompileAsmObjectthat assembles it fresh — its only declared input was the.s— and stage2 linksout/stage/lib/embedded_objects.owith the previous bundles ("embedded bundle 'tommyds' was built for ABI 787e9ad4… but this compiler is b735dbd0…").Fix. Two halves, because build.w runs on the pinned seed:
build.w:embedded_objects_object()builds every embedded-objects object (bootstrap, stage, release, cross linux x86_64/aarch64, cross windows x86_64/aarch64) from its embed target and declares every blob as an input. Effective with the current seed.CompileAsmObjectrecords the files its source pulls in by.incbin/.includeas discovered dependencies (build_graph_discovered_inputs), so any assembled object keys on them, declared or not.Evidence.
BLOB-ONE→BLOB-TWO,[cutoff] 'emb-asm' re-ran to identical outputs, object still containsBLOB-ONE. With the tree's runner: the object is reassembled and containsBLOB-TWO.build --explain bootstrap-embedded-objects-objectgoes fromfreshtostale: input changed: out/bootstrap-lib/empty_rt_linux_x86_64.binwhen that blob changes.build --graphfor:cross-rt,:cross-rt-windows,:cross-rt-windows-aarch64: each cross object keeps itstriple=arg and lists its 22 blobs.Test.
test/behavior/behav_build_asm_incbin_inputs.w: an embed target + object and a hand-written.swith a relative.incbin. Fails with the seed as the p7 compiler (line 50, the object is not reassembled); passes with the tree's stage2; neither object runs when nothing changed.