Skip to content

test(fs): cover recursive mkdir options-object decoding - #8309

Merged
proggeramlug merged 2 commits into
mainfrom
fix/claude-mkdir-options-regression
Aug 17, 2026
Merged

test(fs): cover recursive mkdir options-object decoding#8309
proggeramlug merged 2 commits into
mainfrom
fix/claude-mkdir-options-regression

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an end-to-end regression test for the fs.mkdirSync(path, { recursive: true }) options-object crash fixed in #8204. Claude Code exercises this exact call during normal startup, while its --version fast path exits before reaching it.

Changes

  • Compile and run a minimal TypeScript program that passes an options object to recursive mkdirSync.
  • Assert that the nested directory is created and the native program exits successfully.
  • Document how the old fs string helper misread an object header as a StringHeader and attempted a roughly 2 GiB copy.

Related issue

Follow-up to #8204; refs #8122.

Test plan

  • cargo build --release clean (not run; test-only change)
  • cargo test --workspace --exclude perry-ui-ios --exclude perry-ui-tvos --exclude perry-ui-watchos --exclude perry-ui-gtk4 --exclude perry-ui-android --exclude perry-ui-windows passes (not run)
  • rustfmt --edition 2024 --check crates/perry/tests/issue_8122_fs_mkdir_options_object.rs
  • git diff --cached --check
  • Compiled and ran the same reproducer with the corrected release runtime and PERRY_GC_VERIFY_EVACUATION=1: PASS, exit 0
  • Added a user-facing regression test in the affected crate
  • Updated docs/src/ (not applicable; no API or behavior change)
  • Built a platform UI backend (not applicable)

The focused Cargo invocation was also attempted on Windows. It currently stops while compiling clean main because native_stack_scan.rs references Unix-only libc::Dl_info / libc::dladdr; it does not reach this test. Workspace-wide cargo fmt likewise hits Windows path error 206, while the new file passes standalone rustfmt.

Screenshots / output

Wrote executable: claude-code-build\repro-mkdir-options.exe
PASS
RUN_EXIT=0

Checklist

  • I have NOT bumped the workspace version or edited CLAUDE.md / CHANGELOG.md (maintainer handles these at merge)
  • My commit follows the repository's conventional prefix style
  • I've read CONTRIBUTING.md and agree to the Code of Conduct

Summary by CodeRabbit

  • Bug Fixes

    • Fixed an issue where fs.mkdirSync could crash when called with an options object containing recursive: true.
    • Recursive directory creation now works correctly with nested paths.
  • Tests

    • Added regression coverage validating directory creation, execution success, and cleanup.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 96d92bb3-65d1-496d-8622-147e71afc08f

📥 Commits

Reviewing files that changed from the base of the PR and between 280aafe and 0423751.

📒 Files selected for processing (2)
  • changelog.d/8309-mkdir-options-object-regression.md
  • crates/perry/tests/issue_8122_fs_mkdir_options_object.rs

Included review availability: Your plan includes up to 8 reviews per rolling hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

Adds an end-to-end regression test for recursive fs.mkdirSync calls with { recursive: true }. The test verifies compilation, execution, nested-directory creation, output, and cleanup. A changelog entry documents the test.

Changes

mkdirSync options-object regression

Layer / File(s) Summary
Recursive mkdirSync regression test
crates/perry/tests/issue_8122_fs_mkdir_options_object.rs, changelog.d/8309-mkdir-options-object-regression.md
The test compiles and runs embedded Perry code, verifies nested-directory creation and PASS output, removes the temporary directory, and documents the regression coverage.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 04237

This localized test-only change adds coverage for recursive mkdir options-object handling without changing production behavior; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the regression test for recursive fs.mkdirSync options-object decoding.
Description check ✅ Passed The description covers the summary, changes, related issues, test plan, validation results, screenshots, and checklist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/claude-mkdir-options-regression

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug
proggeramlug merged commit da6410e into main Aug 17, 2026
44 of 46 checks passed
@proggeramlug
proggeramlug deleted the fix/claude-mkdir-options-regression branch August 17, 2026 13:03
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.

1 participant