Repository navigation
build: fix stale embedded.cc after mksnapshot relink - #67672
Open
ShenHongFei wants to merge 1 commit into
Open
ShenHongFei wants to merge 1 commit into
ShenHongFei wants to merge 1 commit into
Conversation
MSBuild evaluates CustomBuild items up-to-dateness before running any, without cascading: after a mksnapshot relink, embedded.S is regenerated but its conversion to embedded.cc is skipped, pairing a fresh snapshot.cc with a stale embedded.cc. Track mksnapshot.exe as an input and pass converter arguments explicitly. Signed-off-by: ShenHongFei <shen.hongfei@qq.com>
Collaborator
|
Review requested:
|
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.
Background. After updating my local node/V8 sources, my Windows build died in node_mksnapshot: exit code 0x80000003, no output at all. Simply running the build again succeeded, so it looked like a flaky crash.
Root cause. MSBuild's CustomBuild target evaluates the up-to-dateness of all items before running any of them, and the check does not cascade between items. On the first build after mksnapshot.exe is relinked, run_mksnapshot regenerates embedded.S, but asm_to_inline_asm still sees the old embedded.S matching the old embedded.cc and is skipped. v8_snapshot then compiles a fresh snapshot.cc against a stale embedded.cc; when V8 sources changed, node_mksnapshot dies on a silent release-mode CHECK (release V8 crashes via __debugbreak() without printing, hence 0x80000003 with no output). The next build regenerates embedded.cc and "self-heals". So every first build after a mksnapshot relink hits this window; it only crashes when the sources actually changed, which is what made it look flaky.
Fix. Add mksnapshot.exe to the inputs of asm_to_inline_asm so both actions are always considered out of date together, and pass the converter arguments explicitly instead of expanding <@(_inputs)>.
Verified on Windows x64: before the change, touching mksnapshot.exe and rebuilding skipped the conversion step (no "generating: embedded.cc" line in the build log); with the change, both generation steps run in the same build and the full vcbuild build succeeds.
I used an AI coding assistant to diagnose this and draft the change; I reviewed the diff and verified it myself with local builds.