windows: recognize reserved DOS device names before NtCreateFile - #34770
Open
robobun wants to merge 21 commits into
Open
windows: recognize reserved DOS device names before NtCreateFile#34770robobun wants to merge 21 commits into
robobun wants to merge 21 commits into
Claude / Claude Code Review
completed
Jul 20, 2026 in 31m 36s
Code review found 3 potential issues
Found 5 candidates, confirmed 3. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 0 |
| 🟡 Nit | 3 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🟡 Nit | src/sys/lib.rs:6698-6714 |
openat-routed ops recognise DOS device names on drive-absolute paths, libuv-routed ops do not |
| 🟡 Nit | src/bundler/bundle_v2.rs:4210-4215 |
Stale bundler comments reference removed NT-open-path trailing-dot strip |
Annotations
Check warning on line 6714 in src/sys/lib.rs
claude / Claude Code Review
openat-routed ops recognise DOS device names on drive-absolute paths, libuv-routed ops do not
The device-name check now runs for `\\?\X:…` in `normalize_path_windows_opts` (openat path), but libuv-routed ops (`stat`/`lstat`/`unlink`/`rename`/`chmod`/`access`) still take `slice_z` → `sys_uv` → `CreateFileW("\\?\C:\…\aux")`, where the `\\?\` prefix suppresses Win32's own device translation — so for `p = path.join(os.tmpdir(), "aux")`, `writeFileSync(p)` targets `\??\AUX` while `statSync(p)`/`unlinkSync(p)` still target the literal file. This is the device-name analogue of the trailing-dot
Check warning on line 4215 in src/bundler/bundle_v2.rs
claude / Claude Code Review
Stale bundler comments reference removed NT-open-path trailing-dot strip
The "and our NT open path" clause in these two comments (also at `src/bundler/linker_context/generateChunksInParallel.rs:372-374`) is stale — commit 44a349e8 dropped the trailing-`.`/` ` strip from `normalize_path_windows_opts`, so Bun's NT open path no longer strips these characters; only Win32/CreateFileW (for non-`\\?\` paths) does. The strip loop itself is still correct; just reword the rationale to cite Win32 semantics only (e.g. "Win32 strips trailing `.`/` ` at open time").
Loading