Open Yury-Fridlyand opened 11 months ago
Looks like pretty similar or probably the same as https://github.com/rust-lang/cargo/issues/12060?
Sorry I am not familiar with WSL. Is it WSL that does not support filesystem in nanosecond precision, or you have a special fs or NFS?
BTW, I believe tokio supports Windows.
If possible, could you include a minimal reproduce to help debug? Either uploading the repo as a zip file here, or a GitHub repo link works :)
Hi @weihanglo, Yes, #12060 is pretty similar. Unfortunately, the repo is private, but I'll create a new project for you.
WSL or WSL 2?
changed "/mnt/c/
"
it looks your project was placed in the windows file system, i recomment you create a new project on the linux side, like in /home/foo
.
@weihanglo,
There is a sample for you: https://github.com/Yury-Fridlyand/cargo-sample-13119. signal-hook-tokio
isn't compatible with Windows, but you can build it on WSL.
@sanmai-NL WSL2, thank you for asking
@linyihai Yes, it works. But I have to use IDE and use GUI tools, so I use a mapped filesystem, which strips nanos.
I experience same problem recently.
cargo 1.76.0-nightly (6790a5127 2023-11-10)
release: 1.76.0-nightly
commit-hash: 6790a5127895debec95c24aefaeb18e059270df3
commit-date: 2023-11-10
host: x86_64-unknown-linux-gnu
libgit2: 1.7.1 (sys:0.18.1 vendored)
libcurl: 8.4.0-DEV (sys:0.4.68+curl-8.4.0 vendored ssl:OpenSSL/1.1.1u)
ssl: OpenSSL 1.1.1u 30 May 2023
os: Ubuntu 22.04 (jammy) [64-bit]
somehow cargo rebuild every crate.
I'm having a similar issue, with WSL2 on top of Windows 10. It doesn't seem to depend at all on what particular dependency I add; it has nothing in particular to do with tokio. Occasionally I can even manage to reproduce it with an empty crate with no dependencies at all. Here's a transcript reproducing the issue in an empty directory. Shouldn't require any other code to reproduce it.
$ cargo init
Created binary (application) package
$ cargo add anyhow
Updating crates.io index
Adding anyhow v1.0.75 to dependencies.
Features:
+ std
- backtrace
Updating crates.io index
$ cargo build
Compiling anyhow v1.0.75
Compiling cargo-issue v0.1.0 (/mnt/c/Users/cobaw/Documents/src/speriment/cargo-issue)
Finished dev [unoptimized + debuginfo] target(s) in 2.43s
$ cargo build
Compiling anyhow v1.0.75
Compiling cargo-issue v0.1.0 (/mnt/c/Users/cobaw/Documents/src/speriment/cargo-issue)
Finished dev [unoptimized + debuginfo] target(s) in 1.41s
$ cargo build
Finished dev [unoptimized + debuginfo] target(s) in 0.09s
$ cargo --version
cargo 1.74.1 (ecb9851af 2023-10-18)
$ uname -a
Linux berg 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
BUT ALSO. @linyihai is right. It only happens when the code is actually stored on the Windows file system, accessed through WSL (usually on /mnt/c/...). And it does appear to have something to do with nanoseconds...
BUT ALSO. @linyihai is right. It only happens when the code is actually stored on the Windows file system, accessed through WSL (usually on /mnt/c/...). And it does appear to have something to do with nanoseconds...
I am running ubuntu on vmware, and I still have this issue.
Can you guys log information about the clock under the VM? And all Cargo logs related to caching? And then the actual filesystem timestamps.
I am running ubuntu on vmware, and I still have this issue.
Are you using a shared filesystem?
@ChrisDenton No.
any progress on this issue,I still have this problem.
Problem
My project depends on
tokio
which doesn't support Windows. I run all build activities on WSL[^1]. Cargo always recompiles the sources even if I have no changes. Following the docs I run build withCARGO_LOG
and there are logs (some info omitted):As you can see, nanoseconds are stripped by filesystem for files created by WSL.
[^1]: WSL is a Linux VM hosted by Windows which uses a shared filesystem.
Steps
cargo build
cargo build
cargo build
Possible Solution(s)
Ignore nanoseconds for file timestamps on WSL.
Notes
No response
Version