News for hackers. Stuff that matters.
Re:Pip and cargo are not the same by kelnos on Wednesday January 25, 2023 @11:28PM (#34527688)
Yeah it seems super weird to me that cargo doesn't cache built artifacts based on crate name + version + enabled features + rustc version (and anything else that might make it unique). It seems silly that I have many built copies of the same dependency scattered across different projects on my machine.

Then again, maybe it's actually fairly rare that the things that make a crate build unique are all the same all that often, and the gains vs. complexities of caching just aren't worth it.

Re:Pip and cargo are not the same by jackosdev on Thursday January 26, 2023 @02:03AM (#34528558)
sccache works really well and there’s only two steps to install it and enable it globally, speeds up compilation time a lot as well:

https://github.com/mozilla/sccache

Re:Pip and cargo are not the same by the_duke on Thursday January 26, 2023 @03:00AM (#34528970)
sccache includes the absolute path for each compilation, so it doesn't help with caching the same dependency across different projects.
Re:Pip and cargo are not the same by jackosdev on Friday January 27, 2023 @09:52PM (#34554626)
Oh yeah, can fix that though with:

mkdir -p ~/cargo/target

export CARGO_TARGET_DIR="~/cargo/target"