Build failed to create dependency graph dep-graph.part.bin: No such file or directory (macos only)

Since macos sequoia 15.*, incremental cargo build --all-targets randomly fails for me in a workspace with the following error:

error: failed to create dependency graph at
/.../target/debug/incremental/test_xzz-.../.../dep-graph.part.bin:
No such file or directory (os error 2)

I can see the file being referred to as STAGING_DEP_GRAPH_FILENAME in rust/compiler/rustc_incremental/src/persist/fs.rs.

Has anyone seen this before?

Observed behavior:

  • Whether the error appears or not seems to be random, more often if more crates have changes. I could not yet identify a pattern how to force it to reproduce.
  • What crate the error appears on seems to be random as well.
  • Often the problem is resolved by running the build again a few times, but sometimes many new attempts are required. When it happened again today I gave up after 10 attempts and did a cargo clean.
  • cargo clean always resolves the problem, but is of course expensive

Operating System:

  • I've only seen the error on macos since upgrading to Sequoia 15.0 (also 15.1), never on 14.*.
  • Never seen the error on Linux nor on Windows (same repo/workspace).

Machine:

  • I only have access to multiple different M2 macs, all of them are affected the same way.

Rust:

  • stable-aarch64-apple-darwin 1.82.0 (f6e511eec 2024-10-15), but was also a problem with 1.81 and I believe also earlier versions - the issue appeared with upgrading macos, not upgrading rust (but could be accidental/anecdotal)

Unfortunately I cannot share the repository.

You may want to open an issue at https://github.com/rust-lang/rust/issues/.

rm -r target/debug/incremental may be enough to get it working again. This only removes the incr comp cache and doesn't cause any unchanged crates to be built again.

1 Like