Skip to content

Regression: "error finalizing incremental compilation session directory. Access is denied. (os error 5)" when building on Windows #151181

@ssg

Description

@ssg

This is a reincarnation of #86929 but possibly for a different root cause. This one seems to only happen on ReFS (Dev Drive) volumes on Windows regardless if Windows Defender is enabled or not.

The issue reproduces on rust 1.90.0 and onward (the latest I tried is 1.92.0), but it does not reproduce on rust 1.89.0

Failing build output (tried on xxhash-rust repository at 7026cd705195f502283f97aafc9ea41930099c68):

PS S:\github\xxhash-rust>rustup default 1.90.0
info: using existing install for '1.90.0-x86_64-pc-windows-msvc'
info: default toolchain set to '1.90.0-x86_64-pc-windows-msvc'

  1.90.0-x86_64-pc-windows-msvc unchanged - rustc 1.90.0 (1159e78c4 2025-09-14)

PS S:\github\xxhash-rust>rustc --version --verbose
rustc 1.90.0 (1159e78c4 2025-09-14)
binary: rustc
commit-hash: 1159e78c4747b02ef996e55082b704c09b970588
commit-date: 2025-09-14
host: x86_64-pc-windows-msvc
release: 1.90.0
LLVM version: 20.1.8

PS S:\github\xxhash-rust>cargo build
warning: error finalizing incremental compilation session directory `\\?\S:\github\xxhash-rust\target\debug\incremental\xxhash_rust-3cf7c3qx5vrse\s-hevy05ia4q-02o7lki-working`: Access is denied. (os error 5)

warning: `xxhash-rust` (lib) generated 1 warning
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.08s

succeeding build:

PS S:\github\xxhash-rust>rustup default 1.89.0
info: using existing install for '1.89.0-x86_64-pc-windows-msvc'
info: default toolchain set to '1.89.0-x86_64-pc-windows-msvc'

  1.89.0-x86_64-pc-windows-msvc unchanged - rustc 1.89.0 (29483883e 2025-08-04)

PS S:\github\xxhash-rust>rustc --version --verbose
rustc 1.89.0 (29483883e 2025-08-04)
binary: rustc
commit-hash: 29483883eed69d5fb4db01964cdf2af4d86e9cb2
commit-date: 2025-08-04
host: x86_64-pc-windows-msvc
release: 1.89.0
LLVM version: 20.1.7

PS S:\github\xxhash-rust>cargo build
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.08s
PS S:\github\xxhash-rust>

Meta

rustc --version --verbose:

rustc 1.92.0 (ded5c06cf 2025-12-08)
binary: rustc
commit-hash: ded5c06cf21d2b93bffd5d884aa6e96934ee4234
commit-date: 2025-12-08
host: x86_64-pc-windows-msvc
release: 1.92.0
LLVM version: 21.1.3```

No backtrace available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationC-bugCategory: This is a bug.O-windowsOperating system: WindowsWG-incr-compWorking group: Incremental compilationneeds-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions