build: harden runtime deps fingerprint on Windows#77757
Closed
Bortlesboat wants to merge 1 commit intoopenclaw:mainfrom
Closed
build: harden runtime deps fingerprint on Windows#77757Bortlesboat wants to merge 1 commit intoopenclaw:mainfrom
Bortlesboat wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Contributor
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: build: harden runtime deps fingerprint on Windows This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
Contributor
Author
|
Closing this one because current main deleted both touched files in the runtime-deps staging path, so this old branch is obsolete before review and cannot be rebased cleanly. I'll use a fresh current-main branch for any replacement. |
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.
Summary
Dirent.isSymbolicLink()before checking the actual filesystem entry.readlinkSync()to throw while staging bundled plugin runtime deps.lstatSync()before symlink/file/directory handling and use that stat for file size fingerprinting.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
fs.readdirSync(..., { withFileTypes: true })Dirent classification as the source of truth, then calledreadlinkSync()for entries reported as symbolic links.lstat()reports a regular file.Regression Test Plan (if applicable)
test/scripts/stage-bundled-plugin-runtime-deps.test.tspackage.jsonas a symlink butlstat()reports it as a normal file, so staging should not callreadlinkSync()for that path.User-visible / Behavior Changes
None.
Diagram (if applicable)
N/A
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation: N/ARepro + Verification
Environment
Steps
Expected
Actual
git diff --check origin/main...HEADpassed.fs.symlinkSync(...)returnsEPERM: operation not permittedbefore assertions run.Evidence
Human Verification (required)
pnpm exec vitest run --config test/vitest/vitest.tooling.config.ts test/scripts/stage-bundled-plugin-runtime-deps.test.ts -t "ignores dirent symlink false positives";git diff --check origin/main...HEAD.readlinkSync()is not called for the false-positive package file, and staging still copies the runtime dependency file.EPERMin this shell.Review Conversations
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoRisks and Mitigations
None.