-
Notifications
You must be signed in to change notification settings - Fork 545
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
Rust and incremental compilation #236
Comments
I had asked about this a while back when I was doing the Rust work initially but I think incremental compilation was still new enough that I couldn't get a useful answer. It would definitely be interesting to figure out a smart plan here. Maybe the simplest thing we could do would be to store the incremental compilation outputs in the cache entry, so that if you get a full cache hit you can at least do an incremental compile on top of that if you make changes? You and @michaelwoerister and I should find time at the SF All Hands in June to chat about this. |
For sure! That I think sounds like a great idea and is quite possible to do with Unfortunately though I won't actually be at the SF All Hands, but @michaelwoerister if you've got a spare moment in the near future I'd love to chat with you about your thoughts on this :) |
Yes, that should work. It will at least double the amount of data to download though. We'd also need to review if there's anything non-portable in the cache files (i.e. local file paths or something). |
sccache doesn't currently get cache hits if file paths change (#196), so this isn't any worse than the current situation. |
…#257 rustc's incremental compilation mode isn't well-handled by sccache currently because we don't cache the separate artifacts it creates. Additionally, if there are existing incremental artifacts it's likely that rustc will do a better job than sccache anyway, so don't bother trying to cache Rust compilation when incremental compilation is enabled for now. Longer-term we would like to make sccache and rustc incremental work together nicely: mozilla#236
rustc's incremental compilation mode isn't well-handled by sccache currently because we don't cache the separate artifacts it creates. Additionally, if there are existing incremental artifacts it's likely that rustc will do a better job than sccache anyway, so don't bother trying to cache Rust compilation when incremental compilation is enabled for now. Longer-term we would like to make sccache and rustc incremental work together nicely: #236
…#257 rustc's incremental compilation mode isn't well-handled by sccache currently because we don't cache the separate artifacts it creates. Additionally, if there are existing incremental artifacts it's likely that rustc will do a better job than sccache anyway, so don't bother trying to cache Rust compilation when incremental compilation is enabled for now. Longer-term we would like to make sccache and rustc incremental work together nicely: mozilla#236
@Xuanwo What do you think about supporting Rust incremental builds or disabling incremental compilation (by default or only for crate libraries)? Caveat docs: |
I'm a little confused about this caveat, does this mean I need to disable incremental build completely and globally via |
With the advent of incremental compilation on stable Rust compile times will hopefully get much better especially in debug mode and hopefully eventually in release mode with rust-lang/rust#48996. Ideally sccache would help to integrate with incremental compilation to even further accelerate CI and builds whenever possible!
Unfortunately it's not super clear how sccache would integrate with incremental compilation in Rust. There will never be an exact cache hit as sccache already otherwise does that, so we sort of need an "almost cache hit" to load something from the cache. One possible idea may be to hash fewer things and upload full compiler incremental cache directories. That way sccache would download the previous cache directory and let rustc take care of what should be reset.
In any case this isn't super pressing for now as incremental for release builds is still aways out, but figured I'd open an issue!
The text was updated successfully, but these errors were encountered: