mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 11:29:02 +00:00
This adds filesystem detection logic to Bun's cache directory so that the cache is placed on the same mount/filesystem as the install location (node_modules). This enables efficient hardlink creation during package installation. Key changes: - Add filesystem_utils.zig with utilities for filesystem detection - Update PackageManagerDirectories to check filesystem boundaries - Add fetchCacheDirectoryPathWithInstallDir that considers install location - Add findOptimalCacheDir to walk up directory tree for writable cache location - Add comprehensive tests for filesystem-aware cache behavior The implementation will: 1. Use default cache when on same filesystem as node_modules 2. Find optimal cache location on same filesystem when different 3. Walk up from mount point toward project to find writable location 4. Fall back to project-local cache if no suitable location found 5. Respect explicit BUN_INSTALL_CACHE_DIR settings 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>