You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(runtime): macOS Seatbelt blocks Bun from resolving workspace cwd #4236
Under the macOS Auto sandbox, Bun 1.3.5 exits before bun run or bunx starts the requested command:
error loading current directory
error: An internal error occurred (CouldntReadCurrentDirectory)
How to reproduce
Open $WORKSPACE in Maka on macOS.
Keep sandbox mode set to Auto and use the workspace-write profile.
Run this managed shell command:
cd"$WORKSPACE"
bun run typecheck
The same policy can run /bin/pwd -P, while bun run typecheck exits 1.
Expected
Bun resolves the current workspace and starts the package script under the restricted profile.
Root cause
buildReadableRootsPolicy() in packages/runtime/src/sandbox/macos-seatbelt.ts grants file-read* only to each readable root and its subtree. Bun 1.3.5 opens cwd ancestor directories while resolving the workspace. Seatbelt denies file-read-data on those directories, and Bun reports CouldntReadCurrentDirectory.
A file-read-data rule combining path-ancestors, vnode-type DIRECTORY, and existing explicit-deny requirements grants directory traversal only. Regular files in ancestor directories remain unreadable.
Activity