Skip to content

[7/9] fix: handle directories in dep-info source file hashing#5

Open
mmastrac wants to merge 1 commit intovercel/file-clone-compressfrom
vercel/fix-dir-dep-info
Open

[7/9] fix: handle directories in dep-info source file hashing#5
mmastrac wants to merge 1 commit intovercel/file-clone-compressfrom
vercel/fix-dir-dep-info

Conversation

@mmastrac
Copy link
Copy Markdown
Collaborator

Summary

Fixes mozilla#2653.

  • When proc_macro::tracked::path() registers a directory as a dependency, rustc's dep-info includes the directory path
  • sccache previously crashed with "Is a directory" (os error 21) when trying to hash these paths
  • Now recursively hashes all files within the directory (sorted for determinism), using relative paths as delimiters
  • Correctly captures directory dependencies so cache invalidation works when any file in the tracked directory changes
  • Affects crates like turbopack-node that use include_dir! with nightly proc macro tracking

Stack: 5/6

@mmastrac mmastrac changed the base branch from vercel/file-clone-reflink to vercel/03-file-clone-reflink March 31, 2026 17:28
@mmastrac mmastrac changed the title fix: handle directories in dep-info source file hashing [4/5] fix: handle directories in dep-info source file hashing Mar 31, 2026
@mmastrac mmastrac changed the base branch from vercel/03-file-clone-reflink to vercel/file-clone-reflink March 31, 2026 17:30
@mmastrac mmastrac force-pushed the vercel/file-clone-reflink branch from 5344dad to f487cc2 Compare March 31, 2026 17:35
@mmastrac mmastrac force-pushed the vercel/fix-dir-dep-info branch from 9ea5c59 to 59848e7 Compare March 31, 2026 17:35
@mmastrac mmastrac changed the title [4/5] fix: handle directories in dep-info source file hashing [5/6] fix: handle directories in dep-info source file hashing Mar 31, 2026
@mmastrac mmastrac force-pushed the vercel/file-clone-reflink branch from f487cc2 to a7bc6d3 Compare March 31, 2026 17:38
@mmastrac mmastrac force-pushed the vercel/fix-dir-dep-info branch 2 times, most recently from 79c28ed to afd0422 Compare March 31, 2026 17:56
@mmastrac mmastrac changed the title [5/6] fix: handle directories in dep-info source file hashing [6/7] fix: handle directories in dep-info source file hashing Mar 31, 2026
@mmastrac mmastrac changed the base branch from vercel/file-clone-reflink to vercel/file-clone-compress March 31, 2026 17:56
@mmastrac mmastrac force-pushed the vercel/file-clone-compress branch from b668492 to c779b68 Compare March 31, 2026 18:03
@mmastrac mmastrac force-pushed the vercel/fix-dir-dep-info branch 2 times, most recently from 19a11db to 684ec28 Compare March 31, 2026 18:23
@mmastrac mmastrac force-pushed the vercel/file-clone-compress branch from 226e9df to c3ebfff Compare March 31, 2026 22:05
@mmastrac mmastrac force-pushed the vercel/fix-dir-dep-info branch 2 times, most recently from 3f6e50b to 7ad84a3 Compare April 1, 2026 18:01
@mmastrac mmastrac force-pushed the vercel/file-clone-compress branch 2 times, most recently from 2afce2b to f12d053 Compare April 1, 2026 20:55
@mmastrac mmastrac force-pushed the vercel/fix-dir-dep-info branch from 7ad84a3 to e491a69 Compare April 1, 2026 20:55
@mmastrac mmastrac force-pushed the vercel/file-clone-compress branch from f12d053 to 136498c Compare April 1, 2026 21:02
@mmastrac mmastrac force-pushed the vercel/fix-dir-dep-info branch from e491a69 to 0237f6e Compare April 1, 2026 21:02
@mmastrac mmastrac force-pushed the vercel/file-clone-compress branch from 136498c to 4be87c8 Compare April 2, 2026 00:52
@mmastrac mmastrac force-pushed the vercel/fix-dir-dep-info branch 2 times, most recently from 9cefa6c to a321d4a Compare April 2, 2026 16:22
@mmastrac mmastrac force-pushed the vercel/file-clone-compress branch from 4be87c8 to 0106a7d Compare April 2, 2026 16:22
@mmastrac mmastrac force-pushed the vercel/fix-dir-dep-info branch from a321d4a to bf0aca6 Compare April 2, 2026 16:24
@mmastrac mmastrac force-pushed the vercel/file-clone-compress branch 2 times, most recently from ddb7117 to eed7dde Compare April 2, 2026 16:29
@mmastrac mmastrac force-pushed the vercel/fix-dir-dep-info branch from bf0aca6 to 9590506 Compare April 2, 2026 16:29
@mmastrac mmastrac changed the title [6/7] fix: handle directories in dep-info source file hashing [7/9] fix: handle directories in dep-info source file hashing Apr 2, 2026
@mmastrac mmastrac force-pushed the vercel/fix-dir-dep-info branch from 9590506 to bd2a312 Compare April 2, 2026 17:18
@mmastrac mmastrac force-pushed the vercel/file-clone-compress branch from eed7dde to f7e3b82 Compare April 2, 2026 17:18
@mmastrac mmastrac force-pushed the vercel/fix-dir-dep-info branch from bd2a312 to 62e8073 Compare April 7, 2026 18:12
@mmastrac mmastrac force-pushed the vercel/file-clone-compress branch 2 times, most recently from 3d27feb to cf104ad Compare April 7, 2026 18:20
@mmastrac mmastrac force-pushed the vercel/fix-dir-dep-info branch from 62e8073 to 03f037d Compare April 7, 2026 18:20
@mmastrac mmastrac force-pushed the vercel/file-clone-compress branch from cf104ad to 66992c5 Compare April 7, 2026 18:24
@mmastrac mmastrac force-pushed the vercel/fix-dir-dep-info branch from 03f037d to 3e055b2 Compare April 7, 2026 18:24
@mmastrac mmastrac force-pushed the vercel/file-clone-compress branch from 66992c5 to dd8329f Compare April 7, 2026 19:09
@mmastrac mmastrac force-pushed the vercel/fix-dir-dep-info branch from 3e055b2 to 37ccf40 Compare April 7, 2026 19:09
@mmastrac mmastrac force-pushed the vercel/fix-dir-dep-info branch from 37ccf40 to db0b087 Compare April 16, 2026 21:35
@mmastrac mmastrac force-pushed the vercel/file-clone-compress branch from dd8329f to 0511c15 Compare April 16, 2026 21:35
@mmastrac mmastrac force-pushed the vercel/fix-dir-dep-info branch from db0b087 to 4fdbbf4 Compare April 17, 2026 14:44
@mmastrac mmastrac force-pushed the vercel/file-clone-compress branch 2 times, most recently from fbb6657 to 5e9fb55 Compare April 17, 2026 15:08
@mmastrac mmastrac force-pushed the vercel/fix-dir-dep-info branch from 4fdbbf4 to 2715294 Compare April 17, 2026 15:09
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

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mmastrac mmastrac force-pushed the vercel/fix-dir-dep-info branch from 2715294 to d59ecfb Compare April 17, 2026 17:44
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