-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed as not planned
Closed as not planned
Copy link
Labels
C-bugCategory: bugCategory: bugS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Description
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\...):
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.
Notes
No response
Version
cargo 1.72.0 (103a7ff2e 2023-08-15)
release: 1.72.0
commit-hash: 103a7ff2ee7678d34f34d778614c5eb2525ae9de
commit-date: 2023-08-15
host: x86_64-pc-windows-msvc
libgit2: 1.6.4 (sys:0.17.2 vendored)
libcurl: 8.1.2-DEV (sys:0.4.63+curl-8.1.2 vendored ssl:Schannel)
os: Windows 10.0.22621 (Windows 11 Professional) [64-bit]
Metadata
Metadata
Assignees
Labels
C-bugCategory: bugCategory: bugS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.