Cargo on Windows broken for project on WSL after upgrade to Windows 11

Hello,

I've been using Windows Subsystem for Linux, where my project is on the Ubuntu partition, and I have a Rust toolchain installed on Ubuntu, and also one on Windows, which is used by the IntelliJ RustRover (edit: actually, no, RR uses the Ubuntu-based toolchain). This worked fine until I upgraded to Windows 11 today, after which trying to use the Windows-based toolchain on Ubuntu-based projects fails:

PS Microsoft.PowerShell.Core\FileSystem::\\wsl.localhost\Ubuntu\home\oliverr\git\jati> cargo clippy
    Checking jati v0.1.0 (\\wsl.localhost\Ubuntu\home\oliverr\git\jati)
error: incremental compilation: could not create session directory lock file: Incorrect function. (os error -2147024895)
  |
  = help: incremental compilation can be disabled by setting the environment variable CARGO_INCREMENTAL=0 (see https://doc.rust-lang.org/cargo/reference/profiles.html#incremental)
  = help: the entire build directory can be changed to a different filesystem by setting the environment variable CARGO_TARGET_DIR to a different path (see https://doc.rust-lang.org/cargo/reference/config.html#buildtarget-dir)

error: could not compile `jati` (lib) due to 1 previous error
PS Microsoft.PowerShell.Core\FileSystem::\\wsl.localhost\Ubuntu\home\oliverr\git\jati>

It still works fine if I use the Ubuntu-based toolchain on Ubuntu-based projects, or the Windows-based toolchain on Windows-based projects.

Any ideas? Thanks!

Have you tried cargo cleaning the repository. The error mentions an issue with incremental compiles, so it seems possible it got into a bad state from a previous session.

Thanks, but still same error after cleaning.

Looks like this which was closed as a duplicate of this. I.e. incremental is not supported on WSL (IIUC, not a WSL user).

Oh, so you are saying, this never worked, and I just noticed today?

Well, since today, my IntelliJ RustRover is completely broken (can't find any declarations from other files, etc), and I thought I had it traced back to this problem.

But it turns out I was wrong: my RustRover has in fact been using the Ubuntu-based toolchain. And it reports no errors using it. And now I remember that not only I upgraded to Windows 11, but I also upgraded RustRover, so it could just be a new bug in RR.

Thanks for the responses, anyway!

I'm not :100: if it could have worked before or not, but the issue looked like as good a match as one could hope for :slight_smile: .