fix(node:process): loadEnvFile path handling, error-event semantics, sourceMaps toggle#3684
Merged
Merged
Conversation
added 3 commits
May 31, 2026 13:01
proggeramlug
added a commit
that referenced
this pull request
May 31, 2026
…dicate tail (#3702) * fix(node): fill constants tail (constants/zlib Zstd) + util.types predicate tail #3683 node:constants — add POSIX file-flag (S_IF*, O_DIRECTORY/O_NOCTTY/ O_NONBLOCK/O_SYNC/O_DSYNC/O_SYMLINK), libuv (UV_DIRENT_*, UV_FS_SYMLINK_*, UV_FS_COPYFILE_*), and defaultCoreCipherList metadata to both the value-read dispatch (constants + fs.constants) and the enumerable-keys list. O_* use libc on Unix for host-accurate parity; S_IF* are POSIX-standard. #3677 node:zlib — Object.keys(zlib.constants) now enumerates the full 170-key Z_*/BROTLI_*/ZSTD_* set Node exposes (was 0). Added the missing Brotli decoder result/error codes and the ZSTD_error_* codes to the value-read dispatch so every enumerated key reads its backing value. #3678 node:util/types — add the predicate tail Perry can correctly back: isDataView, isFloat16Array, isWeakMap, isWeakSet, isExternal. Dropped isBigIntObject/isSymbolObject (Perry boxes only Number/String/Boolean), isArgumentsObject (no distinct arguments object), isModuleNamespaceObject, isKeyObject, isCryptoKey (no backing value type) — a false-always stub would lie about Node's positive cases. Also adds the missing manifest rows for process.sourceMapsEnabled / setSourceMapsEnabled (drift from #3684) so manifest-consistency stays green. * regen docs after merge (constants tail) --------- Co-authored-by: Ralph Küpper <ralph@skelpo.com>
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
Three node:process parity fixes, validated byte-for-byte against
node --experimental-strip-types.Closes #3045
Closes #3052
Closes #3108
Implementation
loadEnvFilepath handling was already implemented onmain: the dispatch passes the full JS value tojs_process_load_env_file, which defaults omitted/undefined/nullto.env, accepts string/Buffer/file:URL viadecode_path_value, and throws the exact NodeERR_INVALID_ARG_TYPEmessage for other types. This PR adds the gap-test coverage proving it byte-identical (string/Buffer/URL load, invalid types throw, default-.envENOENT), so the issue is verified closed; no runtime change was required.errorevent (crates/perry-runtime/src/os.rs):emit_process_eventnow routes the no-listenererrorcase throughthrow_unhandled_error_event. AnErrorinstance (or subclass, viajs_util_types_is_native_error) is rethrown as-is, preserving identity/code. Any other value (including a missing argument) throws a freshErrorwithcode: "ERR_UNHANDLED_ERROR"and messageUnhandled error. (<util.inspect(arg)>)— matching Node's'boom',42,null,true,undefinedformatting.AtomicBoolflag plusjs_process_source_maps_enabled(getter) andjs_process_set_source_maps_enabled(setter with boolean validation →ERR_INVALID_ARG_TYPE) incrates/perry-runtime/src/process.rs, each pinned with a#[used]keepalive anchor for the auto-optimize whole-program link. Wired through codegen: native-table sigs (node_core.rs), runtime decls (runtime_decls/strings.rs), and HIR lowering (expr_member.rsgetter arms → 0-argNativeMethodCall,expr_call/native_module.rssetter →NativeMethodCallforwarding the argument). The flag startsfalseand round-trips throughsetSourceMapsEnabled(true|false).No new HIR
Exprvariant.Validation
test-files/test_gap_process_misc_3045plus.tsis byte-identical to Node v25.8.0 under the default auto-optimize compile (exercises the new#[no_mangle]FFIs end-to-end; link succeeds → keepalive anchors confirmed). Guards green:./scripts/check_file_size.sh,cargo fmt --all -- --check,cargo test --release -p perry-runtime process,cargo test --release -p perry-hir(132 passing incl.expr_variant_stable_hash_tags_are_unique).