-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
cargo check shows errors when there are none and code compiles and runs cleanly otherwise #12145
Comments
If there are certain files I can share (or omit) from my project, please let me know and I will share. I'm keeping a copy of the current state of the project for that purpose. It's just too big to share and I don't know what files are relevant. |
I'm sorry you're having trouble with that. Can you run cargo with the There's also information at https://doc.rust-lang.org/cargo/faq.html?highlight=faq#why-is-cargo-rebuilding-my-code for understanding why something isn't rebuilding. |
Sorry for the delay. I was traveling this past week. I ran
Then I ran this command, as requested:
Here is the captured output. https://gist.github.com/nerdo/e19d4e8fdf1e6fe28083cb3ca6af8bec |
I took a closer look at the output and I see several lines showing the files as dirty/stale where I expect it, namely
|
Hm, I can't tell from the output how it got into that state. My guess is that
Those are 128 hours apart. They should only ever be a few seconds apart. The Unfortunately I don't think we'll be able to see what happened without seeing the similar debug logs from what happened on 2023-05-15 13:38:21 when the dep-info file was updated, but the rmeta file was not. I have not seen anything quite like this. I would be suspicious of the case that this is using a removeable drive. One thing to be careful with those is to always ensure they are properly ejected so that the metadata information can get synced properly. Otherwise I don't have any other ideas. |
What you described is accurate - this manifested when I renamed/refactored new_determinate/indeterminate. I don't know why or how it happened, but it has happened to me on multiple separate occasions, even in projects on my internal ssd. I've just gotten tired of the issue and decided to see if there was an open issue on it and am reporting it. I have a feeling something weird is happening with Is there a way I can provide that file you mentioned when the dep-info file was updated? |
Unfortunately cargo doesn't record enough information to be able to debug this after-the-fact. The only way is to see the debug logs on the build just before and just after the problem manifests. But that requires manually recording those debug logs, which would be quite difficult and onerous. If you can make a reproducible test cases of:
I think that will be nearly impossible to do for your scenario, so I wouldn't expect you to try. In the future we would like to have cargo record more data to be able to debug these kinds of things, but that's a long way off. Another thing we would like to experiment with is hash-based change detection (instead of mtime), but that is also a long way off. |
Hello! I am experiencing a similar issue. I am working with two crates locally on my Mac. One crate is a dependency of the other. When I update the code in the dependency crate, I need to run Untitled.mov |
I'm having a very similar problem with a similar setup. A crate with a few libs and inter-dependencies and for some reason, I kept getting an error in my ide (neovim) about a function not existing, but it does exist and the code compiles and executes cleanly otherwise.
While it's in this state, I copied the directory to another and attempted to zip it but it's too large to share (19GB! I'm assuming, because of dependencies - it's really not a huge program).
I tried running
cargo clean
in my main workspace, and it seemed to half fix it? I had a few errors but now it's only showing one.It's quite annoying as I can't trust what
cargo check
is saying and need to fully compile much more frequently as a result.It may be worth noting that I'm using macos, and that this project's files are sitting on an external APFS volume that I use to switch back and forth between two macos-based machines... although I'm almost certain I've come across this issue before on projects that were on an internal SSD.
Some output to demonstrate. These two commands were run back-to-back:
Originally posted by @nerdo in #9971 (comment)
The text was updated successfully, but these errors were encountered: