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

Per-user compiled artefact cache #5931

Open
djc opened this Issue Aug 23, 2018 · 6 comments

Comments

Projects
None yet
5 participants
@djc
Contributor

djc commented Aug 23, 2018

I was wondering if anyone has contemplated somehow sharing compiled crates. If I have a number of projects on disk that often have similar dependencies, I'm spending a lot of time recompiling the same packages. (Even correcting for features, compiler flags and compilation profiles.) Would it make sense to store symlinks in ~/.cargo or equivalent pointing to compiled artefacts?

@alexcrichton

This comment has been minimized.

Member

alexcrichton commented Aug 23, 2018

There's been musings about this historically but never any degree of serious consideration. I've always wanted to explore it though! (I think it's definitely plausible)

@aidanhs

This comment has been minimized.

Member

aidanhs commented Sep 2, 2018

sccache is one option here - it has a local disk cache in addition to the more exotic options to store compiled artifacts in the cloud.

@djc

This comment has been minimized.

Contributor

djc commented Sep 2, 2018

sccache would be good for the compilation time part, but it'd be nice to also get a handle on the disk size part of it.

@Eh2406

This comment has been minimized.

Contributor

Eh2406 commented Nov 23, 2018

cc #6229

@Vlad-Shcherbina

This comment has been minimized.

Vlad-Shcherbina commented Nov 23, 2018

I think you can put

[build]
target-dir = "/my/shared/target/dir"

in ~/.cargo/config.

But I have no idea if this mode is officially supported. Is it?

@Eh2406

This comment has been minimized.

Contributor

Eh2406 commented Nov 23, 2018

Yes it is, as is setting it with the corresponding environment variable. However the problems with cargo never deleting the unused artifacts gets to be dramatic quickly. Hence the connection to #6229

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment