this post was submitted on 13 Oct 2023
307 points (81.8% liked)
Programmer Humor
32503 readers
402 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Meh, what else is it supposed to do, delete sources all the time? Then people with slow connections will complain.
Also size-wise that's actually not even much (though they could take the care to compress it), what actually takes up space with rust is compile artifacts, per workspace. Have you heard of kondo?
Idk, maybe you can share the common packages across projects. (That can never go wrong, right? /s)
Sources are shared, sharing compile-time artefacts is done within workspaces.
Oh.. I did mean sharing comptime artifacts
You can globally share compile artifacts by setting a global target directory in the global Cargo config.
In $HOME/.cargo/config.toml:
The only problems I had when I did it where some cargo plugins and some dependencies with build.rs files that expected the target folder in it's usual location.
I actually vastly prefer this behavior. It allows me to jump to (readable) source in library code easily in my editor, as well as experiment with different package versions without having to redownload, and (sort of) work offline too. I guess, I don't really know what it would do otherwise. I think Rust requires you to have the complete library source code for everything you're using regardless.
I suppose it could act like NPM, and keep a separate copy of every library for every single project on my system, but that's even less efficient. Yes, I think NPM only downloads the "built" files (if the package uses a build system & is properly configured), but it's still just minified JS source code most of the time.
With python and virtualenv you can also keep the entire source of your libraries in your project.
Can't you shallow clone submodules? Is it possible to configure this as the default behavior at the outer repo level?
I cargo sweep every once in a while. Not the solution solution, but it's better than nothing.