Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.

https://doc.rust-lang.org/cargo/commands/cargo-build.html

https://doc.rust-lang.org/cargo/reference/config.html



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: