Skip to content

fix: handle directories in dep-info source file hashing#2676

Open
mmastrac wants to merge 1 commit intomozilla:mainfrom
vercel:upstream-pr/fix-dir-dep-info
Open

fix: handle directories in dep-info source file hashing#2676
mmastrac wants to merge 1 commit intomozilla:mainfrom
vercel:upstream-pr/fix-dir-dep-info

Conversation

@mmastrac
Copy link
Copy Markdown

@mmastrac mmastrac commented Apr 17, 2026

This patch has been in testing in the vercel/sccache fork for a number of weeks.

When proc_macro::tracked::path() registers a directory as a dependency, rustc's dep-info output includes the directory path. sccache previously crashed with "Is a directory" when trying to hash these paths.

Now recursively hashes all files within the directory (sorted for determinism), using relative paths as delimiters. This correctly captures directory dependencies so cache invalidation works when any file in the tracked directory changes.

Note that proc_macro_tracked_path is a nightly-only feature, but this nightly feature is being used by an include_dirs fork used by the next.js team. The hashing falls back to the same file-specific hash as before in all other cases.

Fixes: #2653

@mmastrac mmastrac force-pushed the upstream-pr/fix-dir-dep-info branch from 5e7caa4 to 0e3a517 Compare April 17, 2026 17:52
When proc_macro::tracked::path() registers a directory as a dependency,
rustc's dep-info output includes the directory path. sccache previously
crashed with "Is a directory" when trying to hash these paths.

Now recursively hashes all files within the directory (sorted for
determinism), using relative paths as delimiters. This correctly
captures directory dependencies so cache invalidation works when
any file in the tracked directory changes.

Fixes: mozilla#2653
@mmastrac mmastrac force-pushed the upstream-pr/fix-dir-dep-info branch from 0e3a517 to 3a3f315 Compare April 17, 2026 18:20
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.

Fatal error "Is a directory" when dep-info contains subdirectory paths from proc_macro::tracked::path()

1 participant