You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have cargo installed via rustup on Windows, and cargo build fails with this error message when trying to build inside of a mounted WSL directory (i.e. \\wsl.localhost\Ubuntu\home\user\...):
PS Microsoft.PowerShell.Core\FileSystem::\\wsl.localhost\Ubuntu\home\user\fend> cargo build
Compiling fend-core v1.2.1 (\\wsl.localhost\Ubuntu\home\user\fend\core)
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 `fend-core` (lib) due to previous error
Disabling incremental compilation with $env:CARGO_INCREMENTAL = "0" works, as does using a Linux version of cargo/rustc, but I was working on Windows-specific code and did not want to cross-compile, nor move my rust code outside WSL.
Steps
Install rustup, cargo, rustc, etc. on Windows
Set up a cargo project inside WSL
Open a powershell window and run:
cd \\wsl.localhost\Ubuntu\home\user\project
$env:CARGO_INCREMENTAL="0"
cargo build
Possible Solution(s)
File locking should be fixed in this scenario, or incremental compilation should be disabled automatically.
Thanks for the report! I'm going to close this as a duplicate of rust-lang/rust#49773 since it is a known issue that incremental is not compatible with filesystems that don't support locking.
Problem
I have cargo installed via rustup on Windows, and
cargo build
fails with this error message when trying to build inside of a mounted WSL directory (i.e.\\wsl.localhost\Ubuntu\home\user\...
):Disabling incremental compilation with
$env:CARGO_INCREMENTAL = "0"
works, as does using a Linux version of cargo/rustc, but I was working on Windows-specific code and did not want to cross-compile, nor move my rust code outside WSL.Steps
Possible Solution(s)
File locking should be fixed in this scenario, or incremental compilation should be disabled automatically.
Notes
No response
Version
The text was updated successfully, but these errors were encountered: