Specifying the Target Installation Path


#1

Is it possible for cargo to specify the installation directory? I can’t see it. Use case is a server, with the program being started from a script at reboot.

“cargo install” puts the binary in ~/.cargo/bin

I would like to be able to do something like:

sudo cargo install --path /usr/local/bin


#2

Perhaps the cargo install --root flag can help here?


#3

--root does make the binaries go to ${ROOT} , but to ${ROOT}/bin , which can be an issue.

It might also be useful to be able to specify the path of the executable to install including the filename. Although that would only apply to crates with one single binary target.