Specifying the Target Installation Path

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


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

--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.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.