Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error trying to build over WSL path #7511

Closed
bmc-msft opened this issue Oct 14, 2019 · 1 comment · Fixed by #7602
Closed

Error trying to build over WSL path #7511

bmc-msft opened this issue Oct 14, 2019 · 1 comment · Fixed by #7602
Labels
A-filesystem Area: issues with filesystems C-bug Category: bug O-windows OS: Windows

Comments

@bmc-msft
Copy link

Problem
When trying to build a project over a WSL mount, cargo is unable to lock Cargo.lock and generates an error

Steps

  1. Install rust in Windows
  2. Checkout a simple rust project in WSL (such as /tmp/testing)
  3. In powershell, change directories to \\wsl$\<Distro>\tmp\testing, then run cargo build

PS Microsoft.PowerShell.Core\FileSystem::\wsl$\Ubuntu\tmp\testing> cargo build --release
error: failed to lock file: \wsl$\Ubuntu\tmp\testing\Cargo.lock

Caused by:
Incorrect function. (os error 1)
PS Microsoft.PowerShell.Core\FileSystem::\wsl$\Ubuntu\tmp\testing>

Possible Solution(s)

Notes

Output of cargo version:

cargo 1.40.0-nightly (a429e8c 2019-10-04)

@guanqun
Copy link

guanqun commented Oct 28, 2019

I can reproduce this issue. The root cause is that it's not allowed to acess file (here, locking file) via \\wsl$\<Distro>, from Microsoft's doc, it's more likley a network sharing thing, or implemented via 9p server. I double the locking api from winapi is implemented or even available.

It's purely a platform specific issue, and related to how files within WSL can be accessed in Win app.

@ehuss ehuss added A-filesystem Area: issues with filesystems O-windows OS: Windows labels Nov 8, 2019
bors added a commit that referenced this issue Nov 18, 2019
…s, r=alexcrichton

Ignore file lock errors if unsupported, on Windows

Not all file systems support file locking; WSL’s network file system doesn’t seem to, and I don’t think other network file systems will, either (though I haven’t checked them). ERROR_INVALID_FUNCTION is Windows’ equivalent to Unix’s ENOTSUP and Linux’s ENOSYS which are checked just above.

Fixes #7511.
bors added a commit that referenced this issue Nov 19, 2019
…s, r=alexcrichton

Ignore file lock errors if unsupported, on Windows

Not all file systems support file locking; WSL’s network file system doesn’t seem to, and I don’t think other network file systems will, either (though I haven’t checked them). ERROR_INVALID_FUNCTION is Windows’ equivalent to Unix’s ENOTSUP and Linux’s ENOSYS which are checked just above.

Fixes #7511.
@bors bors closed this as completed in 60aa78e Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-filesystem Area: issues with filesystems C-bug Category: bug O-windows OS: Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants