Skip to content

feat(process): implement process.config (#1379) - #1484

Merged
proggeramlug merged 1 commit into
mainfrom
fix/1379-process-config
May 23, 2026
Merged

feat(process): implement process.config (#1379)#1484
proggeramlug merged 1 commit into
mainfrom
fix/1379-process-config

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Summary

Node's process.config is the build-time config object — { variables, target_defaults } populated by node-gyp at build time. Perry was returning a 0 sentinel, so process.config.variables threw on undefined and Object.keys(process.config) crashed.

Perry has no gyp file to surface, so the sub-objects are empty — the shape preserves consumer feature-detection paths (process.config?.variables?.target_arch, etc.).

Closes #1379.

Changes

expr_member.rs: both bare process.config and the globalThis.process.config paths lower to an inline Expr::Object literal sitting next to the release / features arms shipped in #1348 / #1378.

Test fixture is force-added to skirt the root .gitignore's top-level config rule (which targets binary outputs); the parity path is fixed by the issue's repro.

Test plan

  • test-parity/node-suite/process/config/config.ts asserts shape (typeof top-level + sub-objects) — byte-identical to node --experimental-strip-types.
  • cargo fmt --all -- --check clean.

@proggeramlug
proggeramlug force-pushed the fix/1379-process-config branch from a3433d8 to fdb1ce4 Compare May 23, 2026 08:43
Node's `process.config` is the build-time config object —
`{ variables, target_defaults }` populated by node-gyp at build
time. Perry was returning a 0 sentinel, so `process.config.variables`
threw on undefined and `Object.keys(process.config)` crashed.

Perry has no gyp file to surface, so the sub-objects are empty. The
shape preserves consumer feature-detection paths
(`process.config?.variables?.target_arch`, etc.).

Lowered in `expr_member.rs` (both bare `process.config` and the
`globalThis.process.config` paths) to an inline `Expr::Object` literal
sitting next to the `release` / `features` arms.

Test fixture force-added (root `.gitignore` shadows the directory
name `config` for top-level binary outputs; the parity test path is
fixed by the issue's repro).
@proggeramlug
proggeramlug force-pushed the fix/1379-process-config branch from fdb1ce4 to 8ef94bd Compare May 23, 2026 08:55
@proggeramlug
proggeramlug merged commit 25244e2 into main May 23, 2026
16 of 17 checks passed
@proggeramlug
proggeramlug deleted the fix/1379-process-config branch May 23, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

node:process — implement process.config

1 participant