host_env: os.mkdir for Windows, Redox#8128
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PR unifies the directory-creation API in ChangesUnified make_dir API refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/host_env/src/posix_wasi.rs`:
- Around line 4-10: The make_dir function uses &Path as a parameter type, but
Path is not imported from the standard library, causing a compilation error. Add
path::Path to the existing std imports at the top of the file where ffi::OsStr
and io are already imported to bring Path into scope.
In `@crates/vm/src/stdlib/os.rs`:
- Line 191: The MKDIR_DIR_FD constant in the os.rs file is currently configured
only for unix systems using cfg!(unix), but since WASI now supports the optional
dir_fd parameter in make_dir function as implemented in posix_wasi.rs, the cfg
condition needs to be updated. Modify the MKDIR_DIR_FD constant definition to
also include WASI targets in the condition so that dir_fd functionality is
enabled on WASI systems where it is now supported.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 9e70d5e8-58e8-4b98-9525-1ee325ec8978
📒 Files selected for processing (3)
crates/host_env/src/posix.rscrates/host_env/src/posix_wasi.rscrates/vm/src/stdlib/os.rs
Sorry, something went wrong.
d408aea to
be40b57
Compare
June 19, 2026 00:49
Python supports `mkdir` on Windows. I deferred to calling Rust's implementation for now. However, like `rename`, Python's implementation supports additional features that are currently unsupported on RustPython. I added a note for future reference. Redox supports `mkdirat` which significantly cleans up the implementation.
be40b57 to
af2dbfb
Compare
June 19, 2026 00:50
Python supports
mkdiron Windows. I deferred to calling Rust's implementation for now. However, likerename, Python's implementation supports additional features that are currently unsupported on RustPython. I added a note for future reference.Redox supports
mkdiratwhich significantly cleans up the implementation.Summary
On a related note, I think the WASI Posix and Unix implementations can be combined eventually. 🤔
Summary by CodeRabbit