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 don't have access to a Mac, but the tests for one of my projects (Evcxr) run on Travis on Mac and I've observed warnings not showing up on the second run of cargo check.
I do the following:
Write some code
Run cargo check
Modify the code so that there should be a warning
Run cargo check again
On the second run, the warning that I expect doesn't appear. It's intermittent though. If I run the test 10 times, the warning is typically missing in 7-10 of those runs.
I've tried a range of Rust versions from 1.46 to a recent nightly (2021-01-05).
I've reproduced it for two warnings so far:
Variable not used
Variable does not need to be mutable
The problem doesn't seem to happen at all on Linux, nor on Windows (which I also run via Travis).
Turning off incremental compilation doesn't seem to make any difference. It also still seems to reproduce if using main.rs instead of lib.rs.
It feels like if this really happened on all Macs, it would have been noticed, so perhaps there's something difference with the setup on Travis.
The following is a test that reproduces the problem. It requires tempfile = "3.1.0" in it's Cargo.toml dependencies.
I believe Travis is still using HPFS on macOS, which has an mtime resolution of one second. For various reasons (see rust-lang/cargo#5918 (comment)), Cargo is unable to treat that as a changed file, so it cannot detect the file change. You will need to add a 1 second sleep in-between invocations to allow it to detect the change. Hashing support was started in #75594, but it seems to have stalled.
I don't have access to a Mac, but the tests for one of my projects (Evcxr) run on Travis on Mac and I've observed warnings not showing up on the second run of
cargo check
.I do the following:
cargo check
cargo check
againOn the second run, the warning that I expect doesn't appear. It's intermittent though. If I run the test 10 times, the warning is typically missing in 7-10 of those runs.
I've tried a range of Rust versions from 1.46 to a recent nightly (2021-01-05).
I've reproduced it for two warnings so far:
The problem doesn't seem to happen at all on Linux, nor on Windows (which I also run via Travis).
Turning off incremental compilation doesn't seem to make any difference. It also still seems to reproduce if using
main.rs
instead oflib.rs
.It feels like if this really happened on all Macs, it would have been noticed, so perhaps there's something difference with the setup on Travis.
The following is a test that reproduces the problem. It requires
tempfile = "3.1.0"
in it's Cargo.toml dependencies.You can see the log of one recent run here. Full source of the tests in that run is here.
The text was updated successfully, but these errors were encountered: