Re:Thoughts on Rust bloat
by asgeir on Thursday August 22, 2019 @04:04AM
(#20765740)
Have you considered doing something like this:
Then you can have something like this in your ~/.config/user-tmpfiles.d/clean_build.conf
You can then do cleanup by calling
Or you can use the tmpfiles timer
[ Parent
| on HN ]
Re:Thoughts on Rust bloat
by leggomylibro on Saturday August 24, 2019 @04:07PM
(#20789398)
That sounds like an interesting idea, thanks! Can that '--target-dir' argument be added in the build.rs script?
It looks like you can set it using a CARGO_TARGET_DIR environment variable or build.target-dir config value. So I guess you could create a $HOME/.cargo/config file with the following in it (letting you skip the --target-dir part):
[build]
target-dir = "/home/user/build-artifacts"
But I don't know if the different projects will trample each other that way. If that's the case you could just go with a .cargo/config per-project targeting a subdirectory of the build-artifacts directory.