Repository navigation
fix(build): remove Windows VC redistributable prerequisite - #1094
paulcam206 wants to merge 7 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR embeds compiler-specific Windows runtime support and checks native binaries before staging, signing preparation, and packaging. Example: Windows 11 ARM64 running Node 24.22.1 without the desktop Visual C++ Redistributable.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR addresses a demonstrated Windows native-loading failure that current main still has, and review found no actionable patch defect. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe native build pipeline turns Rust sources into platform packages; Windows consumers load those bindings through fs-safe, while a separately built managed helper supports portable security operations. flowchart LR
A[Rust native sources] --> B[Cargo build and resolved flags]
B --> C[Windows PE admission]
C --> D[Signing and package collection]
E[Managed security helper] --> C
D --> F[Installed fs-safe packages]
F --> G[Native filesystem operations]
Technical reviewBest possible solution: Land the hybrid CRT build and shared binary admission after the draft hold and required checks clear, then deliver it through the normal signed release process. Do we have a high-confidence way to reproduce the issue? The contributor provides pinned old-release failures and candidate successes on clean x64 and ARM64 Windows guests, consistent with the reviewed build change; this read-only review did not execute a reproduction. Is this the best way to solve the issue? The hybrid linkage removes the demonstrated prerequisite while retaining OS UCRT and the existing descriptor bridge, and one shared validator enforces the policy at existing artifact boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2147295fc553. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 16, 2026, 10:04 PM ET / November 17, 2026, 03:04 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
What Problem This Solves
Windows applications using fs-safe's native filesystem APIs cannot load the binding when a desktop Visual C++ Redistributable is absent. This blocks native-required filesystem operations even on a supported Windows installation.
User Impact
User impact: x64 and ARM64 consumers can load the native binding without separately installing the desktop VC++ runtime, while UCRT remains OS-serviced.
The managed security helper remains .NET Framework 4.6.2, IL-only AnyCPU, and already has no desktop VC runtime requirement. Public APIs, defaults, filesystem confinement, ACL/private-admission, fallback and signing contracts are unchanged.
Adoption is required: this draft does not publish binaries or bump the current
0.28.1versions. A new signed/tagged fs-safe release with matching root/platform packages must be adopted by consumers. OpenClaw core needs the dependency/lockfile update, then Gateway needs an updated payload pin/build/release. Existing released payloads remain unchanged. This PR must remain Draft until separately authorized.Why This Change Was Made
Use the hybrid CRT approach from openclaw/proc-safe#40: embed compiler-specific support, retain the shared OS UCRT, and reject bad ordinary/delay imports before staging/signing preparation/packaging. Keeping UCRT shared preserves Node/Rust descriptor interoperability rather than recreating the separate-runtime problem addressed by openclaw/fs-safe#368.
Cargo selects the actual output artifact and resolves inherited/configured flags itself. The wrapper preserves the former
native/working directory, target-directory configuration, relative-path semantics, encoded/plain/explicit-empty flags and napi's build-environment fallback. A dependency-free, build-only Cargo probe avoids a TOML parser or compiler wrapper. Test/debug executables are not subject to shipping CRT policy.The helper's actual managed format is admitted separately; it is not forced into a native PE32+/architecture/UCRT-import rule. Certificate overlays are read without changing signed bytes. Existing unsigned-helper parity, signer/timestamp and packed-signed-hash checks stay in place.
Evidence
Clean x64 and ARM64 Windows guests without a desktop VC++ runtime loaded the candidate, executed real native-required filesystem workers and preserved private-file rejection behavior; both old releases still failed before and afterward. The same candidate passed in the real Gateway's staged package layout. Full local-suite host limitations and draft-skipped security gates remain explicit below.
Evidence revision: head
d22615bf91b13b776426d405b3cb32927fddfb6e, current review/target base2147295fc553399964c151668a05c9edbce5aa7b, tree4e4f89bf5bc2102622b928039457773b583fec15. Original qualification base iseac3b6682890cfaf78c9928a3f2bdff21c1f038c. The actual PR-template-only advance onmainwas merged because the repository requires strict up-to-date status checks; this is ordinary target integration, not a rebase or another binary build.Qualification checkpoint: the builds, clean guests, Gateway/package scenarios and full local check below were executed at
d9479212bf6b8b1f05f61838f6c08ff8411df790(tree9b5ce3caeadd7b3b43edd871319fd34570fc8276). The only subsequent changes are +5/-2 lines intest/build-native.integration.test.tsand upstream's PR template; every production/build/runtime/helper source and all ten qualified binary copies remain unchanged. No later-head runtime rebuild or guest rerun is claimed.Introduced CI issue fixed: the Windows ARM64 host / x64 Node job found that the new isolated Cargo configuration fixture selected its target from Node's emulated architecture, causing
E0463: can't find crate for coreforx86_64-pc-windows-msvc. The fixture now queriesrustc -vVin its isolated cwd/environment and uses the installed compiler's host, because this test checks configuration discovery, not the Node addon ABI. No target installation, assertion relaxation, timeout change or CI skip was added. All 84 focused cases passed ona629375e; the integration merge changes only upstream's template and its complete current-head local review is clean. Current-head CI and hosted-review state must be read from GitHub rather than inferred from the previous head.Current-head external CI retry gate: the
d22615bfLinux ARM64 native lane failed two existing JavaScript native-off cases at their unchanged 5,000 ms deadlines:root-parent-symlink-policy/ "creates missing parents through a contained alias while keeping mutation defaults separate from reads", androot-shared-js-mutation-policy/ "does not treat an exact denied future descendant as a protected ancestor". All Rust tests and preceding native groups passed. The same lane passed on immediately precedinga629375e; the only intervening file change is upstream's PR template, so production code and these tests are identical. That comparison supports a timing hypothesis; it does not make the current failed run green. One documented same-job rerun request was refused while the parent run was active (job 133775881346 cannot be rerun). The author has read-only upstream permissions and no authorized maintainer rerun route is available here: this needs a maintainer same-head retry after the parent run is terminal. No token/account change, alternate retry route, dummy commit, timeout increase, weakened assertion or skip was used.The qualification checkpoint's final default x64 and ARM64 builds are byte-identical to the guest-exercised artifacts below. Native/runtime/managed implementation sources did not change; the Cargo compatibility fixes were exercised separately with real Cargo, then both default artifacts rebuilt and hash-compared. The current test-only fix does not change those sources or binaries. No proof is attributed to a different binary just because it has the same package version.
Local check limitation: the qualification checkpoint's full
pnpm checkis not green on the shared Windows host: 16,435 passed, 9 failed, 3,348 skipped, plus one failing suite. Five ACL/privilege failures and the case-sensitive fixture suite reproduce on unchanged main with the actual published signed native/helper binaries. Root.copyIn's 30-second failure and the existing five-second Git fixture timeout also reproduce there. The final sweep's corpus/mkdir timeouts pass focused, original-budget runs on both baseline and candidate. No assertions, timeout budgets or security checks were weakened.Normal build/package/docs/security and expected-head-pinned npm/pnpm consumers pass at the qualification checkpoint. The full local ClawSweeper review of
2147295f..d22615bfcompleted with verified checkout access, patch correct, no review comments, security cleared; overall 4/6, proof 5/6. The earlier hosted review ofd9479212scored overall/proof 4/4 with no findings, but that is historical evidence, not a hosted rating for the new head or a CI pass.Draft-triggered CI results are those attached to this current head in GitHub. CodeQL's existing workflow explicitly skips draft PR analysis; a skipped draft gate is not claimed passing and Draft will not be toggled to activate it.
Terminal CI at
d22615bf: main CI is complete and failed solely on the Linux ARM64 timing gate above; it needs a maintainer rerun, not a product approval or a claimed local engineering fix. The original ARM64-host / x64-Node lane now passes, as does native ARM64 Node. The other attached product checks passed, including Node 22/24/26 OS checks, package builds/consumer smoke, Windows helper byte parity, ReFS, FreeBSD and coverage. CodeQL's requiredAnalyze actionsandAnalyze javascript-typescriptremain unrun behind the intentional Draft gate. Method-audit and split-credential proof jobs are separate manual-only lanes, not Draft failures or passing results. The one refused rerun attempt and absence of an authorized maintainer route remain the retry ceiling; no additional attempt or account change was made.CHANGELOG.mdupdated when release-relevantReal Behavior Proof
Claim: the candidate removes the separate desktop VC runtime prerequisite for the two shipped native architectures while retaining OS UCRT, real native execution, private-admission behavior, managed-helper compatibility and signing custody.
These are summaries/excerpts of executed synthetic tests, not a proposed test plan. Endpoints, lease/VM identities, machine-specific paths, unrelated logs and raw private archives are intentionally not posted.
Input provenance and complete shipped-Windows PE inventory
All six published root/x64/ARM64 tarballs for 0.26.5 and 0.28.1 were integrity-checked and inspected for actual architecture/kind and ordinary and delay imports. Their SLSA statements were cryptographically verified with
sigstore@5.0.1, explicit issuerhttps://token.actions.githubusercontent.com, release-workflow identity, transparency evidence and SHA-512 subjects matched to the saved tarballs:openclaw/fs-safe,refs/tags/v0.26.5,88f8255eb3970c091aaa69c31f274653f3fb54e4openclaw/fs-safe,refs/tags/v0.28.1,eac3b6682890cfaf78c9928a3f2bdff21c1f038cThe public registry supplies each bundle at
https://registry.npmjs.org/-/npm/v1/attestations/@openclaw%2f<package>@<version>. Registry package signatures and npm publish attestations are recorded as metadata-only, distinct from the cryptographically verified SLSA bundles.VCRUNTIME140.dll/ noneVCRUNTIME140.dll/ noneVCRUNTIME140.dll/ noneVCRUNTIME140.dll/ none.dll/.node.dll/.nodeNo additional shipped Windows PE needs a separate fix or CRT allowlist exception. The dependency audit is the recorded resolution of runtime ranges, not every possible historical/future version. Non-Windows optional siblings and development dependencies are not Windows consumer payloads.
The helper targets
.NETFramework,Version=v4.6.2, remains AnyCPU withPrefer32Bit=false, importsmscoree.dll, and uses onlykernel32.dll,advapi32.dllandntdll.dllthrough P/Invoke. No framework/AOT/signing conversion was made.Exact binary and private package pins
ac134c9b6634ca14044436d4136f20a030b3bc7ee85c3738fd0fbe76fc8a7f8778377ba184767159f68a3142766b41a39cd68fb9c7be511e531ba218adb60e01ac615d318e8dea28108393df10c248709adf3542040704bb30d0d3d88b1874c4cc3e1595459ecac0c7486ba6a22ef1a547162d0089f4d5592afe0dfc22900e1ba37f99efe9859abbd42e2d6ef8d6a7b4b46257e59ad344ca03d7eeef59a4a76f7b12d031363f1c7e647021bf55a6936e33c9477d362fa3b841092c03c69faf12b84c1af2156532b4d9ead4b2d312fef15d73e0751fc28df222e6628e10b091b5a0c08aa73620ef14cb156806fde61913a867dc110c907f36bba4f402c5326cd3af1c1729f5e1ead54ac77278b0c5c99405d243624c895fc07799392f091e1befPrivate package tarball SHA-256s:
a48b9a51b6dd0f258e3bdf0f1c25195fa3b2ca5b2a8522574e469d58a2def2804029511c6b14a00686dfc6e887622ce6d11c4793b3a584390a9160b0e05b2f0f2e8720f2fe95672ab3326660a1e40dc84c6a7e30e0abb37ae2ec1d4c5b7e1581These are unsigned private candidates at the unchanged development version, not registry releases. CI may use a different toolchain; CI output is not claimed byte-identical to these local artifacts.
Executed clean-runtime scenarios and observed output
Surface: direct
.nodeloading, actual fs-safegetNativeBinding, its real isolated native batch worker, managed helper process, native directory/security/file APIs and Node-owned descriptors.Fixture/commands: fresh owned clean Windows guests, normal complete root/platform package directories, synthetic owned files only. x64 additionally uses normal npm/pnpm installations. For each architecture:
Path arguments are redacted owned fixture paths. Both cells use native-architecture Node 24.22.1. ARM64 has zero network adapters and uses the official portable
node-v24.22.1-win-arm64.zip, SHA-256a0c807319fede24c4a0d8f84564c82a619bd313b16b10c007c383c2609e99171, matched to the official release SHASUMS. Its executednode.exehash is8bea91dc437fe01e7d92ef0efc6c9eaf654369aaba9b2d3e9841552ea7b95a00. No npm/network/runtime installation happens in that guest; archive/jszip features are outside that cell.The actual checks include:
These are excerpts of the executed harness operations. Required-parent loading is checked before dispatcher preflight mode changes. The worker's actual executable, worker SHA and
FS_SAFE_OWNER_DACL_BATCH_MODE=requireare captured and asserted. A failed control cannot count as success via fallback.Observed output, both clean architectures:
ERR_DLOPEN_FAILEDhelper-unavailablehelper-unavailableERR_DLOPEN_FAILEDhelper-unavailablehelper-unavailableERR_DLOPEN_FAILEDhelper-unavailablehelper-unavailableERR_DLOPEN_FAILEDhelper-unavailablehelper-unavailableCandidate receipt fields include:
{ "directLoaded": true, "parentRequired": true, "emptyWorker": true, "actualWorker": { "pinnedNode": true, "workerSha256": "a767ae4d201611eed68f6d7427f16be34f565e79c1b904c004802a1fc8ed6f72", "mode": "require" }, "nonemptyWorker": true, "privateAdmissionPositive": true, "worldWritableRejected": true, "loadedExactBinary": true, "helperPathQuery": true, "helperInvalidExit": 1 }ARM64 also reports
"sharedUcrtDescriptorInterop": trueafter Rust hashes bytes read from a Node-created descriptor and matches the independent digest.Cleanliness evidence before and after: desktop VC Runtimes registry keys absent;
vcruntime140,vcruntime140_1,msvcp140,msvcp140_1andconcrt140absent in System32/SysWOW64; native-architecture and x86 system loader probes return 126. ARM64 additionally checksvcomp140and SysArm32. Inbox UCRT exists. Isolated Appx VCLibs are listed separately and are not called the desktop redist. Both old controls still fail after new load/operations.An independent physical ARM64 device with its pre-existing VC++ 14.50 and native Node 26.13.0 also loads old/new/old and passes real descriptor SHA-256/security inspection. That is explicitly with-runtime hardware evidence, not the clean-runtime result.
Executed signed Gateway integration
The real signed
OpenClaw.Gateway_2026.11.100.0_x64__kaa03rpbbqef6MSIX, SHA-25646c93cc02c4332740f44c3bba53df6c32e00d8fe6eae439b3f22cffa4cb914fa, was installed only in the disposable x64 guest, thenclawctl setup --jsoncreated a separate disposable agent.The agent used the existing pinned Node/preload launch and ordinary whole-package staged layout. Only that agent's staged JS/native pair was privately overridden and then exactly restored; immutable MSIX bytes and existing guards were not edited.
{ "immutableGatewayVersion": "2026.11.1", "immutableFsSafeVersion": "0.26.5", "immutableGatewayManifestSha256": "4961cae1aae6c412895266cec035a69dbb5cd1d4e5647635265af9e34e4fe0dc", "immutableEntrySha256": "469e60c9f60b615ff71c985a54238ee532a8f949866d76aebe7d6e4bc7219902", "immutableAddonSha256": "ac134c9b6634ca14044436d4136f20a030b3bc7ee85c3738fd0fbe76fc8a7f87", "stagedCandidateRootAndNativeVersion": "0.28.1 private candidate", "stagedCandidateAddonSha256": "b84c1af2156532b4d9ead4b2d312fef15d73e0751fc28df222e6628e10b091b5", "requiredParentAndActualWorker": ["old:false/false", "candidate:true/true", "restored-old:false/false"], "actualWorkerUnderStagedRoot": true, "actualWorkerNodeOptionsPresent": false, "actualWorkerImportArgumentPresent": false, "candidateFunctionalPrivateCreation": true, "loadedExactStagedBinary": true, "allFiveStepsImmutableHashesEqual": true, "restoredOriginalPairAndRemovedBackup": true, "teardownExit": 0, "remainingPackageAgentProfileTaskCounts": [0, 0, 0, 0] }This qualifies the addon/whole pair in the shipped layout, not a released update or repair path. No Doctor, database/migration/recovery operation or reporter-machine access occurred. It does not explain a different reporter's parent/worker split or promise upgrade/data-recovery safety.
Validation commands and limits
All commands below were executed; private output/fixture path arguments are represented by placeholders rather than uploaded.
pnpm native:buildnode scripts/build-native.mjs --release --target aarch64-pc-windows-msvc --output-dir ../artifacts/final-cwdpnpm test test/build-native.integration.test.ts test/build-native.test.ts test/windows-runtime.test.ts test/windows-signing.test.ts test/package-collection-reuse.test.ts --testNamePattern "^(?!.*keeps actual Git source identity)"a629375e; one platform skip and the separately reproduced unchanged-main Git timeout selected outCARGO_BUILD_TARGET_DIR,.cargo/config.tomltarget-dir and native-relative target-dirpnpm test:security$env:FS_SAFE_NATIVE_MODE='require'; pnpm test test/permissions-native-acl.test.ts test/permissions-windows-native.test.ts test/secure-file-windows-native.test.ts test/native-integration.test.tspnpm build, allocator prerequisite,pnpm docs:checkpnpm pack:checkpnpm package:smoke --pack-only --output <owned-output>then--packed-input <same-output> --output <owned-consumer-output>withFS_SAFE_EXPECTED_SOURCE_COMMITset to qualification headd9479212check-windows-native-imports.ps1 -Architecture x64with that pinned consumer receipt/imports:ntdll.dllon the exact candidateNtCreateFile,NtSetInformationFile,NtReadFile,NtQueryInformationFile,RtlNtStatusToDosErrorretainedpnpm checkon qualification headd9479212, owned NTFS temp stategit diff --checkandgit -c core.whitespace= diff --check <base>..HEAD2147295f..d22615bfThe persistent full-suite failures are missing
SeSecurityPrivilege, ACL restore/setowner access errors, and a case-sensitive directory fixtureEEXIST. All reproduce on unchangedeac3b668source with actual published signed 0.28.1 binaries; the baseline addon was directly loaded and hash-checked. Root.copyIn's 30-second and the Git fixture's five-second failures also reproduce on that baseline. Corpus 90-second and mkdir five-second full-sweep timeouts pass focused runs on both baseline and candidate at the original bounds. An earlier installed-consumer timeout reproduced on baseline; a watch-worker timeout passed isolated baseline/candidate reruns. These remain documented host/full-sweep limits, not all-green claims. No timeout/assertion was edited to get green.The shared
autoreviewskill was unavailable locally. The required complete local ClawSweeper review ran instead of a P0-only substitute; three actionable build compatibility findings were fixed and re-reviewed. No incomplete-auth review was counted as clean.Signing, reproducibility and cleanup
af1c1729f5e1ead54ac77278b0c5c99405d243624c895fc07799392f091e1bef. This is a content comparison, not a replacement signature check.Private raw archives, endpoints and machine-specific native paths are intentionally not attached. The source/binary/package pins and executed output above are the public, inspectable proof package for this head. Official signed release artifacts, the full non-Windows runtime matrix and a shipping Gateway update remain outside this draft's claims.