fix(process): share Node dotenv parsing for loadEnvFile#3437
Merged
proggeramlug merged 8 commits intoMay 31, 2026
Merged
Conversation
This was referenced May 30, 2026
Contributor
Author
|
Refreshed this branch for the latest mainline changes.
|
added 5 commits
May 31, 2026 10:57
# Conflicts: # crates/perry-hir/src/stable_hash/expr.rs # crates/perry-runtime/src/process.rs # crates/perry-runtime/src/util_parse_env.rs
# Conflicts: # crates/perry-codegen/src/lower_call/native_table/node_core.rs # crates/perry-hir/src/lower/expr_call/native_module.rs # crates/perry-runtime/src/process.rs # test-parity/node-suite/process/methods/load-env-file.ts
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
util.parseEnvwithprocess.loadEnvFileexportprefixes, inline#comments, multiline quoted/backtick values, duplicate keys, and unterminated quotesprocess.loadEnvFilepath handling for omitted/undefined/null defaults, strings, Buffers, file URLs, non-file URL errors, and invalid path argument errorsutil.parseEnvandprocess.loadEnvFileBatching rationale
These issues share the same behavioral surface:
process.loadEnvFileshould parse.envcontents using the same Node dotenv rules exposed byutil.parseEnv, and path validation needed to pass the raw JS value through lowering/codegen to runtime. Keeping them together avoids landing parser behavior that the process loader cannot yet use.Tests
RUSTC_WRAPPER= cargo test -p perry-runtime util_parse_envRUSTC_WRAPPER= cargo check -p perry-runtime -p perry-hir -p perry-codegen -p perrycargo fmt --all -- --checkgit diff --check./scripts/check_file_size.shjq empty test-parity/known_failures.jsonPATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH ./run_parity_tests.sh --suite node-suite --module util --filter parse-envPATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH ./run_parity_tests.sh --suite node-suite --module process/methods --filter load-env-filePATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH ./run_parity_tests.sh --suite node-suite --module process/methodsPATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH ./run_parity_tests.sh --suite node-suite --module util(68 pass, 1 unrelated existingnode-suite/util/get-system-erroroutput mismatch)Non-goals
dotenvpackage behavior ordotenv/configwrapper changesprocess.envstorage semantics beyond loaded valuesCloses #3423. Closes #2985. Closes #3045.