Skip to content

fix(buffer): expose namespace constructors and backing properties - #3409

Merged
proggeramlug merged 4 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-buffer-namespace-backing
May 30, 2026
Merged

fix(buffer): expose namespace constructors and backing properties#3409
proggeramlug merged 4 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-buffer-namespace-backing

Conversation

@andrewtdiz

@andrewtdiz andrewtdiz commented May 30, 2026

Copy link
Copy Markdown
Contributor

Closes #3387.
Closes #3385.
Closes #3386.

Summary:

  • Export Blob from node:buffer and preserve namespace/global Blob and File constructor aliases through native constructor lowering.
  • Register direct new buffer.Blob(...) / new buffer.File(...) results as Blob/File native instances so properties and methods keep the existing fetch-backed behavior.
  • Materialize stable ArrayBuffer backing aliases for Buffer .buffer / .parent, including registered view offsets for .byteOffset / .offset.
  • Add focused node-suite fixtures for namespace constructors, backing properties, parent aliases, view offsets, and ArrayBuffer write-through.

Why batched:

Verification:

  • RUSTC_WRAPPER= cargo build --release -p perry -p perry-runtime -p perry-stdlib
  • PATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH RUSTC_WRAPPER= ./run_parity_tests.sh --suite node-suite --module buffer --filter namespace-constructors (PASS, test-parity/reports/parity_report_20260530_170453.json)
  • PATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH RUSTC_WRAPPER= ./run_parity_tests.sh --suite node-suite --module buffer (PASS 131, fail 0, compile fail 0, skipped 0; test-parity/reports/parity_report_20260530_170504.json)
  • PATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH RUSTC_WRAPPER= ./run_parity_tests.sh --filter test_parity_buffer (PASS, test-parity/reports/parity_report_20260530_170754.json)
  • RUSTC_WRAPPER= cargo check -p perry-hir -p perry-runtime -p perry-stdlib -p perry-codegen
  • cargo fmt --all -- --check
  • git diff --check
  • ./scripts/check_file_size.sh

Notes:

  • This does not redesign Buffer storage or pooling; it routes the Node-compatible backing-property surface through the existing registered Buffer/view alias machinery.

@andrewtdiz

Copy link
Copy Markdown
Contributor Author

Pushed the same CI-only fix for the cargo-test ENOSPC failure. The failed job ran out of disk building perry-ext-ws; this branch now reduces cargo-test artifact size and prunes package artifacts after each package test.\n\nLocal verification:\n- workflow YAML parsed successfully\n- git diff --check

@andrewtdiz

Copy link
Copy Markdown
Contributor Author

Fixed the cargo-test failure from the latest run.

This branch predates the HIR changes that now exist on main, so the duplicate stable-hash tags only appeared in GitHub's PR merge ref. I merged origin/main into the branch, then applied the same RegExpEscape stable-hash tag fix used on #3414.

Local checks passed: CARGO_TARGET_DIR=/root/perry/target cargo test -p perry-hir stable_hash::tests::expr_variant_stable_hash_tags_are_unique, cargo fmt --all -- --check, git diff --check HEAD~2..HEAD, git diff --check, and scripts/check_file_size.sh.

@proggeramlug
proggeramlug merged commit bb1ab64 into PerryTS:main May 30, 2026
11 checks passed
proggeramlug added a commit that referenced this pull request May 30, 2026
#3409 (RegExpEscape) and #3402 (ReflectIsExtensible) both merged via a
tag race, each assigning stable-hash tag 12045 — making
expr_variant_stable_hash_tags_are_unique fail on main and blocking all
PR CI. Reassign ReflectIsExtensible to the free tag 12048 (matches the
fix already on PR #3445's branch, so no future conflict).

Co-authored-by: Ralph Küpper <ralph2@skelpo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants