Skip to content

Fix Windows workspace cache setup - #750

Open
rshabhsinha wants to merge 2 commits into
diodeinc:mainfrom
embedrapp:fix/windows-cache-junction
Open

rshabhsinha wants to merge 2 commits into
diodeinc:mainfrom
embedrapp:fix/windows-cache-junction

Conversation

@rshabhsinha

@rshabhsinha rshabhsinha commented Apr 21, 2026

Copy link
Copy Markdown

Summary

Fixes a Windows startup failure in pcb build / pcb layout when creating <workspace>/.pcb/cache.

Windows can reject directory symlink creation with os error 1314 unless Developer Mode or elevated privileges are enabled. This keeps the existing symlink path when available, and falls back to an NTFS junction for normal non-admin Windows users.

Also handles replacing stale .pcb/cache junctions safely.

Tests

  • cargo fmt --check
  • cargo check -p pcb-zen
  • cargo test -p pcb-zen --lib

Note

Medium Risk
Moderate risk because it changes filesystem link creation/removal behavior for the workspace cache on Windows, which could affect startup and path stability if edge cases are missed.

Overview
Fixes Windows failures creating <workspace>/.pcb/cache by falling back from directory symlinks to NTFS junctions when symlink creation is denied (e.g., os error 1314).

Refactors ensure_workspace_cache_symlink to detect whether the existing cache entry already targets ~/.pcb/cache (symlink or junction), safely replace stale entries, and only add the junction dependency on Windows. Updates the changelog to document the fix.

Reviewed by Cursor Bugbot for commit 88e9fe2. Configure here.

@rshabhsinha
rshabhsinha marked this pull request as ready for review April 21, 2026 04:54

This branch has not been deployed

No deployments
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