-
Notifications
You must be signed in to change notification settings - Fork 92
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
Proc-macro dependencies being rebuilt in dev
mode
#370
Comments
1.68.0 is unaffected, and 1.69 is affected. And indeed some freshness work was done rust-lang/cargo@0.68.0...0.69.0 |
Ironically the change was done there to display reasons for rebuilds, but the reason for rebuilding affected crates is not being displayed. |
Do you have a minimal repro I can take a look at? What does cargo say about which files have changed specifically? |
Will try to minimize when I find some time.
I can't get it to tell me anything, even with |
You can also try running it with |
I created a quick-start example based project where I've added syn as a depdency (which brings also proc-macro2), and couldn't reprod, even bringing more and more little details of the affected project.
Affected:
Not affected:
which reading the code suggests that in the affected build |
I see that it affects another projects, so maybe I'm not just crazy. I reported it on cargo issue tracker, maybe I can get some help. |
Important observation: I have 3 stages of building
The "run tests" internally, very early runs the same command that "build workspace" runs (in case this script is invoked from a dev shell). And there there is no rebuilds. Which I just realized, rules out the storing&restoring of target directory itself being an issue. |
Not doing |
Getting rid of Getting rid of any differences between (I'm basically stripping improvements/optimizations and see if any fixes it). |
The problem did not happen in |
We have an extra @Radvendii since you seem to experience same issues, and I don't know the exact details, if you could verify that, it would be very valuable. |
I'm not sure where I'm supposed to set that profile. If I add |
If you ever build your own |
So I set |
There's also the @Radvendii you can set |
first i get a bunch of logs like
Then i get a bunch of logs like
Then a bunch of normal-looking logs e.g.
And only after a ton of logs does it actually start compiling the dependencies. I'm not seeing any of the "fingerprint mismatch" logs and nothing of note immediately before the dependencies get re-compiled The most suspicious looking thing is the "no such file or directory" errors |
Since I know that
the problem disappears. |
TODO Try a fork of Edit: Nvmd. That's not it. It has something to do with deps-only minimization, and I forgot about it. |
Found it!!! Fix/workaround: https://github.com/fedimint/fedimint/pull/3212/files @ipetkov I don't know if there's anything crane could do about it. Probably not. Maybe it's worth pointing out somewhere. Or at least it's good to be aware of it. |
The workaround means you cannot have debug info anymore? That is quite of a bummer, as I use crane also for building binaries for integration tests. |
The workaround is |
I see, thanks! |
@Radvendii You should give it a try. I'm curious if it fixes it for you as well. Since you were getting rebuilds in release mode, you either have a different problem, or you were using |
build.rs
-using deps dev
mode
I've recently upgraded Rust from 1.67.0 to 1.71.0, and noticed that in our "build workspace" derivation, some dependencies are being re-compiled, even though they were compiled in "build workspace deps only" derivation.
I confirmed that just switching between 1.67.0 and 1.71.0 fixes/introduces the problem.
It looks like only
build.rs
(and deps that depend on them) are being rebuilt, and from the initial debugging session I suspect something about tracking which deps require rebuild changed between these two toolchain (well... probably cargo) versions.Notably the files restored in
/build/source/target/
fromzstd
(I use the zstd mode) archive produced by deps-only have different timestamps than originals: they are all reset to the default unix timestamp, while the original ones had the original timestamps. I suspect something about how cargo tracks these changed.The text was updated successfully, but these errors were encountered: