fix(node): propagate fs path mutator errors#3490
Merged
proggeramlug merged 4 commits intoMay 31, 2026
Merged
Conversation
This was referenced May 31, 2026
# Conflicts: # crates/perry-runtime/src/fs/callbacks.rs # crates/perry-runtime/src/fs/mod.rs # crates/perry-runtime/src/node_submodules/diagnostics.rs # crates/perry-runtime/src/node_submodules/fs_promises.rs # crates/perry-runtime/src/object/field_get_set.rs # docs/runtime-parity-gaps.md
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.
Linked issues
Closes #2733
Closes #2735
Closes #2737
Closes #2738
Closes #2740
Summary
This PR fixes a focused
node:fserror-propagation cluster for deterministic path and path-pair filesystem failures:readlinknow throws/callbacks/rejects real fs errors instead of returning an empty target.rename,copyFile,link, andsymlinknow preserve Node-styleErrorfields across sync, callback, andnode:fs/promisessurfaces.err.destalongsideerr.code,err.syscall, anderr.path.Why these were batched
These issues share the same runtime path: sentinel-returning fs mutators, callback wrappers that previously reported success after failed syscalls, and
fs/promisesthunks that need to reject with the same error objects. Batching them keeps the side-table/error-object changes and parity fixture in one coherent fs PR.Tests added
test-parity/node-suite/fs/path-mutator-errors.ts, covering sync, callback, andnode:fs/promisesbehavior for missing paths, invalid readlink targets, missing destination parents,COPYFILE_EXCL, existing symlink destinations, and success sanity checks.Verification
TMPDIR="$PWD/target/tmp" PATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH ./run_parity_tests.sh --suite node-suite --module fs --filter path-mutator-errors- passTMPDIR="$PWD/target/tmp" PATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH ./run_parity_tests.sh --suite node-suite --module fs- 126 pass, 0 failTMPDIR="$PWD/target/tmp" PATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH ./run_parity_tests.sh --suite node-suite --module fs-promises- 62 pass, 0 failTMPDIR="$PWD/target/tmp" CARGO_BUILD_JOBS=1 RUSTC_WRAPPER= cargo check -p perry-runtime -p perry-codegen -p perry-api-manifest- pass with existing warningsTMPDIR="$PWD/target/tmp" CARGO_BUILD_JOBS=1 RUSTC_WRAPPER= cargo test -p perry-runtime fs::- 2 pass, 0 failcargo fmt --all -- --check- passgit diff --check HEAD- pass./scripts/check_file_size.sh- passKnown limitations
Errorfields, not full platform-specific message text or numericerrnovalues.Non-goals
fs.watch, FileHandle semantics, stream behavior, or callback scheduling semantics.